NHD-0420D3Z - Arduino I2C Address 0x28 SOLVED

Comments

1 comment

  • Ted M.
    NHD Staff

    If you read the NHD data carefully it does imply 0x50 is an 8 bit value with the lowest bit set to zero:-

    "The default I2C address is 80 (50 hex). The I2C address can be changed to any 8-bit value by command
    function, with the exception that the LSB (least significant bit) must always be '0'."


    0x68 on the DS3231 is a seven bit address to which you have to add the read or write bit. You can use this directly in the Wire library as Wire adds the read/write bit.

    The I2C call on the Parallax stamp uses an 8 bit address, Wire on the Arduino uses a 7 bit address and shifts it left.

    On the Arduino you therefore have to convert the 8 bit NHD display address 0x50 given in the data sheet to 0x28 before you send it to the wire library. Wire will restore the address to 0x50 for transmission.

    I should have realised this because when I looked carefully into my old PBasic Code I declared all the addresses in set up but on the call to the sub routine which reads the clock I found a shift left with a comment about this.

    Other tips to save you reading additional threads - The NHD display cannot be powered from the Arduino 5v when the Arduino is powered from USB as the 5v supply falls to 4.69v. Maximum clock rate has been de-rated by Newhaven to 50KHz. Use Wire.setClock(50000L) after Wire.begin to reduce the clock rate. If you do not reduce the clock rate the display misses characters.

    Update 14/08/2018 - The Wire page has a note about the 7 bit and 8 bit addresses which somehow I missed https://www.arduino.cc/en/Reference/Wire

    0

Please sign in to leave a comment.