MB91F465XA EMULATION
Chapter 5 Appendix
© Fujitsu Microelectronics Europe GmbH
- 35 -
MCU-AN-300015-E-V11
5.2 Software
part
5.2.1 Activating FlexRay PLL
Figure 5-1: FlexRay Clock settings
Note:
The Reload timer 3 has a 600us
period. For this example the
peripheral Clock is set to 16MHz.
/* 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. */
/* (C) Fujitsu Microelectronics Europe GmbH */
…
#define
CCNT ((uint32_t *)0x500004)
…
Init_rldtmr_3(600u, 0x0802);
/* initialise reload timer 3 */
…
#if (EMULATOR == 0)
/* set PLL2 of MB91F465XA */
PLL2DIVM = 1;
PLL2DIVN = 0x13;
PLL2DIVG = 0;
PLL2MULG = 0;
PLL2CLKR = 0x04;
/* enable PLL, BCLCK & SCLK enabled */
/* wait for PLL Oscillaition stabilisation */
TBCR = 0x08;
/* setup Timebase Timer */
CTBR = 0x00;
/* clear TBT count register */
while (!TBCR_TBIF);
/* wait until timer finished */
PLL2CLKR |= 0x02;
/* switch to PLL2 clock */
EPFR31 = 0x77;
/* set pin to FlexRay function */
PFR31 = 0x77;
/* Use FlexRay Function no I/O port */
DDR31 = 0x77;
#else
/* set MB88121 Clock in Emulation system */
*CCNT = 0x00000001;
/* enable PLL, PLLx20 (4MHz crystal used) */
start_rldtmr_3();
/* start wait time */
while (!TMCSR3_UF);
/* PLL stabilisation wait time (600 us)*/
*CCNT = 0x00000003;
/* switch to PLL clock */
#endif
…