About MCF51EM256 SPI

Discussion created by sinanmuratkeşen on Feb 26, 2013
Latest reply on Mar 5, 2013 by TomE


I am currently using MCF51EM256 Cold Fire1. I am working on SPI communication with SPI flash ( 25P80 ). I am using SPI3 for SPI communication. SPI3 have open-drain pins, PTE4, PTE5 and PTE6. I have connected these pins with pull-up resistors to VDD (3V3) and I have configured SPI. Configuration codes are below:



SPI3C1 = 0x00;

SPI3C2 = 0x00;                                     

SPI3BR = 0x78;                                     

(void)(SPI3S == 0);




SPI3C1 = 0x12;                                     

SPI3C2 = 0x12;


PTEPF1 = 0X56; 

PTEPF2 = 0X83;




When I had tried to communicate to spi flash,  I didn't communicate properly. I have written another spi softwares for another device as a slave then when I had recieved a character in slave device, spi receiver interrupt had occured then I have sent this character to SCI. When I had monitored this SCI communication via serial port terminal I realised the character which I sent to slave device was right but I didn't write to spi flash.. When I had tried to read any character in the spi flash I received 0 'zero'.



Do you any suggestion about this subject? Are My spi configuration codes right or my hardware configurations right? I am using 10K for the pull-up resistor.



Best Regards.