Hello! I am currently making a little datalogger board to fly inside model rockets. In short, the board has an ATTINY 824 which should collect data from the BMI055 IMU to then write it in a flash chip for the duration of the flight. Once the device detects a landing it moves the data into an SD card. So far I've been able to upload test sketches which blink the interface LED's on the board. I've since moved on to attempt SPI communication with the IMU, but I can't get it to read the IMU's gyro chip ID. I am using the interface LED's to read the values received through SPI, and every time I attempt to read the gyro chip ID, I get the binary value 11111111 (255) instead of the expected 00001111 (15), which I think indicates that the gyro is not understanding the command and is just leaving the MISO line idle. Here is the code that runs this, for reference:
digitalWrite(PIN_PA7, LOW);
receivedData = (SPI.transfer(0x00))/5; /*I divide the value by 5 because otherwise I would have to count 255 blinks to read the max binary value*/
digitalWrite(PIN_PA7, HIGH);
I read the BMI055 datasheet as well, and I tried to enter the SPI read instruction as they defined it by using the first bit as a R/W indicator and the remaining 7 as an address.
digitalWrite(PIN_PA7, LOW);
receivedData = (SPI.transfer(0b10000000))/5; /*I divide the value by 5 because otherwise I would have to count 255 blinks to read the max binary value of 11111111*/
digitalWrite(PIN_PA7, HIGH);
delay(500);
I have also tried to run the code in two separate boards but still have no luck, so I think I can rule out faulty hardware. Here are all the schematics, datasheets, code, and other info that may be useful (the forum does not let me upload attachments since I am a new user so I uploaded them to a google drive folder):
https://drive.google.com/drive/folders/15rwWyw8nzJLBnM5iWjcLNbN-B7tYJpz3?usp=sharing
I am relatively new to embedded design so any critiques on my schematic are always welcome too ![]()