Libstock
It is currently 24 Oct 2014 12:15

All times are UTC + 1 hour




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: 31 May 2009 04:36 
Offline

Joined: 22 Apr 2009 02:31
Posts: 20
Hi,
getting compiler warning:
Quote:
IRP bit must be set manually for indirect access to '?Local_Text' variable

but can not understand what is causing it.
Quote:
dim Freq as longint ' Frequency
dim Freq1 as longint
...
Freq1 = Tmr1Hi*65536 + TMR1H*256 + TMR1L
'Freq = Tmr1Hi*65536 + TMR1H*256 + TMR1L
...

What i do not get is Freq1 is causing this error. When swtiching the lines warning disappear.
any idea?


Top
 Profile  
 
 Post subject:
PostPosted: 01 Jun 2009 13:27 
Offline
mikroElektronika team
User avatar

Joined: 21 Apr 2009 09:56
Posts: 71
Location: Belgrade, Serbia
Hi,

You have a memory bank problem.IRP is bank select bit used for indirect
addressing.Our compiler is not capable to set IRP bit.

IRP=0 -> Bank 0,1
IRP=1 -> Bank 2,3

So you must do that manually. Also you can use 'absolute' directive and
move variable at memory banks 0 and 1(directive absolute specifies the starting address in RAM for variable.
If variable is multi-byte, higher bytes will be stored at the consecutive
locations).

Instead PIC16F you can always use PIC18F.
That way, you will not have any problems with memory banks.

Regards

Igor


Top
 Profile  
 
 Post subject:
PostPosted: 01 Jun 2009 15:56 
Offline

Joined: 22 Apr 2009 02:31
Posts: 20
Thank you Igor.

So basically I have two many variables and the compiler started allocating variables to the Bank 2 and 3, correct?

If I manually set the IRP to 1, I still will not be able to perform funcation with variables from Bank01 and Bank23 at the same time, right?

So either I need to trim the number of variables I am using for use ASM to move the data between banks before accessing them.
Am I on the right path?


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 10:09 
Offline

Joined: 05 Jul 2007 12:55
Posts: 95
Hello,

We're facing the same problem - does this mean that the compiler can only use variables that it has allocated in bank 0 for the 16F family? Or does it mean that you cannot have variables that span over multiple banks?

Thanks,

--Amr

_________________
[url=http://www.mikroe.com/forum/viewtopic.php?p=69489]mikroC USB Joystick[/url]
[url=http://helmpcb.com/software/usb-hid-template-for-visual-basic-2005]USB HID Template for Visual Basic 2005/2008/2010[/url]
[url=http://www.mikroe.com/forum/viewtopic.php?p=55958]Storing floats and other objects in EEPROM[/url]


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 11:09 
Offline

Joined: 28 Dec 2005 16:42
Posts: 1379
Location: Laval,Québec,Canada,Earth... :-)
amrbekhit wrote:
does this mean that the compiler can only use variables that it has allocated in bank 0 for the 16F family?
Or does it mean that you cannot have variables that span over multiple banks?


both are true so like igor say, when facing to this p16 limit, use p18 instead...

hth a bit ;-)


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 11:15 
Offline

Joined: 05 Jul 2007 12:55
Posts: 95
Let me just clarify:

The PIC16F88 has 368 bytes of RAM split over 4 banks - with only 96 bytes available in bank 0 - so if I use the mikroC PRO compiler I can only use 96 bytes?

--Amr

_________________
[url=http://www.mikroe.com/forum/viewtopic.php?p=69489]mikroC USB Joystick[/url]
[url=http://helmpcb.com/software/usb-hid-template-for-visual-basic-2005]USB HID Template for Visual Basic 2005/2008/2010[/url]
[url=http://www.mikroe.com/forum/viewtopic.php?p=55958]Storing floats and other objects in EEPROM[/url]


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 13:33 
Offline

Joined: 28 Dec 2005 16:42
Posts: 1379
Location: Laval,Québec,Canada,Earth... :-)
hi,
no but you have to do it manuelly with org and absolute directive...

if you use a 16f88, may i suggest to move with a p18f1320 ? Same pin count, same memory size and near same price. Is not pin compatible but at least Vss and Vdd are at the same place ...


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 15:54 
Offline

Joined: 05 Jul 2007 12:55
Posts: 95
Hi piort,

Thanks for your suggestion - unforunately, none of the 18-pin 18Fs have I2C ports, so they're not really very suitable.

I have to say, this is a rather shocking revelation - I do hope that mikroelektronika address this some time soon - having to do it manually is a pain in the butt - the compiler really ought to do the bank switching for you...

Anyway, the 18Fs also have banked memory - will I not also face the same problem? Or does the mikroC compiler automatically handle bank switching for RAM on the 18Fs?

--Amr

_________________
[url=http://www.mikroe.com/forum/viewtopic.php?p=69489]mikroC USB Joystick[/url]
[url=http://helmpcb.com/software/usb-hid-template-for-visual-basic-2005]USB HID Template for Visual Basic 2005/2008/2010[/url]
[url=http://www.mikroe.com/forum/viewtopic.php?p=55958]Storing floats and other objects in EEPROM[/url]


Top
 Profile  
 
 Post subject:
PostPosted: 29 Jun 2009 18:17 
Offline

Joined: 28 Dec 2005 16:42
Posts: 1379
Location: Laval,Québec,Canada,Earth... :-)
amrbekhit wrote:
Thanks for your suggestion - unforunately, none of the 18-pin 18Fs have I2C ports, so they're not really very suitable.


its true, nothing before 20 pin with the 18f14k50... or many 28 pin... If you dont need to use ISR, soft I2C can be use...
If you need ISR, maybe can you adapt your project with a 28 pin (like the P18f2321) in ssop form they are very small ;-)

amrbekhit wrote:
Anyway, the 18Fs also have banked memory - will I not also face the same problem? Or does the mikroC compiler automatically handle bank switching for RAM on the 18Fs?


The P18 memory structure isnt the same then P16. Banking structure for P18 can be handle by all mE compiler.

HTH ;-)


Top
 Profile  
 
 Post subject:
PostPosted: 30 Jun 2009 01:58 
Online

Joined: 18 Feb 2006 13:17
Posts: 4195
amrbekhit wrote:
Let me just clarify:

The PIC16F88 has 368 bytes of RAM split over 4 banks - with only 96 bytes available in bank 0 - so if I use the mikroC PRO compiler I can only use 96 bytes?
Not exactly, BANK1 may also be used without the need of IRP switching.


Top
 Profile  
 
PostPosted: 07 Dec 2011 12:43 
Offline

Joined: 06 Dec 2011 21:51
Posts: 16
This is a BIG PROBLEM!

I´m using the PIC16F886. I use a lot the CCS compiler, but due the LCD Library I have migrated to mikroC.

To start, I have installed the demo version to check if the display was working. After the display work normally I bought de license of mikroC.

So, during the development my LCD started to stay crazy!! Somethings that I wrote in the display of LCD was wrong! I saw this problem, and now I find that is a problem in the mikroC??? I can´t believe this!

I pay for a thing to save me, and no **** me!

I need to finish this project in TWO WEEKS! And I doesn´t want to change my uC!!!

PLEASE HOW CAN I RESOLVE THIS PROBLEM?? EASILY!


Top
 Profile  
 
PostPosted: 08 Dec 2011 10:13 
Offline
User avatar

Joined: 16 Jun 2011 13:48
Posts: 3565
Hello,

Please can you explain in more details the problem that you are facing.
Aldo if you can post here the project that is causing this behavior so we can inspect it.

Best regards.


Top
 Profile  
 
PostPosted: 08 Dec 2011 10:51 
Offline

Joined: 06 Dec 2011 21:51
Posts: 16
janko.kaljevic wrote:
Hello,

Please can you explain in more details the problem that you are facing.
Aldo if you can post here the project that is causing this behavior so we can inspect it.

Best regards.



The problem is the acess in the BANK 1, 2 and 3!

I was reading the mikroC manual and there is this:
"
Limits of Indirect Approach Through FSR
Pointers with PIC16 are "near": they carry only the lower 8 bits of the address. Compiler will automatically clear the 9th bit upon startup, so that pointers will refer to banks 0 and 1. To access the objects in banks 3 or 4 via pointer, user should manually set the IRP, and restore it to zero after the operation. The stated rules apply to any indirect approach: arrays, structures and unions assignments, etc.
Note: It is very important to take care of the IRP properly, if you plan to follow this approach. If you find this method to be inappropriate with too many variables, you might consider upgrading to PIC18.
Note: If you have many variables in the code, try rearranging them with linker directive absolute. Variables that are approached only directly should be moved to banks 3 and 4 for increased efficiency.
"
This messagen is in the page 33 of the mikroC Manual.

So, what I want to know. How can I use the bank 3 and 4? How can I have access in this banks? The manual show de solution, but doesn´t show how to use this solution.
How I use the directive "absolute"? I don´t have idea!

In the mikroC the message is:

102 1511 IRP bit must be set manually for indirect access to 'pe' variable AutoClave.c
101 1511 IRP bit must be set manually for indirect access to 'pd' variable AutoClave.c
0 1511 IRP bit must be set manually for indirect access to '?lstr1_AutoClave' variable AutoClave.c
0 1511 IRP bit must be set manually for indirect access to '?lstr10_AutoClave' variable AutoClave.c

If you really need, I will post the code.


Top
 Profile  
 
PostPosted: 08 Dec 2011 17:56 
Offline

Joined: 05 Mar 2009 10:28
Posts: 3104
duda1g wrote:
This is a BIG PROBLEM!

II pay for a thing to save me, and no **** me!
I need to finish this project in TWO WEEKS! And I doesn´t want to change my uC!!!

PLEASE HOW CAN I RESOLVE THIS PROBLEM?? EASILY!



Before you accuse the compiler just make sure you did not do some thing silly in your code as there are many many people in this forum using mikro compiler and LCD dispalys with no problems

if you so sure post your project and we can see what the problem might be

_________________
P.Erasmus
Saratov,Russia
--------------------------------------------------------------


Top
 Profile  
 
PostPosted: 09 Dec 2011 13:09 
Offline
User avatar

Joined: 16 Jun 2011 13:48
Posts: 3565
duda1g wrote:
If you really need, I will post the code.

Hello,

The best way for all of us to help you is to post your project here.
This way we will be able to see where the problem lies.

For more details regarding linkers directive absolute, please check help file.

Best regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group