EasyManua.ls Logo

Freescale Semiconductor MPC5604B - Page 599

Default Icon
934 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
MPC5604B/C Microcontroller Reference Manual, Rev. 8
588 Freescale Semiconductor
The LDVAL registers must be set as follows:
LDVAL for Timer 1 is set to 0x0003E7FF
LDVAL for Timer 3 is set to 0x0016E35F
The interrupt for Timer 1 is enabled by setting TIE in the TCTRL1 register. The timer is started by writing
a 1 to bit TEN in the TCTRL1 register.
Timer 3 shall be used only for triggering. Therefore Timer 3 is started by writing a 1 to bit TEN in the
TCTRL3 register; bit TIE stays at 0.
The following example code matches the described setup:
// turn on PIT
PIT_CTRL = 0x00;
// Timer 1
PIT_LDVAL1 = 0x0003E7FF; // setup timer 1 for 256000 cycles
PIT_TCTRL1 = TIE; // enable Timer 1 interrupts
PIT_TCTRL1 |= TEN; // start timer 1
// Timer 3
PIT_LDVAL3 = 0x0016E35F; // setup timer 3 for 1500000 cycles
PIT_TCTRL3 = TEN; // start timer 3

Table of Contents

Other manuals for Freescale Semiconductor MPC5604B

Related product manuals