(last updated: 2002/10/10)
Purpose: Allows a PC to control an Atmel AVR microcontroller. Provides digital and analog I/O to a PC.
Overview
In embedded systems development you are sometimes faced with developing software which interfaces to hardware that you have little experience with, such as an LCD module having a controller you've never used before. You can use the avr_io to get familiar with the interface by developing your code on a PC first, even if your final target platform is not a PC or even an AVR. This project would not be appropriate if the hardware you're interfacing to has strict timing requirements. You can also use this project to provide analog and digital, or even an SPI interface, to the PC in order to control relays, LED's, etc. Perhaps you could even use it as a learning tool; become familiar with the AVR without having to re-flash the AVR every time you want to change your code.
Here are some possible uses:
- Get the readings from a thermistor through the AVR's A/D and start working on linearization tables.
- Evaluate LCD modules by displaying images or characters.
- Control relays.
- Evaluate any IC that has an SPI interface.
Specifications
My Setup:
- PC
- STK200 development board with AT90S8515
- dio_test – A Java console mode program which sends commands out the PC's serial port. The files are located in the \test\dio_test director in the source code. It was developed using JBuilder 6, the communications API, and the Java 1.4 SDK. The following tests are performed:
Step 1 – Set all ports as outputs. Connect a set of 8 LEDs to each port. The program activates each LED.
Step 2 – Verify start frame error
Step 3 – Verify end frame error
Step 4 – Verify invalid command error
Step 5 – Verify receive byte timeout error
Step 6 – Set all ports as inputs. Connect a set of 8 switches to each port. The ports are read as the switches are manually set.
Step 7 – Read the A/D (future)
Note1: PD0 and PD1 are used for the UART, so these pins are not available in the above tests.
Note2: On the STK200, PB5 and PB7 include 1K pull-ups and a diode near the ICP header. Additionally, PB5-PB7 include 10K resistors in series between the header and the uC. Connecting switches to PB5 and PB7 will therefore have no effect (see "PB5_7.jpg" in attachments). When the switch is closed, .4V is across the 1K resistor, .5V is across the diode, and 4.07V is across the 10K resistor; so the digital input will see a 'high' signal (the voltage across the 10K resistor).
Note 3: Here's my set of LED's and switches (see "led_switch_board.jpg" in attachments).
Download (see Attachments)
avr_io - source code
avr_io.hex - just the executable
Links
LCD Demonstrator – uses the avr_io to interface to LCD modules
javr_io - GUI interface to control the IO manually through a PC
Copyright Steven R. Nickels, 2008. All rights reserved.