IRP - Message - How to resolve this
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
search tool using RWM would get you here...
http://www.mikroe.com/forum/viewtopic.p ... hlight=rwm
you can also google it for further information
http://www.mikroe.com/forum/viewtopic.p ... hlight=rwm
you can also google it for further information
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Hi Mince,
Thank You for the Great Advice on reducing RAM usage.
I could reduce the RAM usage to 37% as of now.
"work smarter not harder" - Comes from experience I guess.
Just for enhancing my knowledge, how do I access the BANK 3 and 4 w.r.t arrays. If you give some reference it will of immense help.
Thank You
Shankar
Thank You for the Great Advice on reducing RAM usage.
I could reduce the RAM usage to 37% as of now.
"work smarter not harder" - Comes from experience I guess.
Just for enhancing my knowledge, how do I access the BANK 3 and 4 w.r.t arrays. If you give some reference it will of immense help.
Thank You
Shankar
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Hello,
From datasheet for PIC16F877A: (http://ww1.microchip.com/downloads/en/D ... df#page=19)
IRP: Register Bank Select bit (used for indirect addressing).
1 = Bank 2, 3
0 = Bank 0, 1
Before access to component of an array need to set IRP to 1, and after access, manually return to 0.
Best regards,
Losic Tihomir
From datasheet for PIC16F877A: (http://ww1.microchip.com/downloads/en/D ... df#page=19)
IRP: Register Bank Select bit (used for indirect addressing).
1 = Bank 2, 3
0 = Bank 0, 1
Before access to component of an array need to set IRP to 1, and after access, manually return to 0.
Best regards,
Losic Tihomir
mikroElektronika [Support team]
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Hi Shanker
using any of the banks is not difficult at all, you simply set status register to what you require, be it the IRP or the RP1,RP0.
the problem is this... you would need to look at the variable RAM locations then you would need to go through your code listing and inject status register changes to fit with the variable location while making sure you return the status register to whatever is needed.
you would force least used and to some extent the least complex variables into the upper banks using the absolute command, this would reduce the number of places that manual status register control would be needed.
as for working smarter not harder, yes that comes from experience. Always try to use as little RAM as possible, its power hungry, everytime you access it electrical noise is produced and so increased RAM usage leads to increased EMC, RAM is also one of the areas which can suffer from bit changes due to external noise.
using any of the banks is not difficult at all, you simply set status register to what you require, be it the IRP or the RP1,RP0.
the problem is this... you would need to look at the variable RAM locations then you would need to go through your code listing and inject status register changes to fit with the variable location while making sure you return the status register to whatever is needed.
you would force least used and to some extent the least complex variables into the upper banks using the absolute command, this would reduce the number of places that manual status register control would be needed.
as for working smarter not harder, yes that comes from experience. Always try to use as little RAM as possible, its power hungry, everytime you access it electrical noise is produced and so increased RAM usage leads to increased EMC, RAM is also one of the areas which can suffer from bit changes due to external noise.
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Hello,
Please, click on the link below:
http://www.mikroe.com/en/books/picbook/2_06chapter.htm
On this page you have detailed description about direct and indirect addressing, with concise instructions about using IRP in your program.
Best regards,
Losic Tihomir
Please, click on the link below:
http://www.mikroe.com/en/books/picbook/2_06chapter.htm
On this page you have detailed description about direct and indirect addressing, with concise instructions about using IRP in your program.
Best regards,
Losic Tihomir
mikroElektronika [Support team]
-
- Posts: 5
- Joined: 26 Jan 2010 14:52
Hi everybody
Dear Mince-n-Tatties,
I have a project about line follower robot and I want to use lcd for displaying pwm parameter. I can not exactly understand your project what to do. I want to understand your project...so, can you upload proteus simulation program files about your project ?
I have a project about line follower robot and I want to use lcd for displaying pwm parameter. I can not exactly understand your project what to do. I want to understand your project...so, can you upload proteus simulation program files about your project ?
-
- Posts: 2780
- Joined: 25 Dec 2008 15:22
- Location: Scotland
Re: Hi everybody
i dont have any project in this thread.Arthur_armada wrote:Dear Mince-n-Tatties,
I have a project about line follower robot and I want to use lcd for displaying pwm parameter. I can not exactly understand your project what to do. I want to understand your project...so, can you upload proteus simulation program files about your project ?
-
- Posts: 5
- Joined: 26 Jan 2010 14:52
Re:
hi i am mayualeksandar.nikolic wrote:Hi,
Our PIC compilers, for the time being, do not handle indirect access to higher two banks of RAM automatically. This should be done by setting the appropriate IRP bit for addressing those higher locations. If some arrays end up linked in those parts of RAM, you have two options:
1. First option is the most convenient. Just go to Statistics and take a look at Used RAM locations and try locating the appropriate place in lower two banks where your array might fit. Then just use linker command absolute and force the linker to place your array there. I have found out that your two arrays might be fitted in to successive RAM locations:2. Other option is that you handle this IRP bit by yourself. But this is a little tricky and requires more explanation, so if you are very much into it, I will explain in more details, but if you are satisfied with the first solution then this is not necessary.Code: Select all
unsigned int on[16] absolute 0x00C4; unsigned char output[16] absolute 0x00E4;
Best regards,
Aleksandar
please tell how to set irp bit in mikroc /mikro pro?
please help me