| FORUM

FEDEVEL
Platform forum

Design Your Own Board Tutorial- I2C doesn't work

Pearl , 06-12-2024, 07:09 AM
Hi, I went through the whole tutorial, received the boards and uploaded the software exactly as Robert showed in the video.
the code lines where I tried to communicate with the accelerometer fails- the red LED turn on. I debugged and saw that the I2C_read1byteregister function doesn't get the correct ID value (according to datasheet 0x35) or doesn't get to the correct address (0x0e- device on bus, 0x0f- WHO_AM_I register).
Does anyone have an idea what could be te problem and how to solve it?
Robert Feranec , 06-12-2024, 08:06 AM
You mean this tutorial? https://www.youtube.com/playlist?list=PLXvLToQzgzdea0sQXmpY8k4tfiXpkYIwO
Robert Feranec , 06-12-2024, 08:06 AM
This is the latest code: https://github.com/FEDEVEL/wand
Robert Feranec , 06-12-2024, 08:07 AM
If the code doesn't work, then it may be soldering problem as it should work
Pearl , 06-14-2024, 05:58 AM
Yes, this is the tutorial. I'll try the code from the link. thanks 🙂
Pearl , 06-16-2024, 03:42 PM
So I tried this, the problem seems to be connecting with accelerometer- the red light is turned on, which means the PIC does not receive the correct ID number from the accelerometer or that the software doesn't read the correct register. I debugged the LEDs separately and they work perfectly. Any ideas how to debug this?
QDrives , 06-16-2024, 04:10 PM
Check with an oscilloscope if the I2C signals are presented on the lined.
Robert Feranec , 06-17-2024, 05:20 AM
Did you try multiple boards and they all have the same behaviour?
Pearl , 06-17-2024, 06:33 AM
Yes. I manufactured 5, the assembly looks good and they all work OK electrically. I use Pickit 5 , MPLAB 6.15 with compiler XC8. I tried the code that tests the I2C the red LED gets turned on each time.
Robert Feranec , 06-17-2024, 07:44 AM
did you use the same accelerometer? dont forget, sometimes in datasheet they use 7bit address which has to be shifted 1 bit left
Use our interactive Discord forum to reply or ask new questions.
Discord invite
Discord forum link (after invitation)

Didn't find what you were looking for?