Connect with us

Asking for some PIC guidance

Discussion in 'Electronic Basics' started by [email protected], Dec 12, 2005.

Scroll to continue with content
  1. Guest

    Hi there,

    Apologies in advance if I didn't pick quite the right newsgroups to
    post this in. I'm a total newbie to PIC use in robotics or motor
    actuation, however I'm very familiar with embedded development concepts
    (Assembly on embedded M68K FPGA, etc). I'm very familiar with
    languages like C, Assembly, and Basic. What I want to do is drive a
    12V DC motor based on several sensor inputs. When sensor inputs
    change, I want the motor to spin in the opposite direction from last
    time. The logic would be very simple, and I need the hardware to be as
    compact as possible. We're talking drive currents in the neighborhood
    of several amps. Where do you suggest I start (buying hardware,
    learning resources, etc)? Thanks in advance for all suggestions!
     
  2. Budget? For hobby or is this a commercial project?


    Best regards,
    Spehro Pefhany
     
  3. Guest

    Spehro,

    Right now it's a pet project of mine that has the potential of turning
    into a commercial venture if successful. The budget is couple hundred
    dollars at most. Any ideas?
     
  4. That's not quite enough for your parts and the tools I'm personally
    familiar with, so I'll leave it to others for specific advice.

    I suggest you stick with assembly language and the free MPLAB
    development software, which you can download from Microchip. These are
    simple devices, your application is not complex, and your learning
    curve will probably be less if you don't have to wrestle with another
    level of software.

    You may wish to join the piclist. For hardware design, Art of
    Electronics is getting a bit long in the tooth (2nd edition) but
    should be more than sufficient for your purposes. You'll probably end
    up using at least one power MOSFET for the drive (maybe 4 in an
    H-bridge or maybe one and a reversing relay).

    Your project sounds very simple, and any of the 14-bit instruction
    PICs should be able to handle it. Maybe a 16F88 or something like that
    if there are enough pins.


    Best regards,
    Spehro Pefhany
     
  5. Guest

    There are application notes on the microchip site for driving small dc
    motors.
     
  6. Since the PIC aspect sounds incidental, you could try
    http://www.zilog.com/z8encoremc/index.html

    That's a working Motor Control system, [ PowerFETs and all ],
    with USB debug, C compiler, and Motor, all for $199 ?

    -jg
     
  7. Ian Bell

    Ian Bell Guest

    If you are familiar with the 68K you are going to find the PIC architecture
    and its assembler strange to say the least. You might be better to use a
    small Motorola 8 bitter like the HC11 for example..

    Ian
     
  8. Or simply use a high level language like C for the PIC.
    The Microchip 18series C compiler is essentially free these days.
    Or even easier - use a PIC-AXE chip, it has to be the easiest way to
    program a micro for such a task. Essentially zero up-front cost too.
    Silicon Chip mag have had plenty of PIC-AXE projects recently, and I
    think one or more of them have been motor control.

    Dave :)
     
  9. Rich Grise

    Rich Grise Guest

    Well, I see and
    a couple with prefixes like fj., sachsnet., and tnn.

    Basic on-off/back-and-forth motor control isn't very hard, but
    this one has been done to death, so to speak.

    Have Fun!
    Rich
     
  10. Jim

    Jim Guest

    Or... download the free C18 'C' compiler (for educational purposes), and use
    that. Then you can divorce yourself (not totally), from the PIC
    architecture. Of course this means using a PIC18 device. Overkill but hey,
    pet projects are about learning as well.
    Jim
    www.picmodules.com
     
  11. Advise to split up the problem first.
    One part is the motor and its driver electronics. Regardless of what micro
    you're going to use, you need a unit with two control lines: One on/off and
    one right/left. Keep in mind that a motor that runs on several amps may have
    tens of amps inrushcurrent. I'd want to have a complete and reliable unit
    before connecting it to a micro.

    Second are the sensors you spoke about. Are they digital or analog? How many
    of them do you need? The answers to this questions have major influence on
    the micro you need. Keep in mind that sensors almost always need some kind
    of adaption that varies from a single R to a full flesh bufferamplifier.
    Especially long lines can cath disturbances that may even blow a micros
    input pin.

    Knowing the above, the choice of a PIC will not be very difficult. The
    smallest (and cheapest) that suit your needs wil be the best. (So number of
    I/O-pins, AD-convertors and so on.) As your code does not seem to become
    very long, program space will hardly be an issue.

    You will need some tools to work with a PIC. If your time is expensive
    and/or time to market is an issue I'd buy a good (!=cheap) developmentsystem
    from Microchip. As you have experience in C a Hi-Tech compiler will be a
    good choice. On the other hand, if you're on a low budget, download the free
    MPASM development software from Microchip and find a simple programming tool
    on the net. A good intro and a programmer can be found on:
    http://www.voti.nl/swp/n_index.html
    But a little google will show you much more. As you have experience in
    assembler programming, you will meet little problems. The only thing you
    always need is the data sheet of the PIC at hand.

    One thing I wonder is the motor direction. If it has to change when a sensor
    is triggered, where does the initial direction comes from? Unless it's in
    the nature of the thing you want to control, IMHO toggling is a risky way of
    controlling.

    petrus bitbyter
     
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

-