Setting up SPI communication on the RM46 microcontroller for the OV5642

Hi, I’m trying to port a very simple arduino sketch to the RM46 microcontroller from TI. The main goal is to just interface with the test register (0x00) and read/write dummy data. After that I plan to re-write the rest of the camera functions. Right now, I’m able to read from what I believe are the correct registers, but I’m getting different data than on the Arduino. If anyone could take a look and see any issues with my implementation please let me know.

A note, I looked at the registers table hardware application note and saw that the register 0x40 is supposed to read 0x62, and even on the arduino I’m reading 0x80, which is incorrect. On the RM46, I’m reading 0x60. Seems like the register is correct, not sure if I’m losing a bit somewhere but the data is consistent.

I linked two pastebins below, one is for the RM46 code and one is the original Arduino code I’m trying to copy. The RM46 code has some extraneous libraries for the repo which can be ignored.

Thanks for any help!

Hi,

We have not developed on the platform RM46, but you refer to our Arduino code

There may be two causes of reading the wrong register:

  • The SPI cable is too long

  • The SPI’s clock is too fast, we recommend you can use a frequency below 4MHZ.