상세 컨텐츠

본문 제목

Chibios Usb Serial Example

카테고리 없음

by cofcatilwhi1989 2020. 2. 15. 04:50

본문

  1. Chibios Usb Serial Example Software

Hi,I have struck the wall with my Due and ChibiOS when using interrupt handlers. This might be the wrong forum, maybe some ChibiOS forum is more appropriate - but here it goes.My application is to read a PPM stream from a RC receiver. The PPM decoder I have implemented works great if using the standard Arduino IDE, but due to the complexity of my system I need to emigrate to a real-time system. Anyway, I initialise my PPM decoder by instansiate my PPM class and call 'enable' (prior to this I set pin 2 to input). I removed the ChibiOS macros within the ISR.The hardware looks fine i.e. I have not burned my input pin. So my problem is in the software domain as far as I can tell.The reason for using ChibiOS is because I have a quite complex system.

I'm building a quadcopter. Multiple control loops.

Telemetry and telecommand services. Navigation etc.So my plan of attack is to take your example (that obviously works), adapt it for catching PPM. And take it from there to see if I can figure out when and where stuff goes wrong.

Chibios Usb Serial Example Software

I will also take your advice on debugging. Thank you for the links I will look it up, plus the ChibiOS forumI have been really happy with ChibiOS, my rate control thread runs smooth at 200 Hz, the angle control thread at 50 Hz.

Chibios usb cdc example

Telemetry threads at 5 Hz and 1 Hz. The receiver thread is supposed to be running at 50 Hz, and simply just decode the flanks I collect in the buffer with the interrupt handler.

I need to use semaphores/mutexes for some shared resources, for an instance an I2C bus.I have as well start looked at moving away from Arduino software. In matter of fact I only use the wire library (which is a mess.). I have replaced the serial library with my own DMA based library (the moment I'm setting up a Eclipse environment with the ARM toolchain.Thanks again!