<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> The order of each section are listed in the order presented in lectures, so certain sections are covered earlier.
</aside>
So what exactly are I/O ports? If you notice during your labs, the microcontroller was connected to a few devices, like:
The I/O ports are used to connect these input and output devices to the microcontroller.
An HCS12 device may have from 48 to 144 signal pins arranged in 3 to 12 I/O ports, shown below.
Figure 4.1 Number of pins available in each parallel port.
Each I/O port has a set of pins and each port has two main registers:
DDR
): The following configures the ports as input or output.
0
.1
.PORT
): The following is where data is exchanged with peripheral.
If you remember in figure 1.2 of the memory map, the registers are stored from $0000
to $03FF
. The addresses of the data registers and data direction registers are defined in mcmc9s12dg128.inc
, which refers to following addresses.
Figure 4.2 Register Address for ports.
I’ll expand more on this in the following page below, if you’re interested: