lord loh.
Member
I am using the PIC 18F452 controller...
I tried experimenting with banks in the MP Lab simulator.
This is what I saw...
When I wrote to 0x0000 (movwf 0x0000)the byte was stored in 0x0000 (bank 0 selected) when I tried to write to (0x0100), again 0x0000 was written to.
Now I select bank 1 by banksel 0x0100 and execute (movwf 0x0103) is writen to 0x0103. When I give (movwf 0x0203) again 0x0103 was witten to.
Now I selected bank5 (banksel 0x0500) and execute (movwf 0x0503), my byte got written to 0x0503. And When I execute (movwf 0x0100), 0x0500 is written to...
So far so good....
Now When I try to address 0x0005, data is written to bank0 while I have selected bank5. So what is the point of banks.... I have to specify an absolute address to read or write from it.. I can't just address from 00 to FF in my specified bank....
I tried experimenting with banks in the MP Lab simulator.
This is what I saw...
When I wrote to 0x0000 (movwf 0x0000)the byte was stored in 0x0000 (bank 0 selected) when I tried to write to (0x0100), again 0x0000 was written to.
Now I select bank 1 by banksel 0x0100 and execute (movwf 0x0103) is writen to 0x0103. When I give (movwf 0x0203) again 0x0103 was witten to.
Now I selected bank5 (banksel 0x0500) and execute (movwf 0x0503), my byte got written to 0x0503. And When I execute (movwf 0x0100), 0x0500 is written to...
So far so good....
Now When I try to address 0x0005, data is written to bank0 while I have selected bank5. So what is the point of banks.... I have to specify an absolute address to read or write from it.. I can't just address from 00 to FF in my specified bank....