Here’s an example for setting a 64MHz system clock and making SIUL (GPIO) run on this mode.
We could also write “
ME
.RUNPC[0].R = 0x00000010;
”
instead of RUNPC[1] to make all
peripherals run on RUN0, without needing PCTL lines, as all peripherals select RUNPC[0].
Use of FM for PLL is not recommended if there might be time sensitive applications. For example
it might induce transmission errors on CAN protocol if modulation depth and frequency are not
correctly selected
4.
SWT: Software Watchdog Timer
This timer is used to prevent system lock-up when the software is trapped in a loop or a bus
transaction failed. It is a 32-bit count-down timer, clocked by the 128kHz SIRC. A 32-bit time-out
value (minimum 0x100) value is specified (by default it’s 1280, so 10ms) and the software has
to enter some key sequence before timeout, otherwise a system reset is generated (it can be
modified to generate an interrupt first, and then a reset on a second timeout). By default this
module is frozen in the debug mode.
Using its configuration registers, this module is highly customisable for better fault detection, for
more details; see the chapter 30 of the reference manual rev.8, especially the paragraph 6. On
this document we will only give the code for disabling the watchdog in case it causes a problem.
1
http://www.ti.com/lit/an/spna090/spna090.pdf
: A Texas Instruments document that explains how to
choose the right values for FM parameters without affecting the CAN.
void
disableWatchdog
(
void
) {
SWT
.SR.R = 0x0000c520;
/* Write keys to clear soft lock bit */
SWT
.SR.R = 0x0000d928;
SWT
.CR.R = 0x8000010A;
/* Clear watchdog enable (WEN) */
}
void
initModesAndClock
(
void
) {
ME
.MER.R = 0x0000001D;
/* Enable DRUN, RUN0, SAFE, RESET modes */
CGM
.FMPLL_CR.R = 0x02400100;
/* 8 MHz xtal: Set PLL0 to 64 MHz
*/
ME
.RUN[0].R = 0x001F0074;
/* RUN0 config: clock selection(FMPLL)
*/
ME
.RUNPC[1].R = 0x00000010;
ME
.PCTL[68].R = 0x01;
/* SIUL use the configuration of RunPC[1]
add other peripherals as needed.*/
/* Mode Transition to enter RUN0 mode: */
ME
.MCTL.R = 0x40005AF0;
/* Enter RUN0 Mode & Key
*/
ME
.MCTL.R = 0x4000A50F;
/* Enter RUN0 Mode & Inverted Key
*/
while
(
ME
.GS.B.S_MTRANS) {}
/* Wait for mode transition to complete */
while
(
ME
.GS.B.S CURRENTMODE != 4) {}
/* Verify RUN0 is the current mode */
Содержание 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: ......