RoseOnRails – WIP LEDs strips

Hi everyone,

Yesterday afternoon and yesterday night, Valeh and I worked on the LEDs strip controller.
We wrote a programme on our STM32 development board, in order to control the LEDs. For some time, I thought that we would control the LEDs thank to SPI and DMA, but after having discussed with Samuel, It appears that it will be much more convenient for us to control our LEDs thank to a timer.

Yesterday afternoon, Valeh and I firstly tried to control our LEDs thank to a simple bit banging programme. This did kind of work, but some LEDs blinked in a strange manner, which made us believe we had a timing problem. We then decided to light the LEDs thank to a timer – as Samuel had told us to do – in order to have a quite precise timing. We have thus written  a programme using ChibiOS GPT (General Purpose Timer) Driver, which enables us to call a  callback every N cycle.
We are now using a 168MHz timer (corresponding to  our microcontroller’s frequency) which calls a callback every 67 cycle (i.e. every 0.4us). So that every 0.4us we can choose to set or clear the Ledstrip GPIO. This method will enable us to code 0 or 1 bits for the WS2812b.

Debugging in progress ….

Noémie Bristol-Courgeon

Twitter LinkedIn 

Commentaires fermés.