Barney McNamara

MC9S12NE64 SPI not transmitting in Slave mode

Discussion created by Barney McNamara on Feb 7, 2006
Latest reply on Feb 9, 2006 by Barney McNamara
I am not able to transmit data from this chip in slave mode. The master receives only an echo of the data it has sent to the slave, rather than the data I am trying to send from the slave. The master is a Microchip PIC which I have run succsssfully in other products.

I have tried both CPHA=0 and CPHA=1 modes. In both cases I can get the data correctly from the Master to the Slave, but never get anything but an echo back.

I have tried looping on SPISR until SPTEF goes low, writing my data into SPIDR repeatedly. Even when I write Assy language that forces two sequential instructions to read SPISR (after I see SPTEF=1) and write my data into SPIDR, the data I write does not get transmitted.

I have searched the forum and found another message with a similar problem, but there was no real solution there. Just what looks like an error, as they claim to set the MSTR bit to a 1 in the slave, which can not be correct in this chip.

Any suggestions?