Connect with us

AVR developer needs PIC help

Discussion in 'Electronic Basics' started by Jim Brain, Mar 9, 2006.

Scroll to continue with content
  1. Jim Brain

    Jim Brain Guest

    I hate to bother everyone with sometihng that screams newbie, but I'm lost.

    I decided I should broaden my horizons beyond the AVR line. Very happy
    with Atmel parts, but PICs have some attractive memory/pin count options
    not present in the AVR line. As well, seems lots of hobbyists want
    designs using the PICs, as they have more DIP variants.

    I went to microchip and ordered me a couple each of the
    18F2620,18F4620,18F1320, and a couple 16F688 (nice memory for such a
    small size part).

    I'd been trolling via Google for a few weeks looking for stuff, but
    after the purchase, I decided I really needed to grab the programmer
    schematic (as I have a pending Digikey order) and see what I need for
    the SW. So, I figured, get the STK200/300 ISP schematic counterpart for
    the PIC, grab a command line programmer equivalent to avrdude, and I'm set.

    It's now many hours later, and I've been seen NOPPP (along with the
    disclaimer from the developer to not build it), TLVP, THVP (Hi Byron), a
    slew of programmers that need a programmed PIC to run, etc. I'm also
    drowning in a sea of different programmer SW options, many of which only
    support certain programmers and/or PIC variants/families.

    So, either the success of the PIC line is what is confusing me with so
    many options, or what I desire is truly not available:

    simple programmer that will handle ISP programming of 18F line for sure,
    and 16F line would be nice. I'm partial to simplistic STK200-like
    designs that use the parallel port, but would consider $30-$40 if
    commercial. The $60-$100 options were too much to swallow for me. USB
    would be OK if SW support is good on target platforms. Parallel
    programmers seems to have the best support. I saw the TLVP, which looks
    pretty simple. I couldn't verify what THVP buys me here, to warrant
    finding a bigger wall wart. For the SX parts, I bought the SX-Key,
    which most people seem to support. Is there a predominant ISP
    programmer for the PIC line?

    Linux and Win32 (XP) SW to drive said programmer (I use both platforms).
    Command line tools are preferred, as I like "make program" ala AVR-GCC
    and friends. I saw picprg, but I can't tell if it supports the 18F
    series nor if it offers a cmd line mode. Tait's FPP also didn't have
    info on whether it handles 18F parts and if it would run under Win32
    (XP), which guards access to the parallel port.

    Maybe I am asking too much, and if so, let me know how close I can get
    to what I want, if at all. If I can't even get close, anyone interested
    in some new-in-box 18F series PICs? :) I never dreamed it'd be this
    hard to get started in PIC (And, I still need to find a C compiler...)
    I suppose I'm just a spoiled AVR fanboy, but this seems hard to me.

    Jim
     
  2. I have sucessfully programmed the 16F688 and 18F2455 with a very simple
    programmer.

    The basic idea is given at http://www.finitesite.com/d3jsys/proghvp.html. (I
    used a different buffer but I suppose you can use anything you want as long
    as you are able to get 5 volts out(i.e., you can use TTL with pullup
    resistors, etc...).


    I used the parallel port and WinPic(http://www.qsl.net/dl4yhf/winpicpr.html)
    and it seems to work prefectly as far as those two pics are concerned.
    Write your code, assemble/compile it into a hex file, load it up in winpic
    and tell it to program the pic and your done. You will have to setup an
    interface which tells winpic what parallel port pins are what. Its pretty
    easy to do and explains it all in the help documents. I use

    [Info]
    [ProgrammerControlLines]
    VppOnOff=!D2
    VddOnOff=!D3

    DataIn=ack
    DataOut=D7
    DataOutWhileReading=0
    OutEnable=!D6

    ClockOut=D5
    ClkEnable=!D4

    and have the outputs appropriately hooked up to the buffer and then to the
    pic(the power pins control transistors which is necessary for the high
    voltage need to program the pic).

    (You can add more Programmer Control Lines to WinPic to control things such
    as buttons and LEDS and such to add more functionality)

    You would be supprised how easy it is so my advice is for you just to dive
    right in. Although I still have not yet been able to program the 18F4431
    for some reason using the same method...

    Some things to note are that in WinPic you need to select raise VDD before
    VPP on some PICS(look at the timing diagrams for them to know... the 16F688
    needs it raised after and the 18F2455 needs it raised before).

    Probably the hardest part of it is getting the parallel port output... I had
    to tear up an hold modem and rip its connector out and manually solder wires
    to the pins so I could interface it with my breadboard... I then used hot
    glue to secure the wires at the connection to the connector so they wouldn't
    wiggle and short out... its not pretty but seems to work.

    I'm sure you could easily do this in a weekend if you wanted and have the
    parts.. its relatively easy connections(basicaly connect the dots). You
    will need about a 13V power supply though. I made a power supply that had 5,
    12 and variable so it was pretty simple to use but if you know what a
    voltage regulator is and how to use it then it shouldn't be much of a
    problem.

    Don't be scared to try it though... I had a lot of anxiety about it because
    I was afraid I would screw up the pics... but it went relatively
    smoothly(took me a couple of hours to do everything(excluding building the
    PS)). Another hint is that in WinPic you have to slow down the timing for
    some pics.... for the 18F2455 I can use it at 1us and for the 16F688 it has
    to be at 7us(you'll know what I'm talking about if you use winpic).

    If you need any more help I'll step you through what I have to get you on
    your way.

    Jon
     
  3. Jim Brain

    Jim Brain Guest

    I saw that. Byron's HLV programmer, but why it and not the LVP?
    This line concerns me (from the web page):
    "Code memory size now up to 8192 words, data EEPROM memory up to 256 byte."

    Seems like a 64kB 26XX would not work...
    Maybe this high voltage thing is common in PIC land. I'm just worried
    my ISP programmer would fall over my work, the HV would hit something,
    and poof, there goes an IC.
    I appreciate. I'm confident I can get things going, as I already
    program AVRs, I'd just rather not waffle around trying different
    programmers, SW packages, etc. Mainly the lack of details around which
    apps and programmers support the 18F series is what struck me as odd.
    The parts are not that new, are they? AVRGCC and avrdude typically have
    support for new AVR variants a month or two after Atmel gets them into
    production.

    Jim
     
  4. Not sure whats up with that. You can get the source code, which it says was
    done in Borland C V4... Might easily be able to re-compile it handle more.
    (But in the Code page under WinPic it has up to FFF0... so it might be able
    to handle it(and Data goes to about 1k))
    Well, there is a low voltage programming mode for ICSP and such... I haven't
    use it yet but I think you have to atleast program it once in HV mode to set
    the LV programming bit... its all in the programming document... goto the
    pic your interested in and it will show some docs and one will be about
    FLASH programming for it.

    The PIC's are pretty old I think.... There shouldn't be any problem
    programming them as they all use the same basic method. Looking at the
    programming specs it says

    1.0 DEVICE OVERVIEW

    This document includes the programming specifications

    for the following devices:

    .. PIC18F2221 . PIC18F4221

    .. PIC18F2321 . PIC18F4321

    .. PIC18F2410 . PIC18F4410

    .. PIC18F2420 . PIC18F4420

    .. PIC18F2450 . PIC18F4450

    .. PIC18F2455 . PIC18F4455

    .. PIC18F2480 . PIC18F4480

    .. PIC18F2510 . PIC18F4510

    .. PIC18F2515 . PIC18F4515

    .. PIC18F2520 . PIC18F4520

    .. PIC18F2525 . PIC18F4525

    .. PIC18F2550 . PIC18F4550

    .. PIC18F2580 . PIC18F4580

    .. PIC18F2585 . PIC18F4585

    .. PIC18F2610 . PIC18F4610

    .. PIC18F2620 . PIC18F4620

    .. PIC18F2680 . PIC18F4680



    Which is quite a wide range. I Still have not been able to program the
    18F4680 and the 18F4431 for some reason. It might be an incompatibility with
    WinPic(yet it does list it as a supported device) and I'm fairly confident I
    don't have anything wired up wrong so there must be something I'm
    missing(but the document applies equally to the 18F2455 as to 18F4680, yet I
    can only get it to work with one of them... so maybe it does have something
    to do with WinPic).


    AFAIK microchip doesn't bring out many new pics very often... they have a
    new 16-bit series comming out sometime and I suppose they are finished with
    the pic18 series(as far as new designs are concerned)... I could be wrong
    though.

    Jon
     
  5. Byron A Jeff

    Byron A Jeff Guest

    I'll take a crack at it.
    While PICs are quirky, they do bring a lot to the table.

    Did you sample them? Microchip has an outstanding sample program.
    That's a good game plan.

    Are you planning on working in assembler initially?
    Sounds like a pretty good plan.
    It's a serial port programmer that requires a true serial port to operate
    properly. Michael is probably depricating it for that reason.

    Mine are just simple code dumpers. I really prefer bootloaders and the
    Trivial programmers are a fast way to get a bootloader dumped. The ICSP
    version will do the job you require.
    That's the new model. The expectation is that the programmer is such a
    central part of the development process that having a reliable, processor
    driven programmer handling everything is the way to go. But the creates
    the chicken/egg problem of how to develop a programmer to program the chip
    for the programmer.
    I'm not sure there's a single solution there. winpicprog seems to have
    wide coverage of programmers and chip families. Microchip has made the process
    difficult because they keep rolling out different programming algorithms
    instead of just sticking to a single unified model.
    The Pickit 2 fits this bill nicely.
    That's debatable especially now that Microchip is rolling out the pickits.
    It's designed that way.
    Low voltage programming dedicates an I/O pin in the middle of port B for the
    low voltage programming signal. Most developers can't stand losing a pin in
    the middle of a full sized port.
    Nope. There's everything from homebrew to professional. And developers are
    all over the map. One reason I push the Trivial line is that it's deliberately
    designed not to put a huge investment on time/resources. Also any parallel
    port programming software that can be configured can use it. So you can
    spend the 1/2 hour building and testing it and it'll serve your immediate
    needs.

    Be aware that you need to ground the cable shield through a cap in order to
    get long cable operation. The AC termination scheme I set up isn't necessary.

    Gotta go,

    BAJ
     
  6. Jim Brain

    Jim Brain Guest

    Assuming I can program one of them... :)
    I saw that, but assumed it was a hassle, so I just ordered the parts.
    If all goes well, I'll sample something later, since you say it's pretty
    easy.
    Would rather not :). I can do PIC assembly (well, did SX assembly),
    but I suck at it. C is my lang of choice.
    I noticed that. I've not had any trouble with the simple parallel port
    programmers on the AVR line, and I sometimes need to write special
    bootloaders that can be used by the item I am hooking the AVR to
    (non-standard pin usage, non standard protocols, etc... I know, but when
    you're doing an ATMEGA8 MLF and the interface from the PC is via some
    INT lines, that's what I have to use to make a bootloader).

    I gather from your position that most folks build the simple programmer
    as a one time use to program a better programmer?
    Yeah, and I really want a Linux solution, as I am migrating my
    development to Linux soon.
    Is there Linux programmer support for it?
    AHHH. You ought to note that on your page. That is a very useful piece
    of informaiton.
    Can it serve all my needs :)

    If Pickit 2 has Linux support from someone, then I'll grab one.
    Otherwise, I'm afraid I'll wait, as I really want to jump full-time to
    Linux (for a host of other reasons).

    Jim
     
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

-