-1
\$\begingroup\$

I have a circuit with PIC16f628a interfaced to Holtek HT16C21 Display RAM IC via I2C interface, I have two MCUs one is Original software from OEM and second one is containing software written by me, when I use the original controller it works fine which means the hardware is OK, but when I put my controller on hardware then the HT16C21 never acknowledges the first address byte, when I test the same code with 24c32 and PCF8574 on proteus, it works. If the Hardware is OK, and my software is working on another ICs on proteus, why it is not only working with HT16C21? The address of HT16C21 is 0x70 in datasheet

\$\endgroup\$
1
  • 3
    \$\begingroup\$ It's time to power up an oscilloscope and acquire some traces of SDA and SCL during a transaction. Also post a schematic that details all of your connections. Also indicate the bus pull-up values in use and cable lengths. And then some folks will also want you to post your code. \$\endgroup\$ Commented May 22, 2023 at 12:19

1 Answer 1

-1
\$\begingroup\$

Issue resolved. The problem was the diode that is connected on the SDA line for reverse protection (I think), which prevented the HT16C21 pulling down the SDA of the PIC16F628A while acknowledging. I bypassed the acknowledge in code, and the problem was solved.

\$\endgroup\$
3
  • 5
    \$\begingroup\$ Nobody could have guessed that you have a diode on the bus. It would have been immediately seen if you had posted a schematic or said you have a diode on SDA, which would have triggerer alarms for anyone familiar with I2C. \$\endgroup\$
    – Justme
    Commented May 22, 2023 at 15:58
  • 5
    \$\begingroup\$ "So I bypass the acknowledge in code so problem solved," ...that is until a NAK gets asserted, and you won't be able to detect it, and the ice cream comes out chocolate instead of vanilla. ...or the green light turns on, instead of the red. \$\endgroup\$ Commented May 22, 2023 at 16:57
  • \$\begingroup\$ @Justme, yes the schematic should be posted for proper resolution. \$\endgroup\$
    – Adil Ahmed
    Commented May 23, 2023 at 15:48

Not the answer you're looking for? Browse other questions tagged or ask your own question.