Connect with us

PIC Assembler.

Discussion in 'Electronic Basics' started by [email protected], Oct 22, 2007.

Scroll to continue with content
  1. Guest

    I have found that the best way to save HTML off the web is to copy and
    paste into a blank email message in Outlook Express, with Rich Text
    (HTML) selected in the format menu.
    It ain't perfect, but much easier to edit and print in my experience.
  2. ian field

    ian field Guest

    Does anyone have a link to any tutorials for PIC assembly?

    Over the past few months I've been trying many permutations of Google search
    string, but most of the tutorials I've found assume previous experience at
    writing assy for microprocessors.

    Another problem is most of what I've found is HTML which is untidy to save
    for later study and many pages lose their image files after being saved to
    disk (anyone know why that happens?). Any help appreciated.

  3. No, but I know of a couple of good books by John Peatman, but they aren't
    exactly "beginner" books. Which particular PIC "line" were you looking at?
    Allot of the old stuff on the net are based upon 16f84 (or lesser) PICs.
    Those parts are basically obsolete and the modern day equiv would be a

    Since you are starting out fresh, I suggest you look at the 18F type PIC
    chips. They are far more capable and easier for a beginner IMO. is a site worth looking at. Digikey has a part number for a
    complete set of parts to populate the circuit board that is included with
    the book.
    I learned from looking at other code and using Peatman's first book, but I
    had quite a bit of past experience with programming in assembler. I could
    give you some sample code that I've written if you want.
  4. steamer

    steamer Guest

    --FWIW if you're a complete novice I recommend the Basic Stamp and
    the tutorials at I built my first robot with their stuff; great
    fun! I'm still using the Stamp for various projects. I'm told that the
    Propeller chip offers many more features and a friend is using one to build
    me a cnc controller for a machine tool but the 'basic' Stamp (actually the
    current iteration is the BS II) is still a great place to start. The book
    that comes with it is worth its weight in gold: a very good introduction.
  5. ian field

    ian field Guest

    The book I've already bought (PIC in Practice) is based mainly on the F84,
    at Maplin this is about twice the price of newer more capable PICs possibly
    indicating that Microchip want to discourage future sales, the Velleman
    K8048 kit I bought came with a 'free' F627, this and the F628 seem to be
    matching the F84's former popularity for projects & articles to be found on
    the net
    What makes the 18F parts easier than the 16F parts? I must admit not having
    paid much attention to the 18F parts - I think the Velleman programmer has
    limited 18F support compared to 16F parts, they might even be only supported
    via ICSP and also restricted by what is supported by the burner application.
    Fortunately the programmer is remarkably similar to the David Tait & Serpic1
    designs, so I may be able to search for programmer software with more
    devices supported.
    Does the Peatman book have an ISBN number? Most bookshops around here are
    reluctant to make much effort finding books without an ISBN and if its a US
    book we in the UK tend to get charged as many £ as the price in $ regardless
    of exchange rate - so I'm already baulking at the price before I've even
    seen it!
  6. It usually depends upon the date of the project. Currently, the 16F88 is
    the best of the bunch. They are all pretty much pin compatible, just more
    features in the newer parts. The 88 has a nice internal oscillator block
    that is precise enough (1%) to do serial comms without a crystal. Most code
    is easily ported, just changes in the _CONFIG word values and having to add
    an instruction or two during the program's initialization to disable the
    analog features of some of the i/o pins.
    The short answer is banking. The chip still uses banking, it's just that it
    powers on in such a state that all the SFRs are accessible without having to
    manipulate banking control bits. Just makes life a little easier on a
    If you can spare the money, buy a programmer, don't try to build one of the
    el-cheapo designs on the net. Most of the "no parts" type programmers
    depend upon conditions that most modern PCs don't operate under. Trust me
    you will have enough issues to sort out without having to wonder if your
    programmer is working. I use one from It wasn't exactly
    cheap, but it's fast, powered by USB cable and will program almost anything.

    You may wish to consider a pre-made dev board from somewhere like Some boards will make use a bootloader so that you don't
    need a programmer at all, just a serial connection to the board.
    ISBN: 0-13-046213-6 is the number for the book at Like
    usual, the 18F452 has been superceded by newer parts with less errata. The
    older book is ISBN: 0-13-759259-0 and the title is "Design with PIC
    Microcontrollers". To give you an idea of it's age, it talks allot about
    the 16C74 which was pre 16F84. I'd recommend the newer one.
  7. Eeyore

    Eeyore Guest

    Why would you want to use assembly language ?

    IIRC, there's a neat free high level language for PICs but since I don't use
    PICs, I never bookmarked it.

  8. Hopefully because it's the right way to learn how to program AFAIC.
    You must be referring to the PIC-AXE thingys that are programmed at a fairly
    high level by the user.
  9. Eeyore

    Eeyore Guest

    All of the worst code I've ever seen was written in assembler by people who
    'thought' they knew what they were doing.

    Assembly language makes NO sense whatever to my mind in the modern world. Sure,
    it's cheap since it avoids the need for a usually paid for compiler and that's
    your lot.

    Not sure. I think there's some 'PIC BASIC' out there too.

  10. ian field

    ian field Guest

    Thanks - that certainly sounds like it might be easier, maybe I could look
    into 18F parts and leave bank manipulation until I've learned a bit more
    about learning assy'.
    Unfortunately I'm not wealthy so I'll just have to make the best of what I
    can afford. The velleman is supposedly a proven reliable design although a
    bit dated by now, since that's what I've got that's what I'll have to put up
    with for now.
    Thanks, I'll phone the book shop tommorrow - is Peatman the author or the
  11. Tim Wescott

    Tim Wescott Guest

    Several reasons:

    For _really teeny_ bits of code it's easier to just write in assembly
    than to deal with the C runtime environment.

    For _really fast_ bits of code you'll almost always get more speed out
    of assembly than compiled C.

    For _really odd_ bits of code you often can't do things in C at all, or
    you get absurd levels of code bloat compared to what you can do in assembly.

    There's no better way to learn how a microprocessor really works.

    Many micro-based projects require just a bit of assembly programming to
    really work well, and you can't do that unless you've got someone on
    your team who can work in assembly. Even when they don't, understanding
    what the processor is doing 'underneath C' can be invaluable for debugging.


    Tim Wescott
    Wescott Design Services

    Do you need to implement control loops in software?
    "Applied Control Theory for Embedded Systems" gives you just what it says.
    See details at
  12. ian field

    ian field Guest

    Its better than raw binary.
  13. ian field

    ian field Guest

  14. Eeyore

    Eeyore Guest

    Who said anything about C ? Blech !

    Who said anything about C ? Blech !

    Who said anything about C ? Blech !

    I disagree. Obsessing with operation at register level is academically interesting
    but of almost no value to a coder and 'getting the job done'.

    Who said anything about C ? Blech !

  15. Eeyore

    Eeyore Guest

    That much is true. Seriously, the need to use assembler vanished about 30+ years

  16. John Fields

    John Fields Guest

    A poor workman blames his tools, and in this case (since, by your
    own admission you're unfamiliar with the tools) you blame the poor
    work on the tools instead of the workmen.
  17. John Fields

    John Fields Guest

  18. ISTR that you're some kind of 8052 genius. Let's see some of your code.
    Of all the reasons I can think of to use assembler, that one is near the
    bottom of the list. One closer to the top of the list would be to gain a
    real understanding of what's going on in the hardware. There's nothing like
    coding an interrupt handler in assembler to get an idea of what's required
    to be done by an ISR. I've had to work with way to many programmers who
    didn't have the faintest idea of what takes place at low levels. Talk to a
    JAVA evangelist to see what I mean. :-/
    There sure is and it's far from free.
  19. What an absurd statement.
  20. That book covers the 18F452, but it is not a beginner's
    guide. It's a college level text book with nice real-world examples.
    It'll probably work fine. I believe I built a Velleman kit for Atmel parts.
    The author. Take a good look at the web site. You can download sections of
    the book and check it out now.
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.
Electronics Point Logo
Continue to site
Quote of the day