Tag Archives: tech

Volatile Delays

You want to write a simple delay loop on your embedded microcontroller. Let’s say you’re waiting for the crystal oscillator to stabilise before you use it. static void delay( int loops ) { while(loops–) ; } You’re then very surprised to find that this takes a total time of 0ms when you call it. You… Read More »

Debounce

It’s been a while since I’ve had to use this knowledge, but I happened upon this request on Hackaday. It’s from a few years ago, and so I won’t be submitting to them; but am inspired enough to write an article about debouncing. So first, what is “debouncing”? More importantly, what is “bouncing” in such… Read More »

Bashing at the Keyboard (part I)

The command line. The feared enemy of anyone who started using a computer after 1995 (ish). It’s got a bad reputation, and for day to day computer tasks it’s certainly not necessary. However, if you are a programmer or a systems administrator then you’ll benefit enormously from knowing how to get things done on a… Read More »

CPU, Interrupted — Timers

Yesterday I mentioned that interrupts on an embedded microcontroller can cause you trouble. That’s not strictly true – it’s not the interrupt that causes trouble it’s the way you handle them. An awful lot of programmers don’t handle them correctly and they end up in a sticky mess. Before I can talk about interrupts though,… Read More »

Replacing an IDE With Makefiles

Developers have been led down a path by graphical tools. The tools in question are the so-called IDEs (integrated development environments). They are a nice idea in theory: combine your editor, compiler and debugger into one graphical program so that the developer can edit away, pressing “build” when they feel like it and single step… Read More »

AVR UART Transmit and stdio

The setup for a UART on AVR is such common code that I wonder if possibly it’s just assumed to be understood and explained. This is a quick article to fill in the gaps. First let’s talk initialisation. This is often the most important part of using any hardware peripheral on an embedded processor. In… Read More »

Asterisk For a Small Business (V)

Last time we had reached a milestone. Internal calls working, outbound calls working, and incoming calls working. What next then? It would be nice if people calling our business or residential line got an answering machine when we weren’t in wouldn’t it? There are two dialplan functions needed for voicemail: Voicemail() which connects a caller… Read More »

Asterisk For a Small Business (IV)

When last we spoke, we had created an internal phone system. We had four extensions that could all happily call each other. This time we’re going to extend that facility to include the ability to dial arbitrary numbers using our outgoing trunks. Recall how we arranged our contexts in the dialplan? [stdexten] ; … standard… Read More »

Asterisk For a Small Business (III)

Last time we left ourselves in the position of having two outgoing trunks available and four locally connected phone extensions. Let’s remind ourselves of these endpoints. $ asterisk -r hostname*cli> sip show peers Name/username Host Dyn Forcerport ACL Port Status andyp/andyp 192.168.1.82 D OK (100 ms) wife/wife (Unspecified) D 0 UNKNOWN handytone1/handytone1 192.168.1.10 D 5060… Read More »