Archive for May 2010

One led voltmeter (Part 3)

Part 1, 2, 3, 4 Playing a little bit with regsiters Let’s proceed step by step to the details of the A/D converter. Firstly, we will pay attention to the ADMUX register. The four least significant bits: MUX0, MUX1, MUX2 and MUX3 are used for setting the mux channel, which is strictly equivalent to passing […]

One led voltmeter (Part 2)

Part 1, 2, 3, 4 Auto ranging This improvement is quite easy, and it may be useful in some circumstances. Arduino contains in fact one A/D converter which is connected to an 8 ports multiplexer: 6 of them are available from the 28 DIL PDIP package, the one which is used on Arduinos. Before getting […]

One led voltmeter (Part 1)

Part 1, 2, 3, 4 This is a minimal voltmeter which reads the signal from one of the analog ports and converts its value in to a sequence of led flashes. Long flashes for volts, short flashes for tenths of volts. /* One led voltmeter or ‘the voltmeter of the poor’ Reads analog port 0 […]

Multiple files project

Once we get familiar with Arduino’s IDE, we wrote many lines of code which tend to create huge pde files. And there we touch the limits of this IDE and look for various options. Firstly, it would be great to use a better editor with plenty of these fancy features which make the programmer’s life […]

Essay on “How to read a microprocessor datasheet.”

As many of you, on a (not so) nice day, a (not so) nice friend of mine told me about a (not so) nice electronic device. This was the starting point of my addiction to Arduinos. At last! A compact, cheap and complete solution for running microprocessor. Something I dreamed about for a long time […]

Serial Comm Ports for ever and ever… (Part 7)

Part 1, 2, 3, 4, 5, 6, 7, 8 Oh nooooo. I missed that. Eventually, my serial comm port requires parity checking! This unexpetecd requirement forced me to revise the whole concept of bytes and bits reading in order to take into account the time necessary to compute parity and check it. Here is a little reminder on parity Parity helps insuring that […]

Serial Comm Ports for ever and ever… (Part 6)

Estimate a baud rate based on the reading of 0x55 byte

Optional parameters

This one may look trivial to the experts, but it took me some time to find (by pure chance) the solution to one of my problems: How to define functions or routines with optional parmeters? Overlaod is the answer! In fact, it is extremely easy and handy. First, you write your routine/function has you would […]

Serial Comm Ports for ever and ever… (Part 5)

Part 1, 2, 3, 4, 5, 6, 7, 8 This posts contains a couple of illustrations of the assembled prototype. It uses a standard Diecimila (ATMEGA 168 based) board, an Adafruit Industries proto shield. There are few components around a MAXIM DALLAS Max232, capacitors, leds and a 9 pin sub-D connector. As you can see, I am using exhaustlively a set of preassembled […]

I/O Ports (Part 3)

Part 1, 2, 3, 4, 5 Let’s go one step further with this subject. Now that we have seen how efficient are the various options for setting I/O ports, I suggest that we try to encapsulate these functions and commands in convenient packages, nammely macros! Macros are managed by the preprocessor at compilation time (Check #define statement here). The correct […]