Posted: Fri Sep 27, 2019 2:20 pm Post subject: Bascom ADXL345 via I²C -no response by device
Dear all,
I do my first steps with I²C on Bascom so it may be that I do not see the trees because of the forest.
I want to run a ADXL345 accelerometer via I²C.
The accelerometer is on a breakout board installed on a breadboard. MCU runs on Arduino UNO R3 board.
SCA,SCL are pulled HIGH to VDD=5V via 2k4 resistors.
SDO , which to my opinion is the AltAddress pin is fixed to VDD.
This has now influence on the codes for reading and writing to registers.
As I understand the datasheet the 7 bit slave address is 0011101.
To complete it to a byte the LSBit is attached to the right hand side. 1 for read ; 0 for write
So the command after the start announcing a writing access is 00111010 (3A)
So the command after the start announcing a reading access is 00111011 (3B)
I also integrated a bus scanner in the program.
No slave is found by the scan.
The code is attached.
Please be so kind to give me some advice.
Best regards
Christian
(BASCOM-AVR version : 2.0.8.1 , Latest : 2.0.8.2 )
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum