![Freescale Semiconductor MPC5604B Скачать руководство пользователя страница 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;){}
}
}
Содержание MPC5604B
Страница 1: ...LAAS CNRS Quick Start to MPC5604B Embedded Development Sahin Serdar 21 06 2013...
Страница 31: ...Figure 33 INTC SW HW mode comparison Freescale Tutorial...
Страница 87: ......
Страница 132: ......
Страница 133: ...127 Appendix 2 Pad Configurations...
Страница 134: ......
Страница 135: ......
Страница 136: ......
Страница 137: ......
Страница 138: ......
Страница 139: ......
Страница 140: ......
Страница 141: ...Appendix 3 Peripheral input pin selection...
Страница 142: ......
Страница 143: ...137 Appendix 4 Interrupt Vector Table...
Страница 144: ......
Страница 145: ......
Страница 146: ......
Страница 147: ......
Страница 148: ...Appendix 5 I C Baud Rate Prescaler Values...
Страница 149: ......
Страница 150: ......