What does direct access to control registers and RAM meen?
The internal PIC RAM is located in the RAM address space of the PIC.
This meens that if you need to access a RAM location (to read from or
write to a variable) you have to locate the variable within this RAM
address space. This RAM is divided into pages. This meens that the
contents of a RAM location must be accessed by setting special bits in
the control registers and combining these with the least significant
part of the address in the actual instruction that accesses the RAM.
This complicates accessing RAM.
Some BASIC compilers simplfy things by using the indirect register to
access all the RAM in a uniform manor. This adds an additional burdon to
the PIC at runtime (slowing it down because of unnecessary extra
instructions to setup the indirect register even when not needed). The
XCSB compiler takes advantage of direct access to RAM, greatly improving
performace and reducing program size.
What about the control registers?
The control registers are accessed in the same way as the internal RAM.
They are like special RAM locations that can be read from or written to
just like normal RAM, But unlike normal RAM writing a value to a control
register causes some effect on the internal workings of the processor or
interface hardware, and reading from a control register returns
information about the internal workings of the processor or interface
hardware.
Such a control register would be the STATUS register. This returns
information about the internal status of the PIC processor. Another
control register would be PORTA, writing to this register would allow
you to change the state of the I/O pins on the PIC chip. Reading from
this register would allow you to read the inputs on the I/O pins on the
PIC chip.
|