Software Part; Activating Flexray Pll - Fujitsu MB91F465XA Application Note

32-bit microcontroller
Table of Contents

Advertisement

5.2 Software part

5.2.1 Activating FlexRay PLL

/* THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS. FUJITSU */
/* MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY FOR ANY ERRORS OR */
/* ELIGIBILITY FOR ANY PURPOSES.
/*
...
#define
CCNT ((uint32_t *)0x500004)
...
Init_rldtmr_3(600u, 0x0802);
...
#if (EMULATOR == 0)
PLL2DIVM = 1;
PLL2DIVN = 0x13;
PLL2DIVG = 0;
PLL2MULG = 0;
PLL2CLKR = 0x04;
/* wait for PLL Oscillaition stabilisation */
TBCR = 0x08;
CTBR = 0x00;
while (!TBCR_TBIF);
PLL2CLKR |= 0x02;
EPFR31 = 0x77;
PFR31 = 0x77;
DDR31 = 0x77;
#else
/* set MB88121 Clock in Emulation system */
*CCNT = 0x00000001;
start_rldtmr_3();
while (!TMCSR3_UF);
*CCNT = 0x00000003;
#endif
...
© Fujitsu Microelectronics Europe GmbH
MB91F465XA EMULATION
Chapter 5 Appendix
(C) Fujitsu Microelectronics Europe GmbH
/* initialise reload timer 3 */
/* set PLL2 of MB91F465XA */
/* enable PLL, BCLCK & SCLK enabled */
/* setup Timebase Timer */
/* clear TBT count register */
/* wait until timer finished */
/* switch to PLL2 clock */
/* set pin to FlexRay function */
/* Use FlexRay Function no I/O port */
/* enable PLL, PLLx20 (4MHz crystal used) */
/* start wait time */
/* PLL stabilisation wait time (600 us)*/
/* switch to PLL clock */
Figure 5-1: FlexRay Clock settings
Note:
The Reload timer 3 has a 600us
period.
peripheral Clock is set to 16MHz.
- 35 -
For
this
example
the
MCU-AN-300015-E-V11
*/
*/

Advertisement

Table of Contents
loading

Table of Contents