I2C Master Acking after Receive

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C Master Acking after Receive

215 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by elsingc on Mon Jun 22 05:38:23 MST 2015
I am using the LPC810 with the HMC5883L. I have it all working except the receive part. Whenever I go to receive something, it will read in the data, however, there is always a NACK when I want to stop transmission. I believe this is causing the HMC5883L to then want to resend the old data as I cannot get the updated data. My code flow is below.

Load MSTDAT with ((Address << 1) | 1)
Set CTRL to start
uint32_t temp = MSTDAT
set CTRL to stop.

Its very simple. One thing I noticed is that if I read twice, the first byte read is acked, but the last byte is always nacked. I think I am not stopping it correctly. Does anybody know whats up?
Labels (1)
0 Kudos
0 Replies