SPI Receive Problems!!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi,
I am working on SPI of 4100(XMC 4500 Master Mode) which is interfaced with SPI EEprom, the pins which I am using are P1.7 U0C0_DOUT(MTSR) , P1.1 U0C0_DX1A(MRST) ,P1.8 CS & 1.9 is CLK. Master(4100) unable to receive any data over MISO(P1.1)!!
So can we use P1.1 as MRST Pin for Master Mode(FULL Duplex)??
0 Likes
5 Replies
chismo
Employee
Employee
First like received
Hello,

For SPI protocol, the input function DX1 is meant for SPI slave SCLKIN.
Therefore, it cannot be used as the SPI master MISO.

The MISO has to be fulfilled by DX0.
For U0C0, the options are:
- DX0A: P1.5
- DX0B: P1.4
- DX0F: XTAL1 (if this pin is not used for XTAL)

To help you have an easier view of the possible peripheral pin functions, you can make use of the pin out tool (link below):
http://www.infineon.com/cms/en/product/microcontroller/32-bit-industrial-microcontroller-based-on-ar...

In the tool, you can select XMC4200 (same pin functions as XMC4100) and then SPI master.
You will see the following:
1596.attach

Regards,
Min Wei
0 Likes
Not applicable
Thanks, Min Wei,
Now I have configured P1.4 as MISO but still I am facing the same problem, No data on MISO, first byte what I am sending is WRITE ENABLE COMMAND (0X06), while reading status register,I have sent 0x05 Command) there is no change at MISO line...??
EEPROM which I am using is ST M95320.


Regards,
Irfan
0 Likes
chismo
Employee
Employee
First like received
Hello Irfan,

So there is no response from the slave, i.e. MISO is not toggling?
Then the problem is probably not specific to the input function.

Are you able to monitor the 3 SPI outputs on the oscilloscope and if they look correct?
For example, if the CS is asserting/deasserting as expected per frame.

Regards,
Min Wei
0 Likes
Not applicable
Yeah, CS getting toggled for every Frame and MOSI is also showing the expected behaviour (Toggling with respect to data). I am not sure that master is talking to a slave as a master is not receiving any response from the slave.
0 Likes
chismo
Employee
Employee
First like received
From the ST M95320 data sheet, the sequence for read status register as follows:
1530.attach

You mentioned that you are using the sequence:
1st word: Write enable command
2nd word: Read status register command
3rd word: I assume dummy data to shift out the EEPROM output

But is the write command necessary?
Sorry I am not familiar with this EEPROM but maybe you can try just sending the read command and dummy data, and check again if the MISO toggles during the data transfer of the dummy data.

Regards,
Min Wei
0 Likes