Control Blinking LED | Controller Circuit

Sunday, January 16, 2011

Control Blinking LED



For beginners the first thing to try on a new system or in a new programming language is to print out "hello world". The equivalent for microcontrollers and other embedded systems is to blink a LED. When even the target circuit and the programmer are freshly put together it is wise to start even lower, with a blink-a-LED program written by someone else that is known to be working.





On this page you will find a 1 Hz blink-a-LED test programs for the Tiny12 and the AT2313 targets chips and circuits. You can build the circuits on a breadboard or use the AT2313 ISP board. The programs are made in assembler with AVR Studio 4 for the ATTiny12 and with the BASCOM compiler for the AT2313. Look on the AVR Programming Hardware page for how to make a programming cable and on the AVR Programming Software page for the software to get the hex file into your device.

Because the ports of the AVR chips can draw 20mA current, only a resistor to limit the current is necessary to connect a LED to one of the ports. In both the circuits the LED is connected to PortB.0. In the circuit for the ATTiny12 the internal 1.2 MHz oscillator is used, because of that you don't need an external oscillator, but it can be configured also for an external crystal.

No comments:

Post a Comment