Connect with us

Pic design question

Discussion in 'Electronic Basics' started by Cathryn, Mar 26, 2005.

Scroll to continue with content
  1. Cathryn

    Cathryn Guest

    I was just wondering why the pic16f676 (and most others)
    use bank0 and bank1 to access registers. Would it be such
    an overhead to use a 15 lines flash memory instead of just
    14, this way we could have a full 8 bit for the registers instead
    of just 7, doesn't this make more sense, i.e. make the design
    slightly wastefull but in return we could have a much simpler
    learning curve without all this bank0/1 business? Sometimes
    elegance has a cost, but isn't it worth paying?
  2. I'm guessing it's historical. There exists lots of software that uses
    it. Thus, it's recorded in sand (silicon). I find it an annoying source
    of bugs. It probably simplified bringing their decoder to a larger flash
    in 1992, or something like that.

    If you are looking for elegance, skip the PIC series, which is hopeless
    from that standpoint. There are many choices out there that don't have
    these annoying quirks.

    Robert Monsen

    "Your Highness, I have no need of this hypothesis."
    - Pierre Laplace (1749-1827), to Napoleon,
    on why his works on celestial mechanics make no mention of God.
  3. In a high volume tight budget design no the elegance isn't worth the cost.
    I assume you are using MPLAB and are familiar with the "banksel"
    "instruction." It isn't so bad once you get used to it and if you stick to
    a single PIC so you can memorize which bank all your registers are in.

    Fortunately if you do have money burning a hole in your pocket you can use a
    different PIC like the 18F2320 for instance where all your special function
    registers are in a single bank. Of course 18F devices are more complicated
    so they may not have a learning curve advantage. On the other hand I think
    the new PIC10F offerings have so few special function registers they don't
    need splitting up into more than one bank either.
  4. Bob Eldred

    Bob Eldred Guest

    Bank shifting as well as having to load "high" bytes into the pclath for
    paging is an anachronism of the PIC design. It apparently comes about from
    the days when silicon was dear to keep chip area down. That's hardly the
    case these days. As was mentioned the PIC 18 series does not require this
    nonsense and there are many other choices from other manufactures. I think
    Microchip would be well advised to re-design the 16 series so that these
    inconveniences are not required. These days they could do a hardware design
    that would use the same code at the assembly level but with added bits to
    not require any banking or paging for operation. Where such commands are in
    the code, the hardware could ignor them. Most of the problems I have had
    with PICs are related to improper banking and paging, the reqirements of
    which are less than obvious to a beginner. Sometimes the hardest thing to
    find is the case where the damn things jumps to an unrelated place in the
    code because some goto isn't properly pclathed. Also a new 16 bit design
    would alleviate all of these problems plus give much added power.
  5. That just means you are a wuss programmer. :)

    A real programmer programs in machine code, never needs to debug anything,
    believes direct sunlight causes instant death, and eats tires for breakfast
    (or was it they drink Mountain Dew?).

  6. I think bad programmers drink Classic Coca-Cola. ;)
  7. Thought real men drink Jolt.

    petrus bitbyter

  8. I prefer my caffeine ice cold and green, thank you!
  9. Rich Grise

    Rich Grise Guest

    That may be, but so does at least one excellent programmer that I know of!

  10. Rich Grise

    Rich Grise Guest

    So do the good ones, after liberal dilution with 80 proof or better. ;-)


  11. Do you remember the computer magazine "Kilobaud" published by Wayne
    Green? On of the joke articles was asking people to support "The old
    programmer's home" where they would be provided with blank punch cards,
    coding sheets and Coke Cola.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Electronics Point Logo
Continue to site
Quote of the day