![Freescale Semiconductor MPC5604B Quick Start Manual Download Page 24](http://html1.mh-extra.com/html/freescale-semiconductor/mpc5604b/mpc5604b_quick-start-manual_2330604024.webp)
Here’s an example of usage of these registers on TRK-MPC5604B:
We can notice that use of data input/output registers get repetitive when multiple pads has to be
changed or read. There are parallel input/output registers which simplifies this issue.
Figure 26 : Parallel GPIO Pad Data In/Out Registers (Reference Manual Rev7 – Table 8-16/17)
These registers allow us to read/write multiple pads on ports with 32 bit registers. For writing
multiple pads masks are often necessary to only change pads of interest, there are masked
parallel registers which simplifies this problem (see figure below).
/* This extract of code will blink LEDs 1 to 4 sequentially while the button S1
is pressed.
*/
uint32_t
LED_state
,
i
;
int
main
(
void
) {
initModesAndClock
();
/* Initialisation of the device
*/
config_PORT_E
();
/* Configuration of GPIO
*/
for
(; ;)
/* Main loop
*/
{
/* while button is pressed(signal is 0, see schematic)
*/
for
(
LED_state
=0; !
SIU
.GPDI[64].B.PDI;
LED_state
++)
{
if
(
LED_state
==4)
{
LED_state
= 0;
SIU
.GPDO[68].B.PDO = 1;
// All LEDs are off.
SIU
.GPDO[69].B.PDO = 1;
//
-
SIU
.GPDO[70].B.PDO = 1;
//
-
SIU
.GPDO[71].B.PDO = 1;
//
- */
}
SIU
.GPDO[68+ LED_state].B.PDO = 0;
/* Set next LED */
for
(
i
=0;
i
<4500000;
i
++){}
/* wait a while */
}
/* while button is not pressed
*/
for
(;
SIU
.GPDI[64].B.PDI;){}
}
}
Summary of Contents for MPC5604B
Page 1: ...LAAS CNRS Quick Start to MPC5604B Embedded Development Sahin Serdar 21 06 2013...
Page 31: ...Figure 33 INTC SW HW mode comparison Freescale Tutorial...
Page 87: ......
Page 132: ......
Page 133: ...127 Appendix 2 Pad Configurations...
Page 134: ......
Page 135: ......
Page 136: ......
Page 137: ......
Page 138: ......
Page 139: ......
Page 140: ......
Page 141: ...Appendix 3 Peripheral input pin selection...
Page 142: ......
Page 143: ...137 Appendix 4 Interrupt Vector Table...
Page 144: ......
Page 145: ......
Page 146: ......
Page 147: ......
Page 148: ...Appendix 5 I C Baud Rate Prescaler Values...
Page 149: ......
Page 150: ......