4. 68Hc12 Hardware; A) Ports - Motorola 68HC12 User Manual

Table of Contents

Advertisement

4. 68HC12 Hardware:

This section explains the operation of the hardware on the 68HC12.
I/O ports, the A/D converter and the timer functions.
explained in the next section.
Motorola document MC68HC812A4TS/D, "Motorola 68HC12 Technical Summary".
Ports:
All port names are of the format _H12PORTx, where x is the capital letter of the
port you are trying to access. i.e. Port A is _H12PORTA.
Ports A and B are used as the address bus for the 68HC12.
I/O by the programmer. Port A is the high order byte and port B is the low order
byte.
Ports C and D are used as the data bus for the 68HC12.
by the programmer. Port C is the high order byte and port D is the low order byte.
Port E is used to generate control signals needed to access the external memory.
As a result the programmer can not use it for I/O.
input for the IRQ and Port E pin 0 is used as the input for the XIRQ.
Port F is used to control chip selects for the external memory and other chips. The
programmer can not use it as I/O.
Port G is a 6-bit general purpose I/O port. The direction of the port is controlled
by _H12DDRG.
When an _H12DDRG bit is set to 0, the port pin is an input and when
it is set to 1 it is an output.
Port H is an 8-bit general purpose I/O port. The direction of the port is
controlled by the _H12DDRH.
input and when it is set to 1 it is an output.
Port J is an 8-bit general purpose I/O port. The direction of the port is
controlled by the _H12DDRJ.
input and when it is set to 1 it is an output.
Port S is used for the SCI and the SPI.
SCI or SPI are not being used.
interface to the terminal and can not be used as I/O.
bits 4-7 are the SPI.
being used.
The direction of the port is controlled by _H12DDRS.
Port T is used for the timer interrupts and the pulse accumulator.
interrupts are not being used then Port T can be used for general I/O.
direction is controlled by _H12DDRTT.
Port AD is used exclusively as the input to the A to D converter.
used for any other I/O.
Ports G, H, and Port E pin 0 have optional pull-up resistors inside.
controlled by the _H12PUCR register.
write a one to bit 7, for Port G write a one to bit 6, for Port E write a one to
bit 4 of _H12PUCR.
0 to the appropriate bit.
For more information on this material, refer to
When _H12DDRH bit is set to 0, the port pin is an
When _H12DDRJ bit is set to 0, the port pin is an
Bits 0 and 1 are SCI0. These are used as the
These can be used as general I/O if SCI1 and the SPI are not
To disable the pull-up resistors to a particular port, write a
Port E pin 1 is used as the
It can also be used for general I/O if the
Note: The two T's are not a typo.
To enable the pull-up resistor for Port H
7
It includes the
Hardware interrupts are
They are not usable as
They are not usable for I/O
Bits 2 and 3 are SCI1 and
If the
It can not be
These are
The port

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents