- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone
I would need help with a straightforward code for PSoC 5 LP.
I need to send 64 bit throuhg IR link.
The code I am attached is just a sumulation to verify why it doesn't work.
The bits stream is simulated with the Bit_Array[64].
When I'm debbug step by step the code work, it mean that in the uint64 Word_Received I get the Bit_Array[64].
But may be I'm missing something when I want to speed up the process ann put a break point with some condition like Bt=40 at instruction CyDelay(3).
Here is the code
#include <project.h>
int main()
{
uint8 Bit, Bt; ;
uint64 Word_Received=0;
uint64 Logic_Value=0, MASK=0x8000000000000000;
CYBIT Bit_Array[64]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,0,
1,1,0,0,0,0,0,1,1,1,0,0,1,1,1,0,0};
CyGlobalIntEnable; /* Enable global interrupts. */
for(;;)
{
for ( Bt=0; Bt<64; Bt++)
{
Word_Received|= Bit_Array[Bt];
if (Bt!=63)
{ Word_Received<<= 1;}
CyDelay(3);
}
}
}
Can I get some help.
Thank you in advance
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There can be some optimization hindering debugging the code as expected, for instance: a variable may be kept in a register.
Use Project -> Build settings -> ARM GCC -> Compiler -> Optimization and set Optimization level to "none".
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HJi Bob
Thank you
I have already set the optimization level to " None" before this post.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bt=40 is not a condition, Bt==40 is.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK Bob
Thank you