I am using the Firebeetle ESP32 board by DFROBOT DFR0478
There is a schematic on their web site and pinouts diag. and it doesnt show anything connected to the DAC pins.
And I don't see anything connected on the board. I have nothing else connected except the USB port.
It uses the DFROBOT ESP-WROOM-32 module on the board and I dont see anything connected on the pins of it on the schematic.
As far as I can see the DAC ports are Pins 3 and 4 on the firebeetle board, called D2 and D3, or GPIO25 and GPIO26,...connected to pins 10 and 11 of the WROOM module which is connected to pins 13 and 14 of the actual ESP32 chip.
And I am using Pin 15 on the firebeetle board as GND.
What I am finding is sine wave with amplitude factor above 80 in the calculation below gives distortion
Code: Select all
void setup()
{
Serial.begin(115200);
Serial.println("config done.");
//initialize i2s with configurations above .....I put this bit in setup....????
i2s_set_pin((i2s_port_t)i2s_num, NULL); // NULL here needed for BUILT_IN DAC
i2s_driver_install((i2s_port_t)i2s_num, &i2s_config, 0, NULL);
Serial.println("I2S installed and started!");
// Create Data below.....
// Make sure data is between 0 and 1V
for(int i = 0; i < 256; i++) {
sin_float = ((sin(i / 256.0 * 2 * PI)+1) * 88); //calc. sinewave all above zero, 1 cycle x 256 samples.
// Above line with amplitude of 80 and below works OK...no distortion
// 81 and above distortion begins to appear......so the above line at 88 gives distortion...????
samples[i] = ((uint32_t) (sin_float) << 8) + ((uint32_t) (sin_float) << 24); //...output IO25 and output IO26...
}
// Write data to the buffer.
i2s_write_bytes((i2s_port_t)i2s_num, (const char *)samples, 1024, portMAX_DELAY);
}