Results 1 to 2 of 2

Thread: PIC18F bank access

  1. #1
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0

    PIC18F bank access

    I have some trouble understanding bank access on a PIC18F8722. More specific the "a" bit in an instruction. Can I just set the "a" bit to 0 and not bother with bank selection? Does this apply for the GPRs (60h to F5Fh) only? Or can I access the other registers as well?

    I'm wondering because I don't want to have to keep track of which bank the registers are placed in. On the PIC16F628 that I have been using up until now, I only had to use data from Bank1 on rare occasions. On the PIC18F I will have to use a large number of GPRs, and it would be a pita to keep track of it all.

    I'm using MPasm for compiling and I only program in assembly. I have written several routines for the 16F628A for SD cards and FAT16 file systems. Now I will have to move on to the 18F series for faster speeds and a better instruction set. Are there any tips and tricks I can use that MPasm understands?

    Thanks for your help.


  2. #2
    Registered The Blight's Avatar
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    580
    Downloads
    0
    Uploads
    0
    I believe I have figured out how it works.

    Address 0h to 60h is Access RAM and can be reached no matter what bank you are in through the "a" bit. The same goes for address F60h to FFFh though these are used for the SFRs.

    So all the data I need to share between banks should be placed in the first 96 registers for easy access. Tidy. Did a couple tests to see if the PIC18 Simulator can catch this, but it seems like it doesnt care too much.


Similar Threads

  1. Capacitor Bank Help
    By Shanghyd in forum Phase Converters and VFD
    Replies: 3
    Last Post: 08-18-2009, 12:52 AM
  2. Need Help!- multi drill bank/head
    By pinkjas in forum DIY CNC Router Table Machines
    Replies: 1
    Last Post: 04-07-2009, 03:04 AM
  3. Control G201 if PIC18F.
    By Bomber-eng in forum Gecko Drives
    Replies: 0
    Last Post: 06-27-2008, 01:18 PM
  4. scmi drill bank
    By wcmboss in forum Commercial CNC Wood Routers
    Replies: 5
    Last Post: 03-23-2007, 10:49 AM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.