MPC5xxx Knowledge Base

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

MPC5xxx Knowledge Base

Labels
  • General 164
  • test 7

Discussions

Sort by:
******************************************************************************** * Detailed Description: * Application performs basic initialization, setup PLL to maximum allowed freq., * initializes interrupts, blinking one LED by interrupt, * initializes and display notice via UART terminal and then terminal ECHO. * * * ------------------------------------------------------------------------------ * Test HW:         MPC5604EEVB64 * MCU:             PPC5604EEMLH 0N10D * Terminal:        19200-8-no parity-1 stop bit-no flow control on LINFLEX_0 * Fsys:            40 MHz * Debugger:        Lauterbach Trace32 *                  PeMicro USB-ML-PPCNEXUS * Target:          RAM, internal_FLASH * EVB connection:  JP17 connected to J38.7 (ADC CONN), jumpers J7,J8 position *                  2-3 fit SCI tx and rx connected * ********************************************************************************
View full article
# README This is a mcan sdk demo on MPC5777C. Transmit data in turn and received data. CANFD is not used and extended id is used. Both Tx and Rx use interrupt. All documents are in [mpc5777c_test_mcan/mpc5777c_test_mcan_Z7_0/Documentation] folder. ## Board MPC5777C-416DS + MPC57xx MOTHERBOARD (SCH-27237 REV C) ## CAN PC Client PCAN-View ## Compiler powerpc-eabivle-gcc with S32 Design Studio for Power Architecture IDE ## MCAN MCAN0 ## Pin PC[19] - MCAN0 Tx PC[20] - MCAN0 Rx ## SDK S32_SDK_S32PA_EAR_1.8.0 ## Caution 1. Error to send data bytes which are not multiple times of 4 with MCAN_StartSendData() in mcan_driver.c. So MCAN_StartSendData() must be modified. Modified position is 606 to 607 lines in mcan_driver.c. 2. MCAN_DRV_InstallEventCallback() hasn't been implemented yet, must be added. ## Revision History Release 1.0.0 - 2018/12/19 - Jacob Peng - jacob.peng@nxp.com * Mod: MCAN_StartSendData() in mcan_driver.c * Add: MCAN_DRV_InstallEventCallback() in mcan_driver.c * Add: Demo application
View full article
This example performs LED toggling using hardware vector mode.   *UPDATE* - Internal RAM function was added, fixed exceptions, * * Detailed Description: * - 1 second LED1 toggle using emios interrupt * - LED2 toggle using irq 0 interrupt via sw_button1 * - 1 second LED3 toggle using Decrementer via IVOR10 * - hardware vector mode configuration for interrupts * * ------------------------------------------------------------------------------ * Test HW:  MPC5566 EVB MOTHERBOARD, PPC5566 MVR132 * Target :  Internal Flash, Internal RAM * Fsys:     80 MHz PLL with 8 MHz crystal reference * * ------------------------------------------------------------------------------ * EVB connections and jumper configuration * * MPC5566 EVB MOTHERBOARD * * LED1 D17 * LED2 A17 * LED3 C16 * For SW1 is used pin 2 and it is connected to AF19 * *********************************************************************************
View full article
External Bus Interface FAQs related to MPC55xx and MPC56xx MCUs Preliminary version
View full article
WARNING 1: Use censorship feature very carefully, because an inappropriate usage can lead in making the device useless!!! Thoroughly read all instructions before use!!!   WARNING 2: Version of ICDPPCNEXUS debugger that is included with CodeWarrior 2.10 is not capable to enable debug on certain devices including MPC5604B. Workaround is either using of Codewarrior 10.6 or using of PKGPPCNEXUS debugger - can be downloaded from P&E Microcomputer Systems   WARNING 3: In case TRACE32 debugger is being used (Lauterbach), it is needed to have updated TRACE32 software. TRACE32 releases 02/2015 and 09/2016..02/2018 may not be able to access to censored device. LAUTERBACH DEVELOPMENT TOOLS   The example consists of 2 parts and document describing how to access censored device via JTAG with using of PeMicro or Lauterbach debugger:   1) MPC5604B-Censor_device-CW210: ******************************************************************************** * Detailed Description: * The example code reprogram content of shadow flash to enable censorship. * After succesful operation LED1 is lighting. After power-on-reset the device * is censored with private 0xFEED_FACE_CAFE_BEEF. Subsequently the access can be * allowed by enabling debug of censored device as decipted in attached pdf * document. On this device password must be entered in reverse order i.e. * 0xCAFE_BEEF_FEED_FACE. Shadow flash re-programming code must be executed from * internal RAM. * ------------------------------------------------------------------------------   2) MPC5604B-Uncensor_device-CW210: ******************************************************************************** * Detailed Description: * Supposing the device is censored by example MPC5604B-Censor_device-CW210 * Firstly it is needed to enabled debug of censored device as decipted in * attached pdf document. On this device password must be entered in reverse * order i.e.0xCAFE_BEEF_FEED_FACE. MPC5604B_run_from_ram.cmm script does it by * command SYStem.option.keycode 0xCAFEBEEFFEEDFACE. * Then run this code to uncensor the device. After succesful operation LED1 is * lighting. After power-on-reset the device is uncensored and subsequent access * will be without password. Shadow flash re-programming code must be executed * from internal RAM. * ------------------------------------------------------------------------------
View full article
******************************************************************************** * 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: * 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
******************************************************************************** * 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
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: * 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
******************************************************************************** * Detailed Description: * This example content a driver for CGM module configuration. * ------------------------------------------------------------------------------ * Test HW:  MPC57xx Motherboard + MPC5744PE257DC minimodule, MPC5744P, * silicon mask set 1N65H * Target :  internal_FLASH* ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * Example configures Sigma_Delta ADC and periodically converts ANA0_SDA0 input * (EVB's potentiometer can be connected i.e. J53-1 --> PO15) and displays * results in the terminal window (USBtoUART bridge J21). Terminal settings is * 19200-8-no parity-1 stop bit-no flow control on eSCI_A. * * ------------------------------------------------------------------------------ * 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 * Terminal:        19200-8-no parity-1 stop bit-no flow control on eSCI_A *                  eSCI_A is USBtoUART bridge (connector J21) * EVB connection:  For ADC: J53-1 (EVB pot's wiper) --> PO15 (header P22) * ********************************************************************************
View full article
******************************************************************************** * Detailed Description: * This example shows how to reprogram the shadow flash. * * It is highly recommended to read application note "Preventing Device Lockout * via Censorship on MPC55xx and MPC563x Families" * http://www.freescale.com/files/32bit/doc/app_note/AN3787.pdf * * This examples erases the shadow flash, then it restores censorship information * and then NVUSRO nonvolatile register is reprogrammed to disable the watchdog. * The watchdog is disabled by clearing of bit WATCHDOG_EN in NVUSRO. It ensures * that watchdog is disabled automatically during startup of MCU. * Watchdog can be also disabled by software (shown in the code). * * It is important to execute the code from RAM memory because Read-While-Write * is not supported here. * * ------------------------------------------------------------------------------ * Test HW:  XPC56xxMB2 + XPC560B 144LQFP, SPC5604B, silicon mask set 2M27V * Target :  internal_FLASH, RAM * ********************************************************************************
View full article