IRP - Message - How to resolve this

General discussion on mikroC PRO for PIC.
Author
Message
Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#31 Post by Mince-n-Tatties » 21 Jan 2010 22:49

lastly as you are using other portB pins outwith the LCD function i would suspect you are going to have RWM errors which will impact the LCD anyway.

you will either need to employ the port shadow method or switch to using an 18F.

shanpuru
Posts: 39
Joined: 20 Nov 2009 18:42

#32 Post by shanpuru » 22 Jan 2010 11:50

Hi Mince,

Thank you for your continued guidance.

1. What is RWM errors.

Will all ports of PIC16F877A have this problem?

2. Does PIC18 have MSSP ports to work with I2C devices.

Thank You
Shankar

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#33 Post by Mince-n-Tatties » 22 Jan 2010 13:10

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

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#34 Post by Mince-n-Tatties » 22 Jan 2010 13:13

you could just move whatever you have on the spare portb pins to any other free pins, if there are any. I have not looked at the entire system usage.

shanpuru
Posts: 39
Joined: 20 Nov 2009 18:42

#35 Post by shanpuru » 23 Jan 2010 11:58

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

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

#36 Post by tihomir.losic » 23 Jan 2010 12:39

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
mikroElektronika [Support team]

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#37 Post by Mince-n-Tatties » 23 Jan 2010 12:53

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.

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

#38 Post by Mince-n-Tatties » 23 Jan 2010 12:55

Losic Tihomir

please excuse my repeat information, i must have been typing while you had already posted.

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

#39 Post by tihomir.losic » 23 Jan 2010 14:12

Mince-n-Tatties wrote:Losic Tihomir

please excuse my repeat information, i must have been typing while you had already posted.
Hello,

no problem, it is a forum ;)
Hope that these informations will use shanpuru to solve the problem.

Best regards,

Losic Tihomir
mikroElektronika [Support team]

shanpuru
Posts: 39
Joined: 20 Nov 2009 18:42

#40 Post by shanpuru » 24 Jan 2010 17:14

Hi,

Any example on indirect addressing of a particular element in an array is going to make my understanding faster.

Regards
Shankar

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

#41 Post by tihomir.losic » 25 Jan 2010 20:23

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
mikroElektronika [Support team]

Arthur_armada
Posts: 5
Joined: 26 Jan 2010 14:52

Hi everybody

#42 Post by Arthur_armada » 26 Jan 2010 15:05

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 ?

Mince-n-Tatties
Posts: 2780
Joined: 25 Dec 2008 15:22
Location: Scotland

Re: Hi everybody

#43 Post by Mince-n-Tatties » 26 Jan 2010 16:52

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 ?
i dont have any project in this thread.

Arthur_armada
Posts: 5
Joined: 26 Jan 2010 14:52

#44 Post by Arthur_armada » 26 Jan 2010 19:14

I am sorry. I think so shanpuru have details of this projects. :S

mayu123
Posts: 2
Joined: 14 Sep 2010 21:40

Re:

#45 Post by mayu123 » 14 Sep 2010 21:52

aleksandar.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:

Code: Select all

unsigned int on[16] absolute 0x00C4;
unsigned char output[16] absolute 0x00E4;
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.

Best regards,
Aleksandar
hi i am mayu
please tell how to set irp bit in mikroc /mikro pro?
please help me

Post Reply

Return to “mikroC PRO for PIC General”