21-07-2011, 02:55 PM
[attachment=14713]
ECE 346 Microcontrollers
MC68HC11 Educational Board,
Input and Output
What is it?
Circuit board that has a 6811 microcontroller
Has additional peripheral devices to make it easy to evaluate the 6811 microcontroller
Serial interface, breadboard area, extra RAM, EEPROM
Can be configured in a variety of ways
Memory Map
The memory map is a way of diagramming memory usage
Note how different regions of memory are used
Shows how memory resources are allocated to different purposes.
6811 Memory Map
6811 – I/O ports
Ports A, B, C, D, E
Total 40 I/O Pins
To use ports, must do one of two things
Either put 6811 in single chip mode by jumpering MODA and unjumpering MODB
Design a circuit that emulates the port functions
6811 – I/O ports
Port A – 8-bits, 3 input only, 4 output only, 1 input or output
Port B – General purpose output register.
8-bits, write to port B register causes data to be latched and driven from the port pins
I/O Ports (Continued)
Port C - General Purpose, 8-bit bidirectional I/O port
Control individual bits to be input/output by setting respective bit in DDRC register to 0/1
Reset clears DDRC—PORTC is input immediately after reset
Port D – General Purpose, 6-bit bidirectional data port
Input/output mode controlled by DDRD register
6811 board uses lower two bits for serial I/O
Upper two bits are not used and are always 0
I/O Ports (Continued)
Port E – 8-bit fixed direction input port
Eight binary inputs, but your evaluation board reserves PE0 for a special function and is not available
Can also be used to support 8 analog input channels
Ports are Mapped to Memory
Text I/O
Buffalo subroutines—use in your programs
INCHAR input ASCII character to AccA and echo back, loops until it gets something
OUTA output AccA ASCII character to terminal
Print “A” on screen
OUTA EQU $FFB8 ;Buffalo OUTA
INCHAR EQU $FFCD ;Buffalo INCHAR
* Output a character
LDAA #$41
JSR OUTA
* Input a character
JSR INCHAR
Note the Buffalo subroutines that are called to output and input characters.