Page 1 of 1

how generate clock and data 32khz to 10mhz using esp32

Posted: Sun May 12, 2024 1:08 pm
by ligteltelecom
Hello, is it possible to generate clock and date between 32khz and 10mhz.
I tried use, but the maximum I could reach was 10khz

#define DT 0.0001
esp_timer_start_periodic(timer1Handle, (int)(1000 * 1000 * DT));

I dont want use LEDC for generate this clock.

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Sun May 12, 2024 2:04 pm
by liaifat85
Ensure that your code is optimized for performance to achieve the highest clock frequency possible. This includes minimizing interrupt latency, reducing unnecessary computations, and optimizing loop structures.

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Sun May 12, 2024 3:22 pm
by MicroController
ligteltelecom wrote:
Sun May 12, 2024 1:08 pm
Hello, is it possible to generate clock and date between 32khz and 10mhz.
Not in software.
Look into using a hardware periperal, like SPI or LCD, maybe RMT.

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Mon May 13, 2024 12:47 am
by ligteltelecom
Hi guys. I'm not using a loop inside the callback. but I need to generate frequency between 32khz - 25mhz. within this callback I will send the bits I need

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Mon May 13, 2024 1:52 am
by ESP_Sprite
Bitbanging on an ESP32 is generally not a good idea and it's unlikely you'll be able to do it at 25MHz. Are you absolutely 200% sure there's not a peripheral in the ESP32 (e.g. I2S, SPI, RMT, ...) that can be convinced to generate that protocol for you?

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Mon May 13, 2024 10:23 am
by ligteltelecom
What is the maximum frequency I can achieve using this function?
esp_timer_start_periodic()

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Mon May 13, 2024 7:58 pm
by ligteltelecom
ESP_Sprite wrote:
Mon May 13, 2024 1:52 am
Bitbanging on an ESP32 is generally not a good idea and it's unlikely you'll be able to do it at 25MHz. Are you absolutely 200% sure there's not a peripheral in the ESP32 (e.g. I2S, SPI, RMT, ...) that can be convinced to generate that protocol for you?
Hello everyone, can I use i2s with callback? to send the data within this callback?

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Tue May 14, 2024 3:00 am
by ESP_Sprite
ligteltelecom wrote:
Mon May 13, 2024 7:58 pm
Hello everyone, can I use i2s with callback? to send the data within this callback?
I mean, that depends on the callback?

Can you step back a bit and give us an overview of what you're trying, rather than posting one-off questions to the forum that we can't really answer without context? Explain a bit what your device needs to do, tell us what sensor you're interfacing with, what SDK you're using, what other constraints (latency?) you have etc. That allows us to answer your questions a lot more precise.

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Tue May 14, 2024 12:44 pm
by ligteltelecom
ESP_Sprite wrote:
Tue May 14, 2024 3:00 am
ligteltelecom wrote:
Mon May 13, 2024 7:58 pm
Hello everyone, can I use i2s with callback? to send the data within this callback?
I mean, that depends on the callback?

Can you step back a bit and give us an overview of what you're trying, rather than posting one-off questions to the forum that we can't really answer without context? Explain a bit what your device needs to do, tell us what sensor you're interfacing with, what SDK you're using, what other constraints (latency?) you have etc. That allows us to answer your questions a lot more precise.

Hello, I need to communicate with some ICs that use the SPMI protocol. This protocol works with frequencies 32khz to 25mhz.

I've been taking a look at the i2s protocol and I believe I can do something with it.

Re: how generate clock and data 32khz to 10mhz using esp32

Posted: Wed May 15, 2024 12:01 am
by ESP_Sprite
That protocol looks quite like SPI, to be honest; you may be able to generate your data using that peripheral. Only issue is that on later chips (S3, C3 etc) we don't support non-multiple-of-8 bit transactions, but if SPMI is OK with padding to a multiple of 8-bit, you may be able to get that to work.