SPI clock signal always active

jtrose7
Posts: 4
Joined: Wed Feb 01, 2023 3:28 pm

SPI clock signal always active

Postby jtrose7 » Fri Oct 11, 2024 2:39 pm

I am using an ESP32-C3 in order to configure and read data from a microcamera. This microcamera needs to be provided with a continuous clock signal in the range of 10 to 75 MHz. Using the clock signal from the SPI peripheral would be a good solution. The problem is that the clock signal (as expected per protocol) is only active when a transaction is transmitted. I'd like to know if there is a way to keep active the clock signal, and still be able to provide configuration data and read pixel data when I think it is necessary.
I am of course open to other alternatives than SPI, but I just thought it is the most appropriate protocol. Thanks.

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI clock signal always active

Postby ESP_Sprite » Sat Oct 12, 2024 3:16 am

If it doesn't need to be synced with anything, I'd use the LEDC to generate that clock.

jtrose7
Posts: 4
Joined: Wed Feb 01, 2023 3:28 pm

Re: SPI clock signal always active

Postby jtrose7 » Sat Oct 12, 2024 4:09 pm

No, the clock needs to be synchronized when sending the configuration data to the microcamera. Which options do I have then?

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI clock signal always active

Postby ESP_Sprite » Sun Oct 13, 2024 1:40 am

Do you have a datasheet or something that details the protocol you're trying to speak a bit more? Having SCLK pulsing continuously indeed is not something the SPI peripheral supports by itself, but there may be a workaround.

jtrose7
Posts: 4
Joined: Wed Feb 01, 2023 3:28 pm

Re: SPI clock signal always active

Postby jtrose7 » Thu Oct 17, 2024 9:48 am

Yes, I attach it. We are using the cameras in SEIM mode. This means that there are two phases: The DATA+ line
carries the data from the ESP32 to the µcamera while DATA- line transmits the clock; reading phase, the ESP32 provides the clock signal in DATA- and the camera pixel information in the DATA+.
Thanks for the help.
Attachments
43_OsirisM_SensorSpecification_v1.1.0.pdf
(2.28 MiB) Downloaded 104 times

ESP_Sprite
Posts: 9757
Joined: Thu Nov 26, 2015 4:08 am

Re: SPI clock signal always active

Postby ESP_Sprite » Fri Oct 18, 2024 2:43 am

Given the fact that there's no CS line involved, I2S may be the best option to do what you want: it sends out a continuous bitclock and you can receive and transmit 1-bit data. The only thing that may be problematic is configuration as I2S signals traditionally have a fair bit of buffering on them and you'd need to do rx <-> tx switching manually, however if you only configure the sensor e.g. on startup this should not be an issue.

Who is online

Users browsing this forum: Bing [Bot] and 293 guests