Search found 4 matches

by KBerger
Thu Mar 24, 2022 3:54 pm
Forum: ESP32 Arduino
Topic: Generate one sine wave with I2S and internal DAC
Replies: 6
Views: 5800

Re: Generate one sine wave with I2S and internal DAC

Excellent suggestion! I created a null buffer and pushed it to I2S immediately after the filled buffer. This will work but I'm going to explore the use of an interrupt - new territory for me. uint32_t nullBuf[128] = {0}; . . . i2s_driver_uninstall(I2S_NUM_0); // Remove I2S driver i2s_config_t i2s_co...
by KBerger
Wed Mar 23, 2022 4:42 pm
Forum: ESP32 Arduino
Topic: Generate one sine wave with I2S and internal DAC
Replies: 6
Views: 5800

Re: Generate one sine wave with I2S and internal DAC

OK, I see your point. Define a sine wave and save it in a buffer. I've tried doing for a triangular wave that but still get a continuous output. How do I get just one cycle? Here is the relevant code for a triangular wave in buf: i2s_config_t configI2S(int rate, int size) { // Configuration for the ...
by KBerger
Tue Mar 22, 2022 3:06 pm
Forum: ESP32 Arduino
Topic: Generate one sine wave with I2S and internal DAC
Replies: 6
Views: 5800

Re: Generate one sine wave with I2S and internal DAC

How does that solve the problem of generating just one cycle? It seems that if I could do that with an external DAC I could also do it with the internal ones.
by KBerger
Mon Mar 21, 2022 8:57 pm
Forum: ESP32 Arduino
Topic: Generate one sine wave with I2S and internal DAC
Replies: 6
Views: 5800

Generate one sine wave with I2S and internal DAC

I'm stumped as to how to output exactly one cycle of a sinewave at a selected frequency. The sine needs to start at the mid-value (127) run to the positive peak, back through the midpoint, then the negative peak (0) before returning to 127. This code outputs a continuous wave of the desired frequenc...