Serial to WiFi Interface
Posted: Thu Aug 24, 2017 9:04 am
Hello People out there!
First I want to say that I am sorry for my bad english.
I am new to the esp32 and I am playing around with two pairs of different Devboards.
I want to read serial Data from an 16 bit ADC device, send the Data over WiFi to another esp32, connected to an 16 bit DAC.
As you can imagine, I want to build an almost realtime system.
I figured out, that the UDP speed is in overall ok for my project. (I want to make it as good as possible and to be happy with that)
The UDP test threw out something between 1,8x10^6 Byte/s and 3x10^6 Byte/s using a packet size of 1500.
Lets say, that in good case I could transmit 2.000.000 Byte/s, that would be 16.000.000 Bit/s.
Because of the 16Bit ADC, I could reach 1Meg.Sample/s.
I have also connected two boards together and tested the SPI slave driver with send and receive function.
Using a clock with too high frequencies resulted in an error.
"spi_master: spi_bus_add_device(210): No speeds >26MHz supported for full duplex, GPIO-matrix SPI transfers"
So in the predefined way I am able to send ~26MBit/s ? That would be ~3,25MByte/s in the very best case.
The error looks like I am not using SPI in hardware mode or something. I tried to use different pins that are marked as hardware SPI interface, but the problem still occured.
Also the driver sends the Data in bursts and I dont know if it is possible to fire out (or read data in) all the time.
I think, that I have to use DMA somehow to build a "first in first out" system.
I would like to read a block over SPI into DMA.
when the packet is written, it should trigger an interrupt and mark the block.
the next block should be written after that interrupt.
the UDP application should see that there is a marked block and transfer that block over WiFi.
(I think the block size should then be 1500Byte to fit the UDP packet size)
Once the UDP transfer is done, it should trigger an interrupt again, to unmark the memory.
When the SPI driver has written to the last defined block, it should start from the beginning.
So the WiFi must be in overall faster than the SPI but not all the time.
Can you give me some help how to start best?
Is it possible what I wanna do?
best wishes,
Rico Lauersdorf
First I want to say that I am sorry for my bad english.
I am new to the esp32 and I am playing around with two pairs of different Devboards.
I want to read serial Data from an 16 bit ADC device, send the Data over WiFi to another esp32, connected to an 16 bit DAC.
As you can imagine, I want to build an almost realtime system.
I figured out, that the UDP speed is in overall ok for my project. (I want to make it as good as possible and to be happy with that)
The UDP test threw out something between 1,8x10^6 Byte/s and 3x10^6 Byte/s using a packet size of 1500.
Lets say, that in good case I could transmit 2.000.000 Byte/s, that would be 16.000.000 Bit/s.
Because of the 16Bit ADC, I could reach 1Meg.Sample/s.
I have also connected two boards together and tested the SPI slave driver with send and receive function.
Using a clock with too high frequencies resulted in an error.
"spi_master: spi_bus_add_device(210): No speeds >26MHz supported for full duplex, GPIO-matrix SPI transfers"
So in the predefined way I am able to send ~26MBit/s ? That would be ~3,25MByte/s in the very best case.
The error looks like I am not using SPI in hardware mode or something. I tried to use different pins that are marked as hardware SPI interface, but the problem still occured.
Also the driver sends the Data in bursts and I dont know if it is possible to fire out (or read data in) all the time.
I think, that I have to use DMA somehow to build a "first in first out" system.
I would like to read a block over SPI into DMA.
when the packet is written, it should trigger an interrupt and mark the block.
the next block should be written after that interrupt.
the UDP application should see that there is a marked block and transfer that block over WiFi.
(I think the block size should then be 1500Byte to fit the UDP packet size)
Once the UDP transfer is done, it should trigger an interrupt again, to unmark the memory.
When the SPI driver has written to the last defined block, it should start from the beginning.
So the WiFi must be in overall faster than the SPI but not all the time.
Can you give me some help how to start best?
Is it possible what I wanna do?
best wishes,
Rico Lauersdorf