Helpful ReplyHot!Problem with SPI clock

Page: < 12 Showing page 2 of 2
Author
rodims
Super Member
  • Total Posts : 1466
  • Reward points : 0
  • Joined: 2009/02/10 11:08:59
  • Location: 51.9627, 7.6262
  • Status: offline
Re: Problem with SPI clock 2018/10/17 06:01:39 (permalink)
+1 (1)
Ramon, I wonder how this post relates to your older post: https://www.microchip.com/forums/m1060285.aspx
Did you already successfully use SPI between your PIC and the EM4325 or not ?
If it worked at that time, what is the difference now ?
 
Concerning "NON standard SPI" I wondered whether developers for other processor platforms like ARM or TI should not experience this problem, too. And my first impression was  that they don't.  (Google Search)
 
#21
rodims
Super Member
  • Total Posts : 1466
  • Reward points : 0
  • Joined: 2009/02/10 11:08:59
  • Location: 51.9627, 7.6262
  • Status: offline
Re: Problem with SPI clock 2018/10/17 07:24:50 (permalink)
+1 (1)
The SPI function is working correcly and I send the data as the datasheet says. I first send the command word, in this case a 0xE8, SPI write command, and then I send the data byte I want to write. Then I send 3 bytes of dummy data so that I get the TAGs response. This it what the datasheet says to do, but then I load all the data of the EEPROM with the reader and nothing has benn written to memory of the EM4325. I get all 0s

 
Testing your success with NFC reader seems to be a smart method, but we cannot see wheter there could be other pitfalls.  I would suggest testing the basic SPI communication not by writing to the EEPROM, but to read some other non-EEPROM location, e.g. the temperature sensor.  EEPROM might have additional constraints, e.g. write protection:
 
From the manual:

The SPI Write Enable Words contain bits for each EEPROM page that a user may define as having write permission for the SPI interface when operating as an SPI Slave device. If the corresponding bit is 0, then the SPI interface is not allowed to write to that EEPROM page. Note that the write enable bit is only one condition for writing to the EEPROM page and is used in conjunction with the memory lock bits (except for User memory) to control EEPROM write operations. If using the memory lock bits to prevent the SPI interface from writing to EEPROM, then both the pwd - write and permalock bits must be set
 
This is independant from the discussion whether you can use the PIC hardware SPI or not.
#22
RamonRomeu
New Member
  • Total Posts : 19
  • Reward points : 0
  • Joined: 2018/06/05 07:50:46
  • Location: 0
  • Status: offline
Re: Problem with SPI clock 2018/10/18 00:41:52 (permalink)
0
Hi and thank you for your responses.
 
qhb, I first want to try to solve the problem, if possible. And I think that it is, because as Rodims said, there are other examples of comunication via SPI with an EM4325, despite there isn't any using a PIC.
 
And Rodims, my older post was also related to this, but the problem was with the PIC, that I couldn't send the bits the way I wanted them to be sent. Concermning the Write Enable Words,  I have the EM4325 with all the Write Enable Words to 1, so I should be able to write to the EEPROM. I will now try an other SPI operation, as you pose.
 
Just so you have it, this is what the different SPI lines look when I try to write some data. The first lines is the chip select, second lines is the clock, third lines is the MOSI (first byte is the SPI write command (0xE8), second byte is the data I want to write (0xAB), and then I send three bytes of dummy data so that the EM4325 can give me a response), and last line is the MISO.

 
Thank you very much, 
 
Ramon
 
 
post edited by RamonRomeu - 2018/10/18 00:55:53

Attached Image(s)

#23
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5