Menu

Finding I2C address on a TWI SainSmart display

Help
lhatch
2015-05-29
2015-06-02
<< < 1 2 (Page 2 of 2)
  • lhatch

    lhatch - 2015-06-01

    I re-compiled with all addresses, no go on any, did it twice to make sure. Here is the code below. The one module that works in from mpja.com, the other was off ebay and does not work.

    ~~~~

    chip mega328p, 16

    config mclr_on

    HI2CMode Master

    define HI2C_DATA

    define LCD_IO 10

    define LCD_I2C_Address 0x4e '// Change to 0xFE for SainSmart

    define LCD_Backlight_On_State 1 '// These may need to be reversed

    define LCD_Backlight_Off_State 0

    do
    CLS
    Locate 0,0
    PRINT "My Name, your"
    Locate 1,0
    Print "name in lights"
    wait 3 s
    loop

     

    Last edit: Anobium 2015-06-02
  • Anobium

    Anobium - 2015-06-01

    Can you take some photographs of the back of the module? When i wrote the driver I wrote it to support two types of driver chips and any pcb layout.

    Also, ebay url - I would like to see the listing.

    Evan

     

    Last edit: Anobium 2015-06-01
  • lhatch

    lhatch - 2015-06-01

    Well, it is a 3E Sainsmart. And it now works. Not sure why the pull-ups did not work before, added them again, went through the addresses William left and boom, works. I solder them on the TWI board, so all good. Crazy but it works. Thanks Evan as well, not sure why the pull-ups did not work over the weekend.

     
  • William Roth

    William Roth - 2015-06-02

    What 8-bit address did you finally use in your GCB code?

    3E is a 7-bit address and would mean an 8 bit address of 0x7C. Is this correct?

    If this is correct and the chip is not marked PCF8574AT, then the chip is most likely fake/knockoff. Personally I would stay away from this brand of device in the future.

    Again, PLEASE post the link to the device in EBAY. Not to something similar but to the exact device and seller that you purchased from.

    We helped you get it working, now you need to help us by answering our questions and providing the requested information so that we can build our knowledge base.

    Edit:

    I looked at SainSmart web site. They only offer the I2C adapter with address 0x3F. This is 0x7E for GCN code. Further investigation by blowing up the photos shows that the I/O expansion board has an "unbranded" PCF8574T.

    The front and backside photos show that there are only 2 resistors on the entire board.These These are on the back side and are marked either 102 or 103. (1K or 10K) and appear to be for the backlight transistor. This means that there are no pullups on this rather expensive adapter. The only way to tell for sure is to take resistance measurements.

    Look at other the other I2C @adapters and you will see all of the resistors on the front with pullups included.

    My conclusion is to stay as far away from these SainSmart LCD products as possible. They are overpriced and inferior compared to the other offerings.

     

    Last edit: William Roth 2015-06-02
    • lhatch

      lhatch - 2015-06-02

      The EBAY link was posted in my third post in this thread on page one (like 5th post). The address was in my last post above. 0x3e works. It was a lack of 4.7K pullup on the CLK and DATA lines.

      This is my first sainsmart (it was $5.00 TWI, 4x20, backlight, shipping included) figured I could afford that and take the chance. The others I normally buy are 2x16 TWI and $9.95 each mpja.com website, they are local to me so I drive there and save on shipping.

       
  • Anobium

    Anobium - 2015-06-02

    I am puzzled. Post your final asm file please. I still do not understand the address 0x3e.

    Most grateful,

    Anobium

     
  • lhatch

    lhatch - 2015-06-02

    Evan/William, this works. Not sure what the LEDIO 10 and ADDRESS 0x3e do but it works. Will go read up and see. I also noticed, a address 0x4E and 0xFE and it still works just fine. It was pullup that got it going for sure. Can anyone comment the lines for the IO and Address, this is weird.

    ~~~~
    chip mega328p, 16
    config mclr_on
    HI2CMode Master
    define HI2C_DATA
    define LCD_IO 10
    define LCD_I2C_Address 0x3e
    define LCD_Backlight_On_State 1
    define LCD_Backlight_Off_State 0
    do
    CLS
    wait 1 s
    Locate 0,0
    PRINT "Line 1"
    Locate 1,0
    Print "Line 2"
    wait 3 s
    loop

     

    Last edit: lhatch 2015-06-02
  • William Roth

    William Roth - 2015-06-02

    .
    " I also noticed, a address 0x4E and 0xFE and it still works just fine."

    Please clarify the above statement. Are you saying that Addresses 0x4E and 0xFE will also work with this module?

     
  • lhatch

    lhatch - 2015-06-02

    William, correct all three addresses work, can try more? I change the text each time so I know the code compiled and downloaded.

     
  • viscomjim

    viscomjim - 2015-06-02
     

    Last edit: viscomjim 2015-06-02
<< < 1 2 (Page 2 of 2)

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.