Author Topic: NHD-0420D3Z-FL-GBW-3V Dropping characters over I2c  (Read 3025 times)

camac881

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
NHD-0420D3Z-FL-GBW-3V Dropping characters over I2c
« on: November 11, 2014, 02:05:13 PM »
Hello All,
  I saw the other posts about losing characters over I2c due to firmware issues and tried the same fix by slowing it down. It has gotten better but I'm still dropping the occasional character. I am running the screen from an Arduino Uno and displaying data from an SPI A/D converter.

 My question is what is the correct way to code a speed correction for the Arduino? The line I'm using now is
#define TWI_FREQ = 100000L / 6; Is that correct?

Thanks,
Cam

Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-0420D3Z-FL-GBW-3V Dropping characters over I2c
« Reply #1 on: November 11, 2014, 03:12:01 PM »
I'm not sure if this applies to the Uno as well as the Mega, but with the Arduino Mega I have used "TWBR = 152;" (sets I2C clock frequency to 50kHz) after I call "Wire.begin()" in the setup() function.
I would check the Arduino forums/documentation to confirm this works with the Uno too.

camac881

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: NHD-0420D3Z-FL-GBW-3V Dropping characters over I2c
« Reply #2 on: November 12, 2014, 08:16:37 AM »
Hello Michael,
  That worked perfectly. Thank you.

  I checked the Wire library reference at Arduino.cc and they referenced the data sheet at Atmel and a table that does not make this any clearer. How do you come up with the number? Do you gather all the pieces and run them through the formula? It seems like herding cats to me.

Thanks for your help!
Cam


Michael_L

  • Administrator
  • Hero Member
  • *****
  • Posts: 356
  • Karma: 33
    • View Profile
Re: NHD-0420D3Z-FL-GBW-3V Dropping characters over I2c
« Reply #3 on: November 14, 2014, 09:41:07 AM »
You're welcome!  This site should help:

http://www.gammon.com.au/forum/?id=10896

 

Character LCD NHD‐0220D3Z‐NSW‐BBW‐V3 not receiving correct characters

Started by davekBoard Character LCDs

Replies: 1
Views: 2363
Last post March 25, 2016, 05:23:05 PM
by Saurabh_B
NHD‐240128WG‐BTFH‐VZ - custom characters

Started by saubaerBoard Graphic LCDs

Replies: 1
Views: 1246
Last post November 11, 2016, 12:09:42 PM
by Saurabh_B
RS232 PIC CCS COMPILER COMANDS FOR NHD-0420D3Z-NSW-BBW-V3 ISSUE

Started by DavidVMBoard Character LCDs

Replies: 2
Views: 745
Last post May 30, 2017, 12:58:32 PM
by DavidVM
NHD-0420D3Z-NSW-BBW-V3 back-light flickers

Started by rickford66Board Character LCDs

Replies: 3
Views: 3547
Last post May 06, 2015, 08:34:09 AM
by fraryb
Changing the Slave Address with NHD-0420D3Z

Started by alkBoard Character LCDs

Replies: 2
Views: 2635
Last post January 13, 2015, 01:53:20 PM
by alk