Uint64 type

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

cross mob
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

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

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

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

0 Likes
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

HJi Bob

   

Thank you

   

 

   

I have already set the optimization level to " None" before this post.

   

Regards,

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

Bt=40 is not a condition, Bt==40 is.

   

 

   

Bob

0 Likes
AlVa_264671
Level 5
Level 5
25 sign-ins First like given First like received

OK Bob

   

Thank you

0 Likes