General purpose register problem in 16f877

Status
Not open for further replies.

kvrajasekar

New Member
Hi all,

I am using 16f877 in my project.i required 140 registers to store my data.I have used bank0 and bank 1,bank 3.

cblock 0x20
timer0....
endc

cblock 0xa0
timer1...
endc

cblock 0x120
timer3....
endc

To access bank1,3 registers i used BANKSEL macro like,

banksel time1
movwf time1
banksel min1
movwf min1

I am not using banksel macro to access bank0 registers.Is it neccessary to use?
But my loop is not working properly.And my code length is more than 3k lines,It crossing the page boundary to solve the problem i used 'fcall' instruction...please tell me where i am going wrong...If you want i'll post my code.
 
Last edited:
Post your code.

However, it sounds like you are on the limit for what can be done with a 16F877.

Your direct addressing can only access 128 registers, of which some are special function registers. With indirect you can only access 256 registers.

If you use a PIC18, you get 3 FSR register sets that can each access all of the memory and transfers become a lot easier. There is also postdec and postinc which allows you to transfer blocks of data very easily. There are no page issues on normal gotos and calls.

Or go to a 16 bit PIC which lets you access lots of data directly and indirectly, and 16 working registers, most of which can be used as FSR registers.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…