Free-scale Memory Map
Input output registers ranges from 0x400FF000 to 0x400FFFFF - we need to memory map every time when we perform simulation without kit. While flashing code into the kit memory mapping is necessary.
Memory Map of GPIO
Each port registers description is given below please refer figures for the same.
GPIO Programming and Interfacing
Port Data Output Register (GPIOx_PDOR): In the case of Freescale ARM chip, each of the Direction register needs to be a 0 to configure the port pin as input and a 1 as output.
The GPIO Clock enable for the I/O ports
Alternate pin functions and the simple GPIO
Portx_PCR of each port will be used for the configuration of the alternate functions bit 8-10 decides mux value and it will decide the function mentioned below.
Alternate functions and their descriptions.
LED connection in Freescale FRDM board
(1) Enable the clock to PORTB by setting 1 to SCGC5 register bit no 10, since access is denied to the port registers until the clock is enabled,
(2) Configure PortB_PCR19 (Pin Control
Register) to select GPIO function for PTB19, by setting mux field (bit no 8 to 10) of the PCR19 register to 001.
(3) Set the Direction register bit 19 of
PTB as output. by setting values 1 to bit 19 on PDDR register.
(4) Write HIGH to PTB19 in data register, to turn off the LED.
(5) Call a delay function,
(6) Write LOW to PTB19 in data register, to turn on LED.
(7) Call a delay function,
(8) Repeat steps 4 to 7.