chop

i2c in assembly again !!

Discussion created by chop on Feb 8, 2010
Latest reply on Feb 10, 2010 by Bob Smith

Just spent days trying to get the i2c system on a qg08 running , have tried int driven and non , no problems at all when writing to devices but the read is a different story , always get FF as the returned byte , as far as I can tell from the scope the system dies not send any clock pulses on the SCL line when I do a read (lda IICD) after  switching  the device address from transmit to receive mode  (  repeaded start,  IICC_MST =0 , IICC_TX=0) , the pull up resistors are 4K7  and swapping out MCUs makes no difference , and the clincher is that bit banging the I2C lines works beautifully on transmit and receive  !!

 

I've used both my own code and the "bigmac" code on the board ( On which subject , in the "init i2c" section there is :-   "BCLR   SRW,IICS       ; Set R/W bit = 0"   In the data I have for the QG8 SRW is a read only bit , Have I got an old data sheet or is this an error ?

 

Any suggestions happliy received :-)  , I'm just at the point of reverting to bit banged code , but it seems such a pity not to use a dedicated system if it's there 

 

Regards  Art 

Outcomes