MPC5746 DSPI CTAR Configuration

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

MPC5746 DSPI CTAR Configuration

1,264 Views
jyothsnarajan
Contributor V

Hi,

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.

Tags (1)
0 Kudos
1 Reply

928 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

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?

Yes, you are correct:

pastedImage_3.png

pastedImage_4.png

As you can see answer is in reference manual:

pastedImage_5.png

So if you are using DSPI with microsecond bus you will have DSPI_CLK0 as you clock.

and in the IO pin table:

pastedImage_6.png

regards,

Peter

0 Kudos