[Kudly] A start with ChibiOs

Hi,

I began the stm32 project and here is what I did.

After blinking some leds, I needed to use a PWM in order to control their brightness. First, I tried to find functions already made. The problem was that the leds are connected to a port linked where the timer is specific to some stm32f4. So, as ChibiOs tries to be the more general possible, I had to implements new drivers for those timers. I used ChibiOs sources to understand what was done with the other timers and I finally succeeded in controling the leds.

Then, I implemented the buttons features : when a button is pressed, a led is turned on. As I knew where to look for, I directly found the right module and it worked quickly. I tried to do an anti-rebounce but I not quite sure of the way to do it. Next, I implemented the trimmer potetentiometer. I initialized an ADC channel and I started conversions. I have some problems not fixed yet : I do not know why but after a while, the conversion stops and only returns 0.

I return to my code,

 

Tchou,

 

Julien

Facebook Twitter Google+ 

2 comments to [Kudly] A start with ChibiOs

  • Debouncing can be done by ignoring the button interrupts for 50-100ms, how did you do it? (Observe it with an oscilloscope)
    Did you solve your ADC problem?

  • What I did was to record the last time the button was pressed and when an interrupt is raised I compare the current time with the other time. I had no idea of the time to wait.
    I solved my ADC problem, it was something easy. Maybe it was too late when I programmed it 🙂