Communication With AVR Chip

I can now talk to the chip in both directions from the Mac, send commands to the chip and get responses, and perform physical tasks such as press buttons and send data back to the Mac, all from the same remote program. Input and communication are all performed via interrupt handlers in assembler.

The screenshot shows an example of an AVR8515 on an STK500 development board. The chip talks to the Mac via RS232 and 2 concurrent Unix programs in C. The 'talk' program sends bytes to the chip, which then sets the LEDs accordingly (e.g. binary 170 shown). The 'listen' program waits for data from the chip via the same device, and displays a message and data nibble. The chip maintains an internal count of how often two buttons are pressed, and sends the button number and count back to the Mac.

Although this is a simple example, it demonstrates sending commands to the chip which affect physical devices, and getting data about those devices back from the chip. In a robot, the LEDs and buttons will be replaced by motor controllers and optical sensors, and the RS232 by a radio link. Although the resulting programs on both ends will be more complicated, the basic operation is the same.

İSky Coyote 2006