SPI Communication

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

 now i am using the PSoC 5LP dev kit, and i am trying to use the SPI comunication with other devices, specifically the AD5750-1 and the MAX31865 for comunication and configuration, i could see in the DevComunity a communication example and it works right,i mean comunication between Cypress and Cypress which works well in all the configuration modes,but does not on the other devices, i hope someone help me to find the problem. 

   

http://datasheets.maximintegrated.com/en/ds/MAX31865.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD5750_5750-1_5750-2.pdf

0 Likes
7 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

 I made example of SPI comm with output buffer from Maxim Integrated, MAX15500, which is similar to AD5750 in functionality. I can post it, though it is still unpolished.

   

odissey1

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@lfmoreno, extracted archive, but Creator errored on opening.

   

 

   

 

   

   

 

   

 

   

Try a new archive.

   

 

   

@odissey1, yes please post your solution.

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I could open the project wit Creator 3.1 SP3. A component update for SPI to version 2.5 was offered.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

I confirm 3.1 SP3 opens OK with a SPI update, I had inadvertently used on older

   

version Creator.

   

 

   

But got another cryptic error trying to open with 3.2

   

 

   

Regards, Dana.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Having not much experiences using SPI there are some points i would suggest you to do differently.

   

I do not clear the TX buffer because everything that is in there still has to be sent

   

Reading the Rx or Tx status can/will interfere with the interrupt driven buffer handling, because reading the status is resetting some of the status bits (datasheet and software tells so). So I just use the RxBufferSize() and TxBufferSize() functions which do not report the size of the buffers, but the number of bytes/words already received or still pending to be sent

   

Keep in mind, that every sent byte will return a received byte regardless of whether it contains useful information or not. So your initial writes of 0x80 and 0xf2 will return two unused bytes in the Rx buffer which you will have to discard when they both have arrived (indicated by a GetRxBufferSize() == 2). Then a ClearRxBuffer() will be appropiate.

   

To get the result from SPI you now will have to send some dummy bytes (for the sake of readability: name these bytes as "Dummy") filling the Rx buffer with the returned information. Again You'll have to wait until all bytes are there before processing them.

   

 

   

Bob

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

@Dana

   

FYI: Creator 3.2 "is expected" to be released next week (but could take some more time)

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 i use creator 3.1 for all my projects, im developing a RTD_DAQ which can read up to 16 signals so therefore i think use some dedicated IC´s , now im testing some suggestions , and if it works i´ll let you know

0 Likes