![Freescale Semiconductor MPC5604B Скачать руководство пользователя страница 52](http://html1.mh-extra.com/html/freescale-semiconductor/mpc5604b/mpc5604b_quick-start-manual_2330604052.webp)
3.
PWM Channel Initialisation
In order to initialise a PWM channel and a time base channel for it without getting erroneous
signals the following procedure should be followed:
1.
Ensure that the channel is in GPIO mode;
2.
(eMIOS) Disable global prescaler;
3.
(time base channel) Disable channel prescaler;
4.
(time base channel) Write the initial value to the internal counter.
5.
(time base channel) Set A and B registers;
6.
(time base channel) Select MCB up or up/down mode;
7.
(time base channel) Set prescaler ratio;
8.
(time base channel) Enable channel prescaler;
9.
(PWM channel) Disable channel prescaler;
10.
(PWM channel) Set A and B registers;
11.
(PWM channel) Select time base bus using BSL;
12.
(PWM channel) Select the specific PWM mode;
13.
(PWM channel) Set prescaler ratio;
14.
(PWM channel) Enable channel prescaler;
15.
(eMIOS) Enable global prescaler.
4.
PWM Example
For a simple example application, we could configure a channel as MC for driving a bus counter
and then configure two channels connected to this bus as OPWMB with different duty cycle and
starting positions.
We initialise the system with by powering up eMIOS and SIUL, and with a system clock of
45MHz. And then we initialise eMIOS with a prescaler of 45 for getting a 1MHz internal clock.
We select the channel 23 as MC for driving the whole counter bus A. For this it needed to write
999 into register A and then select MC-up mode, select the internal counter and a prescaler of 1.
This will generate a counter from 0 to 999 at 1MHz, so giving a roll over each ms.
Содержание 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: ......