Hi there
Been looking at this most of the weekend and found something else which seems to be caused by the same issue.
Quite some time ago I made this post here -
http://www.mikroe.com/forum/viewtopic.p ... t=pressure and just gave up on the board.
I have gone back to the example code because it runs on I2C and tried again. And again I get x2 transmissions like I previously reported. This is where the two transmissions occur -
Code: Select all
Pressure_Write(_RES_CONF, 0x78); // Initiating the pressure resolution on Pressure Click with writing HEX value in his register ( in this case HEX 0x78)
temp = Pressure_Read(_RES_CONF); // Begining of checking of entered value in the register _RES_CONF of the Pressure Click
The first transmission is from the write and the second from the read as far as I can tell. If I leave just one of the two lines in I get only one transmission and I played about with the read and write routines to make sure as well ie sending different numbers. This seems to be the same issue as I am having with the compass board ie only 1 byte is transmitted per write routine and the byte is not acknowledge by the receiving device ie click board.
I tried the debugger and found the code seems to get looped up here -
Code: Select all
L_I2C1_Start8:
0x0378 0xA0C5 BTFSS SSP1CON2, 0
0x037A 0xD001 BRA L_I2C1_Start9
;__Lib_I2C_c34d01.c,54 ::
0x037C 0xD7FD BRA L_I2C1_Start8
It would go from the BTFSS to the last line and then start over again.
The main issue I seem to be having is that the devices are not returning acknowledges to the PIC and the transmissions seems to end at this point.
- I assume the I2C address are correct because it does not even work with the example code.
The signal is definitely getting to the click board I have the logic analyser connected to the pins on the click board.
I tried the example I2C code for the EEPROM and it worked!
I compared the EEPROM code to my code and the only differences was the data values being sent ie address/registers etc.
I am sure this is some stupid oversight/mistake on my part don't know if anyone can suggest anything else?
David