Hello,
I would like to have SPI communication between Freescale S12X(Master ) & TI (6437) as slave.
I have configured TI as mentioned in the McBSP User's Manual Guide for SPI slave operation.
the sample code i have generated is using "pspdrivers_1_10_03".
I am sure the Master is working correctly because I have already tested the Master & Slave with both Freescale boards. But when I use TI 6437 evaluation board the problems appear.
I am using the Socketed EEPROM pins (in the 6437 EVM) for connecting the wires from Master to slave.
I guess the problems are with the configuration of 6437.
The below is the program:
As data recieved by me in DRR register is totally erroneous & mostly constant (like 1F, 3F & 7F sometimes FF) these are the data's i recieve for what ever i send from master.
The master is working at 1Mhz. So I have just made the CLKGDV =1
The GEL file used in 1.50 version the latest one.
It says the speed is 594 Mhz, to cross check this, I configured the 6437 as master to check the ouptut clock with various CLKGDV values, The clock coming from McBSP module (CLKX pin) is around 100Mhz... roughly 102Mhz...
One more my concern is there is no application note for McBSP as slave from TI, most of the configuraitons are McBSP as master with SPI EEPROM. I request TI to create one application note where McBSP is used a SPI Slave & master being other controller (TI or any other controller).
int main (void)
{
//enable mcbsp0 in power and sleep controller
device_init();
//setup mcbsp registers and start mcbsp running
Init_McBsp_SPI();
Reset_McBSP_SPI();
Configure_McBSP_SPI_Slave();
Set_McBSP_SPI();
//test loopback, returns 0 for pass and 1 for fail
while(1)
{
McBSP_SPI_Recieve_Byte();
}
}
void Init_McBsp_SPI(void)
{
mcbspRegs->SPCR = CSL_MCBSP_SPCR_RESETVAL;
mcbspRegs->RCR = CSL_MCBSP_RCR_RESETVAL;
mcbspRegs->DRR = CSL_MCBSP_DRR_RESETVAL;
mcbspRegs->DXR = CSL_MCBSP_DXR_RESETVAL;
mcbspRegs->XCR = CSL_MCBSP_XCR_RESETVAL;
mcbspRegs->SRGR = CSL_MCBSP_SRGR_RESETVAL;
mcbspRegs->PCR = CSL_MCBSP_PCR_RESETVAL;