Problem while receive no. of bytes in SPIS

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

cross mob
asre_4060076
Level 1
Level 1

Hi,

i just want to receive no. of byte SLAVE side.  Here in attached image used ISR (interrupt) on receiving side to receive the data.

Now, what happen i am able to received the no. of bytes and storing in buffer.  But most of time it's to receive the data. after re sending 2, 3 time it's receive. i check  on debug tool sender side there is no problem. they always sent correct data.

Can someone  please help me out.

Regards

Asif

SPI RX.JPG

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi asre_4060076

The issue was due to the custom ISR conflicting with the component ISR. During any design, the goal is to keep the ISR as short as possible and do the firmware processing in a normal function. In your code, I moved the code from the ISR to the main function and increased the priority of the SPI component ISR (lower number = higher priority).

This code was working at my end now. Please try this out and let me know if it meets the requirement.

Thanks,

Hari

View solution in original post

0 Likes
3 Replies
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi asre_4060076

Can you please share the complete project so that we can debug the issue at our end?

Thanks and Regards,

Hari

0 Likes
lock attach
Attachments are accessible only for community members.

Hi hari,

plz find the attached project and plz try to help me out.

0 Likes
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hi asre_4060076

The issue was due to the custom ISR conflicting with the component ISR. During any design, the goal is to keep the ISR as short as possible and do the firmware processing in a normal function. In your code, I moved the code from the ISR to the main function and increased the priority of the SPI component ISR (lower number = higher priority).

This code was working at my end now. Please try this out and let me know if it meets the requirement.

Thanks,

Hari

0 Likes