Docsity

Digital I/O Project with Atmel Mega8s: LED Control and Timing, Slides of Aerospace Engineering

Partial preview of the text

Download Digital I/O Project with Atmel Mega8s: LED Control and Timing and more Slides Aerospace Engineering in PDF only on Docsity!

Last Time

Digital I/O and the Atmel Mega8s• DDRx• PORTx• PINx

Today

  • Project 1• Bion programming• Serial I/O

Bion

Sensor network:• 1000 sensor nodes• 3 miles of telephone

cable^ Wilhelm Reich

Part 1

  • Internal 4-bit (software) counter• Counter state is reflected by the LEDs
    • Bit 0 (LSB): Blue– Bit 1: Green– Bit 2: Red– Bit 3: Yellow

Part 1

  • Each button release:
    • Increment counter– Show the new state of the counter with the

LEDs

Required Components

  • Modular code
    • E.g., implement a separate function that

translates the current counter value into theLED state

Project Administrivia

Due on March 5

th

  • Demonstrate to me, or Di Wang• Documented code: hand-in on D2L
    • One copy per 2-person group
      • Personal report: distribution of work
        • You will not receive a grade if this is not

turned in

Getting Started

See:

http://www.cs.ou.edu/~fagg/classes/general/atmel/

Summary:• (perhaps) Install AVRstudio• Install WinAVR•^

Plug the programmer into your computer

-^

Plug the programmer into the bion

-^

Plug the power into the bion

-^

Create a program

Downloads from Atmel HOWTO• libou_atmega8.a• oulib.h• oulib_serial_buffered.h• makefile (OSX and linux)

Getting Started

Project Menu: New Project

Project Menu: Configuration Options

Project Menu: Configuration Options

2 (add a dot)