AnsweredAssumed Answered

MPC5746C - No SPI Clock

Question asked by Christopher Holland on Apr 17, 2018
Latest reply on Apr 25, 2018 by Christopher Holland

Hi,

 

So, I do have the SPI test working on a development board.

 

When I move to the prototype board, I am not able to see the SPI clock using a logic analyzer.

The SDO and CS signals seem to be working just fine. I just don't have a clock.

 

 

One problem I have is that the XTAL is not the same.

The prototype board is using a 16 MHz xtal.

I checked the clock going to the SPI module and it is setup for 16 MHz. Baud Clock that is.

(I just noticed the Clock Calculator value for Peripheral clock is fixed at 40.

I believe the  value should be =IF(H110="RESET",0,X7) Which would make the value 32.

 

 

 

 

Original

/* SPI_3.MCR.R = 0x80010001; */

/* DSPI_3.MODE.CTAR[0].R = 0x48021004; */ 

/* DSPI_3.MCR.B.HALT = 0x0; */

 

New

SPI_3.MCR.R = 0x80010001;

SPI_3.MODE.CTAR[0].R = 0x48001004;

SPI_3.MCR.B.HALT = 0x0;

 

Original calculated baud rate calculation (PBR : 2 = 5)(BR: 4 = 16)

* SCK baud rate = (fsys/PBR) * [(1+DBR)/BR]
* SCK baud rate = (40MHz/5) * [(1+0)/16]
* SCK baud rate = (8MHz)/16 = 500 KHz

 

New calculated baud rate calculation (PBR : 0 = 2) (BR : 4 = 16)

* SCK baud rate = (fsys/PBR) * [(1+DBR)/BR]
* SCK baud rate = (16MHz/2) * [(1+0)/16]
* SCK baud rate = (8MHz)/16 = 500 KHz

 

I do seem to be getting something when I set the baud rate to 

SPI_3.MODE.CTAR[0].R = 0x48031006;

It looks correct now, but not at the bit rate I was expecting.

 

I went back and tried to verify the baud rate from the development board.

Maybe I am missing something, but the calculated and measured baud rates don't seem to be the same.

 

Measured:
   * Clock period = 1000 nS = 1 uS = 1 MHz
   * That would be 1,000,000 bps

   * My frame is 10 bits.

   * 1,000,000 / 10 = 100,000 datums / sec
   

Original development board

 

Prototype board

 

Thanks for your help,

Outcomes