SPI problem with MC9S12C32 on CSM12C32

Discussion created by ERSIN OZKAN on Dec 28, 2009
Latest reply on Dec 28, 2009 by bigmac


i have a csm12c32 dev. board. im trying to use SPIto communicate with an accelerometer sensor.


according to the manual of mc9s12 series, SPIF flag of SPISR(status reg.) shouldnt be cleared until SPIDR is read. but it is going back to 0 while im trying to check if a transmition is complete. with debug, i can see SPIF becomes '1' after writing data to SPIDR. when i try to read this flag i get 0.



i compiled same code for full chip simulation and it works as it is suppsed to be.


any ideas about what i am doing wrong?