1
\$\begingroup\$

I have Recently been working on PIC16F84. In PIC16F84 the RAM is divided into two bank. I noticed some of the registers have duplicates in bank1 and bank2. Examples are PCL, STATUS etc. Can any one please explain why these duplicates are needed?
Dataset link.

\$\endgroup\$
4
\$\begingroup\$

There are a number of reasons for this.

Speed - Registers that need to be accessed frequently are always available whatever bank you have selected, which saves on having to constantly switch banks to get to them.

Necessity - The register that controls which bank you use has to be available all the time. If it was in just one bank you would be unable to access it once you'd switched to another bank, and you'd be stuck there!

Economy - If you don't require all of your address space to hold the memory, you can ignore some of the address lines to save on decoding logic and use the chip space for something else.

\$\endgroup\$
  • \$\begingroup\$ That means duplicate copy are register hold same value all time? \$\endgroup\$ – Emran Feb 24 '17 at 9:15
  • 3
    \$\begingroup\$ They're not copies, they're the same physical register appearing in different places. Think of it like two different doors going into the same room :) \$\endgroup\$ – Finbarr Feb 24 '17 at 9:20
  • \$\begingroup\$ What a example bro. :D \$\endgroup\$ – Emran Feb 24 '17 at 9:40
  • 2
    \$\begingroup\$ ... doors from two different hallways. \$\endgroup\$ – CL. Feb 24 '17 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.