
Originally Posted by
Charles Linquis
Has anyone successfully read a Philips 8591 using PBP? I can "talk" to virtually any other device I have come across, but this one has me stumped. Can someone tell me what I'm doing wrong? And yes, I have pull-ups on the SCL and SDA lines!
Code is below.
---------------------------------------------------------------------
PCF8591 CON %10010000
SetupI2C:
DevAddr = 0 : DevAddr = DevAddr << 1 : DevAddr = PCF8591 | DevAddr
I2CWRITE PORTC.4,PORTC.5,DevAddr,$44,[0] ; Use internal clk, auto-increment mode
RETURN
ReadI2C:
DevAddr = 0 : DevAddr = DevAddr << 1 : DevAddr = PCF8591 | DevAddr
I2CREAD PORTC.4,PORTC.5,DevAddr,[PSByte1,PSByte2,PSByte3,PSByte4] ; Read all 4 channels
RETURN
Bookmarks