ELECTRONICS3

Embedded programming is the term for the computer programming that lives in and operates the great many computer-controlled devices that surround us. Embedded computers (microcontrollers) add intelligence to countless devices and systems.

Goal

For this exercise we will be using Amtel micro-controllers and the AVR Libc. The goal will be to test different programming languages and environments for a simple blinking led exercise.

Hello DATASHEETS

ATtiny44.

Always check the pin names to match your CODE!

ATMega168.

Hello ISP

In-System Programming (ISP) is the ability of some programmable logic devices, microcontrollers, and other programmable electronic chips to be programmed while installed in a complete system, rather than requiring the chip to be programmed prior to installing it into the system. For our exercices we will create an ISP board that we will use to program the rest.

The ISP board.

Programming the ISP board (do not forget to power it up!)

Make CLEAN, Make FUSE, Make PROGRAM.

Hello FTDI

Future Technology Devices International, commonly known by its abbreviation, FTDI, is a Scottish privately traded semiconductor device company, specializing in Universal Serial Bus (USB) technology. It develops, manufactures, and supports devices and their related software drivers for converting RS-232 or TTL serial transmissions to USB signals, in order to allow support for legacy devices with modern computers.

Notes:

In order to start programming your board, you need to install CrossPack and the FTDI chip drivers. If you are not familiar with Homebrew I suggest not trying to install AVR toolchain from source, but rather use this two installers.

Also the "Error 1" for "avrdude: initialization failed, rc=-1 Double check connections and try again" is one of the most common problems you will encounter when trying to send the program to the board. This can happen most certainly because of a hardware problem, so:

Thanks Will for the tips and Brian Mayton for all his help! Here are my own tips for beginners:

The board with led and button.

Programming the board...

Calling FUSES..."ERROR 1"!

Un solder the ISP 0-res. Or you will get this...

Check that the ISP is recognized by your computer.

Check that you installed the right FTDI drivers package.

Make sure the rainbow cable is healthy.

Needs to be well compressed, use this to help you.

Test board straight from AVR. Discard ISP malfunction.

Hello ARDUINO

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.

General Notes:

If you feel more adventurous you can try to use Arduino core and AVR libraries inside Eclipse, you will have to go through this TUTORIAL to set it up, but the advantages of such a powerful IDE compensate the effort if you are building long pieces of code.

Also when you make your own arduino clone, remember that the ATMega has really small pins and you will need to be very...relaxed, to solder them properly.

Arduino clone.

Arduino library in Eclipse.

AVR library in Eclipse.

Arduino milling.

Tiny pins to solder...

Use the Flux-Pen!

From Arduino IDE to FTDI board:

Remember to set the BOARD to your micro-controller, the PROGRAMMER to USBTinyISP and choose the appropriate SERIAL PORT. In this case choose the ATtiny44 board and the USBtinyISP programmer, also make sure that the port is set to USB. Change the LED pin number to match the Attiny44 pin in your Eagle file. Send BURN BOOTLOADER, then Upload your file.

Board (Attiny44 with clock at 20MHz).

Port.

Blink :)

From Arduino IDE to Arduino clone board:

In this case choose the LilyPad board. No resonator needed. If you used delays in your code, you will see that the LED does not blink at the right rate, so one trick is to burn the BOOTLOADER, even if you don't need to, so that it will actually set the fuses.

Board (LilyPad, closest to our clone).

With an ATMega168.

Hello PYTHON

Fans of Python use the phrase "batteries included" to describe the standard library, which covers everything from asynchronous processing to zip files. The language itself is a flexible powerhouse that can handle practically any problem domain.

...

...

...

Resources

Learn C online: LINK!

What is Embedded Programming?: LINK!

Arduino Resources: LINK!