Forum Discussion
Altera_Forum
Honored Contributor
8 years agoDE1-SoC Interfacing with ADXL345 3 Axis Accelerometer [I2C]
I have a DE1-SoC board and I'm using the low level altera provided API calls included with the board. I have also referenced the article published "Using the Accelerometer on DE-SoC Boards" which pro...
Altera_Forum
Honored Contributor
8 years agoXXRyanXXL,
When sending over the I2C the first byte has to have the restart bit set and the last byte has to have the stop condition bit set. When it's a single byte, both bits must be set. e.g, sending bytes (0x11, 0x22, and 0x33) these are written to the data-command register: *Reg = 0x11 | (1<<10); *Reg = 0x22; *Reg = 0x33 | (1<< 9); When sending one byte (0x11): *Reg = 0x11 | (1<<9) | (1<<10) Regards