Adding an extra TRISb.6 = 0 between loops made no difference.
Changing to LATb.6 = 1 works. Thanks for that. Problem solved.
Interestingly, further down the code is ON INTERRUPT. If I put the PORTb.6 = 1 loop after the ON INTERRUPT statement it works fine???
I usually use DT's instant int's (fantastic by the way) but this programme uses I2CREAD and I2cWRITE and so had to go back to ON INTERRUPT to prevent the timing being upset by the ISR.




I just can't remember all the details of how.


Bookmarks