Connect with us

PIC or Freescale HC08 ??

Discussion in 'Electronic Design' started by Guest, Mar 27, 2006.

Scroll to continue with content
  1. Guest

    Guest Guest

    Hi Group:
    I've got a project that I'm contemplating that needs:

    To read a keypad with 20 switches.
    Control 7 digits of 7 seven segment displays.
    Generate pulses for a small stepper motor. (full step and micro step)
    Possible control of a brushless servo motor with encoder feedback.
    Monitor a few simple sensors.
    A few hundred bytes of RAM is enough.
    Program size with lookup tables ect, should be under 4-6K.
    Flash would be nice.

    I've never worked with the PIC and looking at their product line up there's
    just too many to chose from.
    I have worked with the Motorola stuff (HC05) but they are not making anymore
    HC05 parts.
    My question is, What PIC would you use to do the above. Or maybe use several
    PIC's to get the job done?
    Or would you just go for one of the bigger HC08's?

    Thanks!
    Any input appreciated.

    RonL
     
  2. Flash is essential these days!
    Anything else is a pain and not worth touching.
    One PIC is plenty, unless you have a compelling reason to separate
    tasks.
    A basic decent size PIC is the 16F877, so I'd look at that to start
    with.

    Is this a small or high volume thing?, does cost or board size matter?,
    how many pins do you need? (is the keypad and LED display MUXed?)
    The PIC is no less powerful than the HC08, or any other 8bit micro for
    that matter really.

    C is the go, forget assembler unless you really really want to.
    I've heard the Microchip 18series C compiler is essentially free now
    but with very minor limitations, so maybe use a newer 18series PIC?

    Dave :)
     
  3. MicroStepping, is quite a complex thing in itself. You need to generate
    sinusoidal drives, to two different power drive branches. Now there are
    several PICs that can do this, but you would end up using both PWM outputs
    (most PICs have 2*PWM), which then leaves you without PWM's for the servo
    control application.
    I suspect I'd probably look at the Allegro A3977 to drive the stepper,
    which removes the need for seperate power FETs, clamp diodes etc.. This
    then leaves the PWM outputs available for servo control.
    These days, flash is cheaper, an simpler for any limited size production
    run, and is 'standard' on most parts.
    Now there is the question of 'what interface' for the 'sensors'. Mst PICs
    will offer ADC's, I2C. SPI, and sync/asynch serial.
    Depending on the number of 'encoder counts' for the servo motor, and the
    rotational speed, there are some PICs with encoder inputs, which would
    allow handling at very high speeds, while most PICs could handle lower
    rates, using the 'interrupt on change' ability.
    The LED drives, and keypad scanning, are just down to number of pins. You
    need 7 bits to control the segments (possibly 8, if you have a decimal
    point?), and three bits (using a 3-8 line decoder) to address the digits
    (or 7 bits for direct drive). On the keypad, 4*5 lines.
    So assuming you use the Allegro chip, say 11 bits for the LEDs, 9 bits for
    the keypad, 2 bits for the stepper (step/dirn), 3 bits for an H-bridge for
    the servo (a PWM output, and two control bits), 2 bits for the quadrature
    inputs, and leave perhaps 6 bits for the 'sensors'. This puts you as
    needing a minimum of 33 I/O lines.
    I'd probably look at the PIC18F4331, or 4431. The 'F' means 'flash'. These
    chips are 40 pin DIP packages, with 36 I/O lines, including up to 9 ADC
    inputs (or eight, if you use an external reference voltage). They have a
    quadrature encoder built in, and 2 PWM outputs. 768 bytes of RAM,
    4096/8192 'words' of program memory respectively, 256 bytes of EEPROM,
    UART, SPI, & I2C.

    Best Wishes
     
  4. Guest

    I've been using the OTP eprom PICs for a long time, but now I have to
    upgrade to a FLASH version, propbably the 16F877. I've read conflicting
    reports about the relative slowness of programming FLASH devices. A 2K
    OTP part such as the 16C57C takes only 3 or 4 seconds using the
    parallel programming algorithm.

    Question: Using in circuit serial programming, how long does it take to
    program a FLASH device such as the 16F877A?

    Thanks,
    Joe Legris
     
  5. Ron,

    Most important constraint seems to become pincount. Your keypad and display
    will require 23 pins. As a common 40 pins (8 bits) micro has only 36 IO-pins
    you may not have enough pins left to meet your requirements. IMHO you hve
    several options:
    - Bigger micro (more IO-pins, 16 bit type)
    - Extra electronics to reduce the number of IO-pins required (for instance
    external registers/buffers and decoders to handle the displays)
    - Extra micro. Same as above. A 20/24 pins micro can handle the display and
    communicate with its master using only 2 IO-pins.

    petrus bitbyter
     
  6. The HC08 is the flash-based replacement for the HC05 in Freescale's
    lineup, though they have recently announced a stripped version
    HC08/5/4 for really cost-sensitive consumer applications. I forget
    what they call it, but it's probably not of interest to you anyway.
    The 08s are nice parts.
    The core micro is not so important except how it might fit with your
    experience and tools. If you're used to the 05, you'll probably find
    the PIC rather irritating, especially the lower-end ones. Unless
    you're very cost-constrained start with the 18f, 24f or dspic series.

    Is the potential BLDC motor/tachometer input (quadrature input?)
    concurrent with the stepper or 'instead of'?

    You've got a number of fine-time resolution things going on at once
    that can only tolerate a limited amount of jitter or delay in reading
    them. That will determine the hardware you need. I see no reason to go
    to multiple processors or expensive controller chips, it can all be
    done with a single processor. Sounds like you need 4 or 5
    timer-counter capture compare modules, which should simplify your
    search. If you need quadrature input, that will further limit things
    or you might choose to use some external logic there.



    Best regards,
    Spehro Pefhany
     
  7. A 4K (words) 16F88 takes about 8 seconds to program and verify the
    entire flash area. A 2K 16F628 takes about 6 seconds total using my
    PICALL programmer.
     
  8. Guest

    In my experience my code typically gets programmed in under 10 seconds.
    Yes, some consider that to be slow but it is still much faster than
    Windows booting up or "burning" your firmware onto floppy disks
    (believe it or not our PC104 embedded controllers still use them to
    install/upgrade software).
     
  9. Guest

    Guest Guest

    Thanks all
    This gives me a direction to work toward.

    RonL
     
  10. But very easy to reduce -
    7x7 segs = 14 pins, plus 3 columns for the keypad sharing either the display commons or segments (
    with a few diodes or resistors) = 17 pins.

    Use an external HC138 and you're down to 13.
     
  11. Tim Wescott

    Tim Wescott Guest

    Consider also the AVR series from Atmel, and any one of the bazillion
    8051 derivatives out there.

    To wade through the mess of different chip styles you can do what I do:

    - list your requirements in terms of I/O pins, PMW outputs, ADC inputs
    (if you need it) and whatever else you need
    - sort through your list of microprocessors to get viable candidates
    - choose one based on price, your attitude toward the vendor, and any
    other 'soft' considerations you may have. I always look for a
    pin-compatible upgrade, unless I know that what I've chosen is severe
    overkill (in case I look for a lower-price pin-compatible 'downgrade').

    --

    Tim Wescott
    Wescott Design Services
    http://www.wescottdesign.com

    Posting from Google? See http://cfaj.freeshell.org/google/
     
  12. Nico Coesel

    Nico Coesel Guest

    Did you consider TI's MSP430 series? This has flash, is programmable
    from the serial port by connecting DTR and RTS and it is loaded with
    I/O. One of the advantages is that is has a flat memory model and it
    is fast. This makes it very easy to program in C. A free compiler is
    also available (mspgcc).
     
  13. Nah. Shared lines mean 18 pins max, with no external logic. Might be
    possible to do it with 11, depending, still with no external logic.
    There are plenty enough 8-bit micros (as well as 16 and 32-bit) in 64,
    80 and 100 pin packages.


    Best regards,
    Spehro Pefhany
     
  14. Didn't think about sharing but I should have. Besides, according to Spehro,
    there are enough 8 bits micro's with over 40 pins.

    petrus bitbyter
     

  15. I should have known. Answered little bit too quick :)

    petrus bitbyter
     
  16. Steve

    Steve Guest


    You might want to look at the PIC18F6410 which I'm designing into a
    PWM design I'm doing at the moment. Amongst other things it's got 3
    PWM output ports and 64pins. It's SMT, and I plan to program it in
    circuit using an ICD2 clone from Sparkfun:

    http://www.sparkfun.com/commerce/product_info.php?products_id=5

    The device is supported by the Microchip development tools MPLAB and C
    compiler C18, you can download both FOC. MPLAB apparently recognises
    this programmer. Some optimisation limitations come in at 60 days,
    allegedly may not matter much.

    Steve
     
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

-