PIC registers in different banks

Thread Starter

Torbek

Joined Apr 19, 2019
50
Hi , if I declare an address absolute mode for a register at 0x320 can I access that memory address within the code without bankselect in assembler?

The reason I ask is I have a PWM routine and want to manipulate data without switching banks all the time.
 

Papabravo

Joined Feb 24, 2006
17,262
If the instruction set supports reading and writing a file register with the required number of bits, then yes you can do it. If the instructions that you must use have only a partial address then the answer is no.
 

John P

Joined Oct 14, 2008
1,917
Hi , if I declare an address absolute mode for a register at 0x320 can I access that memory address within the code without bankselect in assembler?

The reason I ask is I have a PWM routine and want to manipulate data without switching banks all the time.
The answer is no. But you can arrange things so that your variables are in the same bank as whatever special function registers you need to access the most often, though it's only useful if the SFRs themselves don't require bank switching. Or, you can use one of the top 16 registers, which are independent of the selected bank.
 

Papabravo

Joined Feb 24, 2006
17,262
The answer is no. But you can arrange things so that your variables are in the same bank as whatever special function registers you need to access the most often, though it's only useful if the SFRs themselves don't require bank switching. Or, you can use one of the top 16 registers, which are independent of the selected bank.
We don't really know which member of which family the TS is talking about. We can suspect all we want, but we won't know until he tells us.
 
Top