Hi Martin Kovar , I am going to develop SPI driver for MPC5777M , I have seen your example for this. But I want to use different baud rates like 1MBPS,2MBPS, 4 ,8 ,10 , 20 and 40 MBPS.I am able to configure 2MBPS ,4 MBPS, 8MBPS, 10MBPS and communication is happening fine. But for 20 and 40 are not working (MSTR -> SLAVE data is transferring correctly but SLAVE ack received at MSTR is different value.)
The below are my configuration settings for different baud rates. I am using 80MHZ clock freq.
* FMSZ (Frame size) = 0xF
* PBR (Baud Rate Prescaler) = 0x2 - Baud Rate Prescaler value is 5
* CSSCK(PCS to SCK Delay Scaler) = 1 Delay Scaler value is 4
* BR (Baud Rate Scaler) = 4 - Baud Rate Scaler value is 16
* DBR (Double Baud Rate) = 0
* SCK baud rate = (fsys/PBR) * [(1+DBR)/BR]
* SCK baud rate = (80MHz/5) * [(1+0)/16] = 1MHz
DSPI_3.MODE.CTAR.R = 0x78021004;-->1MBPS
*DSPI_3.MODE.CTAR.R = 0x78011004;-->2MBPS
*DSPI_3.MODE.CTAR.R = 0x78011003;-->4MBPS
*DSPI_3.MODE.CTAR.R = 0x78011001;-->8MBPS
*DSPI_3.MODE.CTAR.R = 0x78021000;-->10MBPS
Can you please help me how to configure CTAR for 20 and 40 mbps baudrates.
I have one more doubt that what is the Maximum baudrate can we configure ?