AnsweredAssumed Answered

MPC5746 DSPI CTAR Configuration

Question asked by Jyothsna Rajan on Sep 18, 2018
Latest reply on Mar 4, 2019 by Peter Vlna


I want to use DSPI0 on the MPC5746 to communicate with FS65xx SBC chip. I found an example for such communication, using MPC5744P (project attached for easy reference) and ported it to MPC5746, I scoped the all four SPI lines(MISO/MOSI/CLK/CS) but I do not see any activity on the data and clock line. At least the clock should toggle. CS goes low, so I know I am looking at the right interface.


I have several questions regarding the clock configuration and baud rate settings and any limits:


1. On the MPC5746, there are two derived clocks in the clock tree - DSPI0 and DSPI1, which can be configured to two separate frequencies. But the MPC has more than 2 SPI interface.

      How do i know which SPI interface is using which of these two clocks?


2. Given the following, how do I arrive at the register fields for CTAR?

system clock = 150MHz;

DSPI_CLK0 is 75MHz and  & DSPI_CLK1 is 50MHz ( these can be changed.)

FrameSize: 16bits

SPI Clock Frequency: 8MHz

SPI Baud Rate : 1M     

The clock generation  is different between the MPC5744 and MPC5746 (on MPC5744 , the pre-scaler value is configured via the CTAR configuration fields, while on the MPC5746R the prescaling is done using the divider for the AUXCLK). 

I used the function provided in the MPC5744P example's DSPI driver,

void DSPI_Init(uint8_t DspiNumber,uint8_t mode, uint32_t sysClk, uint32_t baudRate, uint32_t intMask)

and use my DSPI_CLK0 for sysclk in the above, but cannot see any activity on SPI bus.


3. In the SBC example, DSPI configuration I see a comment: 

Maximal and minimal Baud rate depends on *                       the actual system clock frequency and on the limits of the PBR and *                       BR registers. Maximal and minimal values for fsys = 16 MHz are shown *                       in the table below, for other frequencies see the external excel file.Where can I find the excel file with the limits for PBR and BR? 

Thank you for taking time to respond.