Tuesday, December 24, 2019

CYC1000 decoding PWM

Finally got back to CYC1000 board, been working on C++ interface to fast serial with the FTDI and FPGA, its working at 20Mpbs via USB.  The biggest issue was getting TTY to respond faster that 10ms.  So, on Linux one simple way is to use setserial command for low latency, i.e.
setserial /dev/ttyUSB0 low_latency

Now, it is possible to process receive/transmit faster then 10ms. So, using Avalon Master, able to send Read/Write commands at a maximum round trip of 2ms. The issue is still Linux, at the FPGA measure 2us round trip (send/process/transmit)

Connected up my old HK-T6A receiver to the CYC1000 and able to decode 6 channels of  PWM and send back to the PC at 10ms.  It takes 20ms for the HK-T6A to cycle over the 6 channels. So, 10ms is a good poll rate. 

One way to get rid of polling is to use a Avalon stream and send PWM with out sending a read request.

So, the next step is to get PWM generation complete then should be ready to merge with Linux based BetaFlight.  See how responsive it is. 

I was able to add a transistor on the Orange PI Zero Plus2 so, now the H5 is running at 1.7Ghz per core without throttling.   The goal is to have BetaFlight running and sending packets to the FPGA at 400Hz. 

Might have to go around tty and use to the FTDI API.  But, I might ditch the how project and use a Zynq processor. Maybe the QMTECH board. Maybe some can send me one ;)  Instead of using USB, now just have PWM encode/decode in the FPGA block.  I have a DSHOT written, but, first simple PWM.  Then, move to DHSOT once the latency of 2ms can be reduced to 300us or so.

I'm still working on ditching Avalon and moving forward to use a RISC-V processor to serialize/de-serialize packets.  I'm thinking of trying the SweRV Core EL2, for size and simplicity.




No comments:

Post a Comment