I2C LCD on PIC18F47K42

Thread Starter

AlbertHall

Joined Jun 4, 2014
12,625
No problem huh? I've done I2C before, I'll adapt some of my previous code?
WRONG!
PIC18F47K42 does not do I2C even vaguely like the earlier PICs. OK, no problem. MCC covers this chip so I'll use that. MCC creates an impenetrable mess of code which I could live with but it doesn't work.
Somebody else must have this problem so Mr Google is my friend but he couldn't find any code for this kind of chip.

So, in despair, I thought I'd write some bit-bang I2C code - AND IT WORKS!
It is driving the PCF8574 expander chip on the back of the LCD. That chip has a maximum bus speed of 100kHz, and I can bit-bang it at 200kHz (64MHz PIC clock speed which helps).

Why does it have to be this hard to do I2C?
 
Top