[HeRos] I2C where are you

Hello,

I am a little bit late for my post for Friday working since I get some trouble with my new laptop. Friday, I started with changing the output of MCO1. MCO1 is used to provide a clock for the camera. I need 24 MHz but I only had 16 MHz. At the beginning, MCO1 was setting to HSI and after I have changed it to HSE, I got my 24 MHz clock on the oscilloscope:

MCO1_quartz_24MHz

Next, I focused myself on the camera. The camera is a slave device using the SCCB protocol. The SCCB protocol looks like the I2C protocol except you don’t need to use pull up and the ninth bit is called “don’t care bit” instead of “acknowledge bit” for I2C. Thus, I was able to use the I2C master from the STM32F4 to speak with the camera. I saw on internet that a lot of people have succeeded it. In the case, it won’t work I will try to adapt the ChibiOS driver or at least, write a new one.

In order to watch the I2C communication, I used a logic analyzer. The included software with the logic analyzer allow to decode the mean of the packets. However, I saw nothing since my code didn’t work.

Analyseur logique pour I2C

I lost a lot of time to control the CAM_RST pin. The pin output stayed at 0 even if I called the function to put a 1. After being crazy 40 minutes, I ask for help to Samuel. Firstly, he didn’t understand too nevertheless he discovered the error. Instead of calling palSetPad, I was using palSetPort.  palSetPort made a | logic with the port.

Eric

Eric Masseran

LinkedIn 

2 comments to [HeRos] I2C where are you