daveythacher / LED_Matrix_RP2040

GNU General Public License v3.0
1 stars 2 forks source link

Test UART Serial Algorithm #20

Open daveythacher opened 1 year ago

daveythacher commented 1 year ago

Add documentation under LED_Matrix/lib/Serial/serial_uart, LED_Matrix/src/uart and LED_Matrix/include/Serial/serial_uart.

daveythacher commented 1 year ago

Create idle loop to fire bus idle token from device to host every 10uS.

Host must send bus active token to device. Host must wait for the bus to become active (no more idle loop on device). (Timeout of 100uS.) If error device discards frame and enters idle loop. If successful device enters idle loop once completed.

Create idle loop within serial_task

If frame does not get response back within timeout host can attempt to recover the bus back to idle. If host detects the bus became idle too soon, frame is lost and host will drop it. (UDP) Frame corruption is allowed in this protocol as it is not believed to be worth the computation. (However DMA may support verification.)

This would supersede the serial_uart_v2. This works to the same goal of marking frames on the wire just without discrete control signals.

daveythacher commented 1 year ago

I may be interested in replacing the current logic with the previous post's outline. This may also remove the need for the other UART version.

daveythacher commented 1 year ago

May want to add checksum to this. DMA may be able to do this passively.

daveythacher commented 1 year ago

May want to remove the callback since this is now an interface library. There is no need for this anymore.

daveythacher commented 1 year ago

Tested aspects of this.

daveythacher commented 1 year ago

Tested state machine. (idle and start tokens. Packet length.) Tested CRC logic calculation. Did not pass valid data through. Did not test CRC rejection.

daveythacher commented 1 year ago

Lets go back to framed comms.

daveythacher commented 1 year ago

Plan is to move the UART protocol to external RP2040. This will allow a simpler protocol between the two RP2040s. I am not sure there is enough performance on a single RP2040. (A RP4050 would probably handle it.)

daveythacher commented 1 year ago

One core is pretty much consumed on convert the RGB values into bitplanes to conserve bandwidth. The bandwidth requirement for a single 16x32 display is 31.5Mbps (0.74Mbps for hardware PWM). This is about 512 pixels, with this core we can support something like 8192 pixels.

Another core is pretty much consumed doing multiplexing at high frequency. (This is better with hardware PWM.)