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

ligteltelecom
Posts: 11
Joined: Wed Oct 25, 2023 10:37 pm

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

Postby ligteltelecom » Sun May 12, 2024 1:08 pm

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.

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

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

Postby liaifat85 » Sun May 12, 2024 2:04 pm

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.

MicroController
Posts: 1724
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

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

Postby MicroController » Sun May 12, 2024 3:22 pm

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.

ligteltelecom
Posts: 11
Joined: Wed Oct 25, 2023 10:37 pm

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

Postby ligteltelecom » Mon May 13, 2024 12:47 am

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

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

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

Postby ESP_Sprite » 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?

ligteltelecom
Posts: 11
Joined: Wed Oct 25, 2023 10:37 pm

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

Postby ligteltelecom » Mon May 13, 2024 10:23 am

What is the maximum frequency I can achieve using this function?
esp_timer_start_periodic()

ligteltelecom
Posts: 11
Joined: Wed Oct 25, 2023 10:37 pm

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

Postby ligteltelecom » Mon May 13, 2024 7:58 pm

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?

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

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

Postby ESP_Sprite » 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.

ligteltelecom
Posts: 11
Joined: Wed Oct 25, 2023 10:37 pm

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

Postby ligteltelecom » Tue May 14, 2024 12:44 pm

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.

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

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

Postby ESP_Sprite » Wed May 15, 2024 12:01 am

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.

Who is online

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