How shall i can solve my Problem in SPIS interrupt based 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

Hello Every one,

   

I want to transfer data via SPI (Slave) using interrupt. I found one example and tries to implement it. But its not doing things as its suppose to do in my program. I am attaching my project please have a look into it and suggest me with possible solutions.

   

Looking forward for your reply.

   

Regards

   

Awais

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

I would suggest you to create a project with an SPI master and an SPI slave. Connect both and simulate a communication.

   

Keep in mind that for every bit (Byte) the master sends out via mosi, immediately a bit (Byte) is sent back from th slave via miso.

   

Do not clear the buffers using SPIS_ClearRxBuffer() when you read out the data, do that only in case of errors.

   

You do not have an interrupt handler, the StartEx() is commented out.

   

You did not start the Slave.

   

Easiest approach: increase the buffers to something like 150 and let the component handle the interrupts.

   

read off all incoming bytes from buffer and provide answers in the output buffer.

   

 

   

Bob

View solution in original post

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

I would suggest you to create a project with an SPI master and an SPI slave. Connect both and simulate a communication.

   

Keep in mind that for every bit (Byte) the master sends out via mosi, immediately a bit (Byte) is sent back from th slave via miso.

   

Do not clear the buffers using SPIS_ClearRxBuffer() when you read out the data, do that only in case of errors.

   

You do not have an interrupt handler, the StartEx() is commented out.

   

You did not start the Slave.

   

Easiest approach: increase the buffers to something like 150 and let the component handle the interrupts.

   

read off all incoming bytes from buffer and provide answers in the output buffer.

   

 

   

Bob

0 Likes