hi,
i use "mikroc PRO for PIC v4.60".
i get the follow warning:
"IRP bit must be set manually for indirect access to datax variable". How can i fix it.
Thank you.
code look like this:
//-----------------------------------------
char datax[9][9];
unsigned int k=0;
void main()
{do
{
adc_rd=ADC_Read(2);
datax[k][0]=adc_rd/10;
datax[k][1]=adc_rd%10;
Lcd_Chr(1, 1, ( datax[k][0]) + 48);
Lcd_Chr(1, 2, ( datax[k][1]) + 48);
k++;
if(k==10)k=0;
delay_ms(1000);
}while(1);}
//-----------------------------------------
IRP bit must be set manually for indirect access to
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Re: IRP bit must be set manually for indirect access to
1. search the forum for information, then work out how to switch between banks or go directly to item 2 and never see the problem again.
2. use an 18F pic.
3. you could likely use a 16F but one with much much more RAM.
2. use an 18F pic.
3. you could likely use a 16F but one with much much more RAM.
Best Regards
Mince
Mince
-
- Posts: 715
- Joined: 27 Dec 2006 14:33
- Location: Le Tréport , FRANCE
Re: IRP bit must be set manually for indirect access to
Hi, Mince
If my old brain still works fine ...
there's an assembler Command called " BANKSEL" ...
Should it be possible to use it ???
Alain
If my old brain still works fine ...
there's an assembler Command called " BANKSEL" ...
Should it be possible to use it ???
Alain
Re: IRP bit must be set manually for indirect access to
BANKSEL is MPLAB macro, it is translated to a set of ASM instructions upon compiling.
Once you reach the problem with IRP bit, it is a good sign to switch to P18. Almost every P16 chip has pin-to-pin compatible cousin in P18 family. Moreover, the mE compilers are adapted so switching between P16 and p18 requires very little change in code - only that for PORT setup (ANSEL and ADCON registers).
Once you reach the problem with IRP bit, it is a good sign to switch to P18. Almost every P16 chip has pin-to-pin compatible cousin in P18 family. Moreover, the mE compilers are adapted so switching between P16 and p18 requires very little change in code - only that for PORT setup (ANSEL and ADCON registers).
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Re: IRP bit must be set manually for indirect access to
and... PIC18 tend to have much greater internal osc options and they have hardware LATch and and and...zristic wrote:Almost every P16 chip has pin-to-pin compatible cousin in P18 family. Moreover, the mE compilers are adapted so switching between P16 and p18 requires very little change in code
Best Regards
Mince
Mince
-
- Posts: 715
- Joined: 27 Dec 2006 14:33
- Location: Le Tréport , FRANCE
Re: IRP bit must be set manually for indirect access to
Hi, Zristiczristic wrote:BANKSEL is MPLAB macro, it is translated to a set of ASM instructions upon compiling.
my purpose was just to try to find something simple to use for everyone ( with my soooo little skills ! ) ... whatever it is a macro or what you want.
the advantage with this one is you do not have to know where your variable is located ...
" use a PIC 18 " looks the very easy solution ... for you not to work on this problem.
I could also have said : " use Picbasic Pro ( or else ) Compiler , it deals fine with that " ....
BTW ... I still have a lot of Pic 16's in my drawers, AND I won't let them fall down in the wastebox ...
Alain
Re: IRP bit must be set manually for indirect access to
Try this man;b0gdan wrote:hi,
i use "mikroc PRO for PIC v4.60".
i get the follow warning:
"IRP bit must be set manually for indirect access to datax variable". How can i fix it.
Thank you.
code look like this:
//-----------------------------------------
char datax[9][9];
unsigned int k=0;
void main()
{do
{
adc_rd=ADC_Read(2);
datax[k][0]=adc_rd/10;
datax[k][1]=adc_rd%10;
Lcd_Chr(1, 1, ( datax[k][0]) + 48);
Lcd_Chr(1, 2, ( datax[k][1]) + 48);
k++;
if(k==10)k=0;
delay_ms(1000);
}while(1);}
//-----------------------------------------
Code: Select all
char datax[9][9] absolute 0x120;//check your pic datasheet to find witch bank you select,
mC Pro is easy and much better than PBP.
unsigned int k=0;
void main()
{do
{
adc_rd=ADC_Read(2);
irp_bit = 1; //always enable this before absolute vars
datax[k][0]=adc_rd/10;
datax[k][1]=adc_rd%10;
Lcd_Chr(1, 1, ( datax[k][0]) + 48);
Lcd_Chr(1, 2, ( datax[k][1]) + 48);
irp_bit = 0; // disable it just after using the absolute vars
k++;
if(k==10)k=0;
delay_ms(1000);
}while(1);}
Re: IRP bit must be set manually for indirect access to
Me too.Alain wrote:BTW ... I still have a lot of Pic 16's in my drawers, AND I won't let them fall down in the wastebox ...
I'm just wondering if ME isn't forcing all of us to use PIC18 for now on...discarding PIC16 in the future.
As I've said before, non-pro MKC version deals fine with this issue...
BR
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Re: IRP bit must be set manually for indirect access to
no one is being forced to doing anything. worst case is the user needs to actually do some reading and understanding. But for the most case the best option is to go for an 18F especially for newbies who dont have the investment time.
Don't forget, mE are one of the few compiler suppliers that include multiple family devices in the same compiler at no extra cost. So there is no financial advantage to mE for users that want to switch between pic12, 16 and 18 family.
There is also plenty of how-to work around information on the forum.
I would still advise anyone (regardless of the compiler supplier) to use 18F family. My drawer is full of pic 10, 12, 16 and now i basically only use these for testing other peoples code as part of helping out. I would be clear that i consider the 10, 12, 16 device family to be a legacy device now which i would never design into a product and this has nothing to do with mikroC.
I agree that mE should make the bank switching transparent (it would not take much searching on the forum to find my view on that) to the user. But it is not, so learn how to do it yourself or use an 18F. I have several large programs which i had to convert from mikroC to mikroC pro so i had to go through the pain on this topic a long time back.
Don't forget, mE are one of the few compiler suppliers that include multiple family devices in the same compiler at no extra cost. So there is no financial advantage to mE for users that want to switch between pic12, 16 and 18 family.
There is also plenty of how-to work around information on the forum.
I would still advise anyone (regardless of the compiler supplier) to use 18F family. My drawer is full of pic 10, 12, 16 and now i basically only use these for testing other peoples code as part of helping out. I would be clear that i consider the 10, 12, 16 device family to be a legacy device now which i would never design into a product and this has nothing to do with mikroC.
I agree that mE should make the bank switching transparent (it would not take much searching on the forum to find my view on that) to the user. But it is not, so learn how to do it yourself or use an 18F. I have several large programs which i had to convert from mikroC to mikroC pro so i had to go through the pain on this topic a long time back.
Best Regards
Mince
Mince
-
- Posts: 715
- Joined: 27 Dec 2006 14:33
- Location: Le Tréport , FRANCE
Re: IRP bit must be set manually for indirect access to
are there lots of low pincount devices in the 18F series ???
...
That's one of my problems ( I build small custom units for modellers ... so, chip size is rather important ...)
May be I should ask Microchip to make some, just for me ...
Alain
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Re: IRP bit must be set manually for indirect access to
there are a number of PIC18F options with OFN 6mmx6mm
Best Regards
Mince
Mince