MPC5xxx Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5xxx Knowledge Base

Labels

Discussions

Sort by:
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed freq., * setup clock for peripherals, Setup access right for Masters and Peripherals * on AIPS_0 * * LINFlex UART mode with FIFO transmit using DMA * LINFlex UART mode with FIFO receive using DMA * * ICache and DCache are both disabled in startup file using CACHE_ENABLE macro. * You can change the value of the macro at the following path: * project Properties/C/C++ General/Paths and Symbols/Symbols * If you change the value to 1, ICahce and DCache will be enabled in startup. * * * ------------------------------------------------------------------------------ * Test HW:         MPC5775K-356DS, MPC57xx Motherboard * MCU:             PPC5775KMMY3A 0N38M * Terminal:        19200-8-no parity-1 stop bit-no flow control on LINFlexD_0 * Fsys:            PLL0 266MHz *                    Z4 Core 133MHz * Debugger:        Lauterbach Trace32 *                  PeMicro USB-ML-PPCNEXUS * Target:          internal_FLASH (debug mode, release mode) * EVB connection:  J14.2 to P12.6 Connect LINFlexD_0 RXD to main RS232 *                  J13.2 to P12.7 Connect LINFlexD_0 TXD to main RS232 * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * This example content a driver for ADC module. * Basic ADC functionality is demonstrated via ADC_0 normal conversion for ADC_0 AN0 channel. * * For closer details on how ADC works I suggest you to check reference manual. * This example sets system clock for 200MHz running from PLL0 module. * Example contains basic ADC functionality demonstration. Software is starting normal ADC conversion * on ADC_0 channel AN0. * To demonstrate the measurement functionality on Freescale MPC57xx motherboard connect jumper to J53. * By doing this the potentiometer is connected to AN0 ADC input. For further details see MPC57xx EVB schematics. * * ------------------------------------------------------------------------------ * Test HW:  MPC57xx Motherboard + MPC5744PE257DC minimodule, MPC5744P, * silicon mask set 1N65H * Target :  internal_FLASH* ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed freq., * initializes interrupts, blinking one LED by interrupt, second LED by software * loop, third LED by second core, initializes and display notice via UART * terminal and then terminal ECHO. * * ------------------------------------------------------------------------------ * Test HW:  XPC56xxMB2 + XPC564xB/C, PPC5646C 0M87Y silicon * Target :  internal_FLASH, RAM * Fsys:     120 MHz PLL0 * Debugger: Lauterbach Trace32. script for internal_FALSH run_from_flash.cmm *                               script for RAM: run_from_ram_vle.cmm * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * A simple example configures eTPU engine B channels 0/1 for QOM and FPM. * Connect these pins by wire. Output wave is generated on chnl ETPUB0 (QOM0) * and its frequency is measured on the chnl ETPUB1 (FPM0). * TCR counter frequency is 64MHz, output wave configured as 1MHz ( expected * frequency measured by FPM. Window size is 28us (0x400) thus number of * measured pulses is 28 (27 initally). * * Note: It is needed to configure IGF module, otherwise inputs does not pass * to eTPU module. * * ------------------------------------------------------------------------------ * Test HW:         MPC5777C-512DS Rev.A + MPC57xx MOTHER BOARD Rev.C * MCU:             PPC5777CMM03 2N45H CTZZS1521A * Fsys:            PLL1 = core_clk = 264MHz, PLL0 = 192MHz * Debugger:        Lauterbach Trace32 * Target:          internal_FLASH * EVB connection:  ETPUB0 (PortR P25-1) --> ETPUB1 (PortR P25-0) by wire * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * Initializes eQADC module, converts specified command queue and displays * results into terminal window when EOQ is reached. Used analog inputs ANA_0 and * ANA_1 requires external connection to converted voltage (potentiometer) to * see some valid numbers. For simplicity, ADC module is not calibrated. * ------------------------------------------------------------------------------ * Test HW:         XPC567XKIT516 - MPC5674ADAT516 Rev.C, MPC567XEVBFXMB Rev.B * MCU:             PPC5674FMVYA264 * Terminal:        19200-8-no parity-1 stop bit-no flow control on eSCI_A * Fsys:            264/200/150/60 MHz * Debugger:        Lauterbach Trace32 *                  PeMicro USB-ML-PPCNEXUS * Target:          RAM, internal_FLASH * EVB connection:  Potentiometers     --> ADC inputs *                  USER_DEV_RV2(J4-7) --> ANA_0 (J18-3) *                  USER_DEV_RV3(J4-8) --> ANA_1 (J18-4)                * ********************************************************************************
View full article
MPC5xxx   Documents Links to source codes for eTPU functions eQADC - avoiding unintended result swap  External Bus Interface FAQs  FlexCAN bit timing calculation   Excel configurators MPC5xxx/S32Kxx: CAN / CAN FD bit timing calculation    SW Drivers MPC5xxx I2C communication driver   MPC55xx/56xx   Documents e200 Core Training relevant to MPC55xx and MPC56xx device family  Error Correcting Codes Implemented on MPC55xx and MPC56xx   Excel configurators Excel MPC55xx/MPC56xx PLL Calculator  MMU Assist Register CONFIGURATOR   Debugger Scripts Example JTAG access – Addendum to application notes AN3283 and AN4365    MPC57xx   Excel configurators Core MPU configurator  MPC57xx - DCF records   Debugger Scripts MPC57xx FCCU Utility scripts for Lauterbach debugger   MPC5643L   Documents MPC5643L PWM_ADC measurement concept GSH614    MPC5744P   Documents MPC5744P_System_IO_Definition Using the Built-in Self-Test (BIST) on the MPC5744P  Error Correcting Codes Implemented on MPC5744P  MPC574xP - FCCU configuration guide   Excel configurators Excel MPC5744P Clock Configurator MPC5744P DCF Configurator    MPC5746R   Documents MPC5746R STCU2 BIST configuration guide   Excel configurators MPC5746R DCF Configurator     MPC574xG/C   Documents MPC5646C to MPC574xG Migration - Rev. 0, 09/2013 Draft only   Excel configurators MPC5746C DCF Configurator  MPC5748G DCF Configurator    MPC5775K   Excel configurators MPC5775K DCF Configurator    MPC5777C   Documents MPC5777C - Online BISTs Error Correction Codes Implemented on MPC5777C   Excel configurators Excel MPC5777C clock configurator MPC5777C DCF Configurator    MPC5777M   Excel configurators MP5777M DCF Configurator    S32R274   Excel configurators S32R274 DCF Configurator    IDEs (CodeWarrior, S32 Design Studio)   Documents How to program QSPI flash using CodeWarrior 10.x  How to use CRCgen in CodeWarrior for MCU  How to download separate elf/srec/hex file to microcontroller using S32 Design Studio  How to use printf function in S32DS for Power Architecture using EWL library  How to debug code using CodeWarrior 10.5  How to flash two .elf files using CodeWarrior 10.6  How to create FreeRTOS project in S32 Design Studio  How to create new configuration in CodeWarrior for MCU   For more HOWTOs related to S32 Design Studio, visit S32DS for Power - list of HOWTOs 
View full article
This document describes, how to create another configuration to existing ones (RAM, FLASH) and how to use your own linker file for the new configuration. As soon as you have created project, right click the project and select Properties. Click Tool Chain Editor. In upper right corner, select Manage Configurations. New window will appear, then click new. As soon as you choose new, another window will appear and here you can insert name of the configuration, description and last, you must choose, which configuration will be settings copied from. So, for example, you can choose existing FLASH configuration. Click OK and new configuration will be created. Now, you can choose the new configuration as the active configuration, also this new configuration is added to configurations, and it is accessible via "hammer" icon in upper left corner. Now, it is necessary to set linker file you want to use with this configuration. Because this new configuration is inherited from FLASH configuration, it also uses default flash linker file. Set your configuration as active at first. After this step, in project properties select Settings->PowerPC Linker input tab. Into line Link Command File, choose path to required linker file you want to use with the new configuration. Click OK. You can verify the new configuration is chosen using arrow new to the hammer icon. How to use new configuration in debug configuration As soon as you have new configuration created, it is highly probable, you would like to download created elf into microcontroller and eventually debug it. Open debug configuration window. Now you can create new debug configuration or you can duplicate existing one. I will describe easier option and I will duplicate Flash configuration. Choose the flash configuration and click the duplicate icon. New configuration will appear. Now choose the new configuration, change the name and select elf file, which is created by new configuration. Click Apply and Debug button.
View full article
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed freq., * initializes interrupts, blinking one LED by interrupt, second LED by software * loop, initializes and display notice via UART terminal and then terminal ECHO. * The example configures the device for maximum performance (OPTIMIZATIONS_ON). * Its intention is to offer advanced startup code additional to CW stationery. * ------------------------------------------------------------------------------ * Test HW:        MPC5566EVB * MCU:            PPC5566MVR132 * Fsys:           144/132/112/80/12 MHz * Debugger:       Lauterbach Trace32 *                 PeMicro USB-ML-PPCNEXUS * Target:         RAM, internal_FLASH * Terminal:       19200-8-no parity-1 stop bit-no flow control on eSCI_A * EVB connection: TPU_PORT_37 -> USER_LED_8 *                 TPU_PORT_38 -> USER_LED_7 (to see blinking LEDs)    * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * * Simple LINFlex UART mode transmit and receive without interrupts (polled UART) * TXFIFO and RXFIFO macro is used to select between buffer and FIFO mode * * EVB connection: * *   Route LINFlexD_0 TXD/RXD (PB2/PB3) signals to the main board RS-232 transceiver *   Daughtercard: *   J17.11–12 ON  .. Connect LINFlexD_0 TXD (PB2) to main board. *   J17.8–9 ON .. Connect LINFlexD_0 RXD (PB3) to main board. * *   Motherboard *   J14 - SCI_RX ON *   J13 - SCI_TX ON *   J25 - SCI_PWR ON * * See results on PC terminal (19200, 8N1, None). * * ------------------------------------------------------------------------------ * Test HW:  MPC57xx * Maskset:  1N65H * Target :  RAM, internal_FLASH * Fsys:     200 MHz PLL with 40 MHz crystal reference * Terminal: 19200, 8N1, None ********************************************************************************
View full article
******************************************************************************** * Owner:            b21190(Vlna Peter) * Version:          1.0 * Date:             May-09-2018 * Classification:   General Business Information * Brief:            BIST demonstration ******************************************************************************** * Test HW:  MPC57xx * Maskset:  3N23A * Target :  internal_FLASH * Fsys:     200 MHz PLL with 40 MHz crystal reference ******************************************************************************** Revision History: 1.0     Oct-22-2014     b21190(Vlna Peter)  Initial Version 1.1    Sep-25-2018    b21190(Vlna Peter)  STCU2 BIST Multicore *******************************************************************************/
View full article
This document summarizes simple I2C driver implementation for MPC5xxx devices. The code follows Reference Manual's Flow-Chart of Typical I2C Interrupt Routine.
View full article
******************************************************************************** Detailed Description:  Example shows MCU's temperature measurement with the help of TSENS.  Calibration constants for TSENS0 are read from Test Flash and  SARADC_B is set to measure Vbg and TSENS outputs.  Calculated internal temperature can be displayed on the Terminal.  EVB connection:    Motherboard    J14 - SCI_RX ON    J13 - SCI_TX ON    J25 - SCI_PWR ON    See results on PC terminal (19200, 8N1, None). You should see following text  (with different values for sure)  TSENS - temperature measurement  press any key to continue...  TSENS's calibration constants read from Test Flash  TSCA = 184  TSCB = 21    T = (232 + TSCA * 2^-6) * TSENS_code / VBG_code - (273 + TSCB * 2^-4) [degC]  ----------------------------------------------------------------------------  VBG_code   =  251  TSENS_code =  339  TSENS temp = 42.91 degC  ------------------------------------------------------------------------------  Test HW:  MPC5777M  Maskset:  0N50N  Target :  RAM, internal_FLASH  Fsys:     600 MHz PLL1 with 40 MHz crystal reference  Terminal: 19200baud, 8N1 ********************************************************************************
View full article
This document shows, how to use CodeWarrior 10.6 to program QSPI flash for Power Architecture microcontrollers.   1) Create new project for appropriate microcontroller. 2) Open Debug configuration and duplicate one of the target.   3) Rename duplicated target (optional) 4) Choose the duplicated (renamed) target and click Edit button in Target settings tab.   5) In new screen, click Advanced Programming Options.   6) Check Use Alternative Algorithm and choose the algorithm you want to use. Algorithms are place in CodeWarrior installation folder. Full path is CodeWarrior_installation_folder\MCU\bin\plugins\support\EPPC\gdi\P&E\   7) On the screen Debug configuration, choose the file you want to program to QSPI flash.   Click Apply and Debug.
View full article
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed freq., * initializes interrupts, blinking one LED by interrupt, second LED by software * loop, initializes and display notice via UART terminal and then terminal ECHO. * The example configures the device for maximum performance (OPTIMIZATIONS_ON). * * ------------------------------------------------------------------------------ * Test HW:        MPC5554EVB * MCU:            MPC5554MVR132 * Fsys:           132/112/80/12 MHz * Debugger:       Lauterbach Trace32 *                 PeMicro USB-ML-PPCNEXUS * Target:         RAM, internal_FLASH * Terminal:       19200-8-no parity-1 stop bit-no flow control on eSCI_A * EVB connection: TPU_PORT_37 -> USER_LED_8 *                 TPU_PORT_38 -> USER_LED_7 (to see blinking LEDs)   * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed * frequency * * User can choose, which low power mode should be entered. There is LPU_MODE * macro defined, which allows to choose STOP, STANDBY or LPU_RUN mode. * * If LPU_RUN mode is selected, user can use macro LPU_STOP_SLEEP_STANDBY, * which allows to choose LPU_STOP, LPU_SLEEP or LPU_STANDBY mode. * * Ther is also RTC initialized, which wakeup microcontroller using WKPU after * 5 seconds from some of the LPU is entered. RTC uses FIRC as a source clock, * so FIRC must be enabled in all low power modes. * * * Modified files: mem.ld, sections.ld, startup.s, added file z2_restart.s * * * ------------------------------------------------------------------------------ * Test HW:         MPC5748G-324DS, MPC574xG Motherboard * MCU:             PPC5748GMMN6A 0N78S * Fsys:            PLL0 160MHz * Debugger:        Lauterbach Trace32 *                  PeMicro USB-ML-PPCNEXUS * Target:          internal_FLASH (debug mode, release mode) * EVB connection:  USER LED1 to A1 *                    USER LED2 to A2 * * * ********************************************************************************
View full article
Detailed Description:                      This config tool simplifies DCF records calculation for MPC5777M device.                 Look at HowToUse sheet for simple guideline, then work with DCF sheet                 Notes: - Macros have to be enabled!         BR, Petr
View full article
This example contain Lauterbach programming script for Off-line BIST configuration with 90% coverage. For more details refer to application note AN5427 - Using the Built-in Self-Test (BIST) on the MPC5746R
View full article
******************************************************************************** * Detailed Description: * Sensor board OM11057A which includes two PCF8885 circuits is connected * to MPC5748G via I2C. MPC5748G continuously reads the state of touch sensors * and the state is shown on LED diodes which are driven by I2C circuit PCA9535. * * Used I2C driver: https://community.freescale.com/docs/DOC-330972 * * Touch sensor board (page 9 and 10): * http://www.nxp.com/documents/user_manual/UM10505.pdf * * ------------------------------------------------------------------------------ * * Connection: * * Connect I2C bus (I2C_2 on MPC5748G) to sensor board: * I2C_SCL: P24-33 (pin PE9) on MPC574XG-MB to K3-1 on OM11057A * I2C_SDA: P24-35 (pin PE8) on MPC574XG-MB to K3-13 on OM11057A * Note: use two pull-up resistors on I2C signals (pulled to 3.3V). * The value should be 3k3 - 10k * * Connect power supply from MPC574XG-MB to OM11057A: * GND: P24-2 on MPC574XG-MB to K3-7 on OM11057A * 3.3V: P24-1 on MPC574XG-MB to K3-9 on OM11057A * * Connect SLEEP pins of both PCF8885 to GND (this will ensure that sleep mode * is not entered): * SLEEP1: K3-11 to K2-3 (both on OM11057A) * SLEEP2: K1-6 to K1-8 (both on OM11057A) * * ------------------------------------------------------------------------------ * Sensor board:    OM11057A *                  http://www.nxp.com/documents/user_manual/UM10505.pdf * Test HW:         MPC574XG-324DS Rev.A + MPC574XG-MB Rev.C * MCU:             PPC5748GMMN6A 1N81M * Fsys:            160 MHz PLL * Debugger:        Lauterbach Trace32 * Target:          internal_FLASH * ********************************************************************************
View full article
/* * Queue.h * *  Created on: May 28, 2015 *      Author: ShuLizhong */     #ifndef QUEUE_H_ #define QUEUE_H_ #ifdef _cplusplus extern "C" { #endif /*If you want to change the queue type(QUEUE_TYPE) and queue max size(QUEUE_MAX_SIZE),   you should define it at front of include queue.h file. eg: ******in xxx.h file***** code**** #define QUEUE_TYPE   Other type(unsigned int) #define QUEUE_MAX_SIZE   Other size(100) #include "qeue.h" code**** */ #ifndef QUEUE_TYPE #define QUEUE_TYPE unsigned char #endif #ifndef QUEUE_MAX_SIZE #define QUEUE_MAX_SIZE 100 #endif #define bool unsigned int typedef enum {   OK,   FULL,   EMPTY }QUEUE_STATUS; typedef struct {   unsigned int tail;   unsigned int head;   unsigned int size;   unsigned int length;   QUEUE_TYPE data[QUEUE_MAX_SIZE]; }Queue_tag,*pQueue_tag;     __inline void InitQueue(pQueue_tag q) {   q->tail = q->head = q->size = 0;   q->length = QUEUE_MAX_SIZE; } __inline  QUEUE_STATUS EnQueue(pQueue_tag q,QUEUE_TYPE data) {   if(q->size++ == QUEUE_MAX_SIZE)   return FULL;   q->data[q->tail] = data;   q->tail = (q->tail+1) % QUEUE_MAX_SIZE;   return OK; } __inline QUEUE_STATUS DeQueue(pQueue_tag q, QUEUE_TYPE *data) {   if(q->size-- == 0)   return EMPTY;   *data = q->data[q->head];   q->head = (q->head+1) % QUEUE_MAX_SIZE;   return OK; } __inline bool IsQueueEmpty(pQueue_tag q) {   return q->size == 0; } __inline bool IsQueueFull(pQueue_tag q) {   return q->size == QUEUE_MAX_SIZE; } __inline unsigned int GetQueueSize(pQueue_tag q) {   return q->size; } __inline unsigned int GetQueueLength(pQueue_tag  q) {   return q->length; } /*__inline unsigned int DeMoreBytesFromQueue(pQueue_tag q,QUEUE_TYPE *data,unsigned int len) {   unsigned int i = 0;   len++;   return 0; }*/     #ifdef _cplusplus } #endif #endif /* QUEUE_H_ */
View full article
This excel tool simplifies setting of PLL on MPC55xx/56xx devices. First select device and define input/output frequency. Possible configurations are calculated and basic PLL init code is generated as well. NOTE: macro has to be enabled! BR, Petr
View full article