![Freescale Semiconductor MPC5604B Quick Start Manual Download Page 23](http://html1.mh-extra.com/html/freescale-semiconductor/mpc5604b/mpc5604b_quick-start-manual_2330604023.webp)
Some peripherals’ inputs can be received from multiple pads, in this case using PSMI registers’
PADSEL fields; one of the possible pads must be selected. See Appendix 3 for more information
about possible selections. It is mostly needed by communication modules.
Here’s an example code that sets pads connected to four LEDs as GPIO outputs and switch S1 as
an input.
3.
GPIO: General Purpose Input/Output
General purpose input/output (GPIO) functionality allows reading and writing binary values on
pins (0V/5V). To set or clear a pad we need to use GPIO Pad Data Output register.
Figure 24 : GPIO Pad Data Output Register (Reference Manual Rev7 – Fig. 8-12)
These 31 32-bit registers can be seen as 123 8-bit registers with only one field to set or clear the
pad. A very similar register for reading inputs exists is show on the figure below.
Figure 25 : GPIO Pad Data Input Register (Reference Manual Rev7 – Fig. 8-13)
void
config_PORT_E
(
void
)
{
SIU
.PCR[68].R = 0x0200;
/* LEDs are connected between PORT E pins and 5V */
SIU
.PCR[69].R = 0x0200;
/* PE 4 to PE 7 */
SIU
.PCR[70].R = 0x0200;
SIU
.PCR[71].R = 0x0200;
SIU
.PCR[64].R = 0x0100;
/* PE 0 */
}
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: ......