CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problems with using BRA/BRW

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
dmitrboristuk



Joined: 26 Sep 2020
Posts: 58

View user's profile Send private message

Problems with using BRA/BRW
PostPosted: Thu Jan 23, 2025 1:08 am     Reply with quote

The program uses two LUTs. One of them is used in the ISR, the second in the main code. The table used in the ISR works perfectly. But the table in the main code has no effect. The number is not extracted. Are there any recommendations for placing tables in program memory? There is also a PIC12LF1552 Silicon Errata and Data Sheet Clarification where 1.1 BRA/BRW have problems. I use a PIC16f1619. Have you encountered similar behavior?
Code:

static int8 LUT_ISR[30]={0, 90, 0, 0...90, 45};
static int8 LUT_MAIN[174]={0,8,16,67...34,56};
Ttelmah



Joined: 11 Mar 2010
Posts: 19619

View user's profile Send private message

PostPosted: Thu Jan 23, 2025 2:08 am     Reply with quote

Critical question.
What compiler version?????.
Generally CCS will have fixes for problems like this (unless you use the device
editor and turn them off), but sometimes when new issues are reported, these
fixes may not appear for a few compiler versions.
You say the lookup does not work. How are you testing this?. Are you sure
the code is actually executing this part of the main?.
dmitrboristuk



Joined: 26 Sep 2020
Posts: 58

View user's profile Send private message

PostPosted: Thu Jan 23, 2025 2:27 am     Reply with quote

5.115
In the assembler code everything looks great
I'll write more details later, I'm leaving
Code:


int16 X, Y;
int8 nomb;

Y = 855 + main_lut[nomb] + X;
Ttelmah



Joined: 11 Mar 2010
Posts: 19619

View user's profile Send private message

PostPosted: Thu Jan 23, 2025 4:11 am     Reply with quote

What you post refers to a different table to what you earlier showed.
main_lut versus lut_main.... Sad

Are you sure you have not gt something declared called main_lut, and hence
it is not actually accessing the table you think?.....
Ttelmah



Joined: 11 Mar 2010
Posts: 19619

View user's profile Send private message

PostPosted: Thu Jan 23, 2025 8:16 am     Reply with quote

That only applies if an interrupt occurs during the instruction. So try the
experiment of disabling the interrupt before doing the table lookup. If is
starts working, you have identified the problem.
It is very unlikely that your chip has this problem. Somebody would have
seen it if so, and it'd be in the errata for your chip.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group