Monday, May 28, 2012

Easy button debouncing technique for STM32

Yesterday I had to debounce a button on my STM32VL-Discovery. I did a quick search and found an amazing article on Hack A Day:

Debounce Code – one post to rule them all

This is a great collection of many approaches to button debounce. I didn't use any however (although I liked the integration technique very much) - I had just one button that may not even be pressed at all - so I didn't want to poll it or anything. Rather I went for external interrupt to detect the press itself.

Sunday, May 13, 2012

How to implement hardware-only SIR (Slow IrDA) on a Microchip PIC16 MCU using Data Signal Modulator (DSM)

In one of my projects (actually, in HDD POV clock v.2) I had to transfer data wirelessly over a distance about 7cm (~3"). After some research I was pointed to IrDA protocol and I was told this is the best option and I shouldn't be inventing a bicycle. Indeed if I had an IrDA transceiver, I would be totally OK. But I didn't and I couldn't find any available within easy reach. reasonable time and for a reasonable price. Those things are pretty obsolete by now you know.
While searching I also figured out that STM8 MCUs have SIR built into UART, but I had to stick to PIC16F1827... So, what do I do?

Friday, May 11, 2012

Howto flash a DSO Nano v2 bootloader (STM32)

DSO Nano is a single channel scope/signal generator. I got mine from seeedstudio.com for just $89. The problem was, I fried signal generator and as it turned out also MCU by accidentally touching +12V rail. I bought a new MCU, soldered it to the board instead of the fried one and wondered how to flash firmware into it. So after a few days I came up with the following.