Presentation is loading. Please wait.

Presentation is loading. Please wait.

Robocon 2007 Electronics Quickstart!

Similar presentations


Presentation on theme: "Robocon 2007 Electronics Quickstart!"— Presentation transcript:

1 Robocon 2007 Electronics Quickstart!
Session 2 First Program - GPIO Prepared by KI Chi Keung [chikeung@ust.hk] WONG Long Sing (Sam) [sam@hellosam.net]

2 Today’s Timeline Driving the Debug LED Reading a button
Schematic Reading Special Function Register ATMega128 Specification Reading Hexadecimal / Bitwise Operation Deterministic Speed Reading a button Debouncing State

3 Schematic Reading Identify the Component Identify the Wire / Net Label
Identify the Hardware pin

4 Special Function Register
Identify the hardware module to be used GPIO? Timer? UART? I2C? Identify the SFR involved

5 ATMega128 Specification Reading
It’s silly to read all 3xx pages in a single pass. Don’t try to do that. Only refer to what you need. Usually SFR description is what you needed.

6 Hexadecimal / Bitwise Operation
0x21  0b 0x43  0b 0xCD  0b 0xFE  0b _BV(0)  0b _BV(1)  0b _BV(7)  0b

7 Deterministic Speed Each assembly instruction takes defined CPU cycles to run, no more, no less. Period of CPU cycles depends on your clock While the clock is fixed now, so each instruction take exactly deterministic speed. This is true if and only if your program solely occupies the CPU.


Download ppt "Robocon 2007 Electronics Quickstart!"

Similar presentations


Ads by Google