Searching for a suitable microcontroller

Discussion in 'Embedded Systems and Microcontrollers' started by Spek, Sep 10, 2009.

  1. Spek

    Thread Starter Member

    Feb 6, 2009

    Can someone help me with choosing the right Microcontroller? I'm not really familiar with hardware-specs so I'm afraid of picking the wrong one.

    I have a pharmaceutical machine that produces tablets through 2 'tables' with 37 'punches'. For each punch, I'd like to know the pressure. For each table I have 1 pressure signal that continously changes like a sinus graph. As soon as the pressure is out of range for 1 or more punches, the machine stops or opens a disposal mechanism. Anyway, I already made the whole thing on a PLC, but the pressure readings are not really that precise. Most probably due the high speed of the machine, an analog reading that only refreshes per 2 milliseconds, and all the other functions the PLC has to perform. What I did (for each set of 37 punches):
    - A timed interrupt reads the analog reading each time when it has been refreshed. It stores the highest(peak) reading
    - 1 (high-speed) pulse triggers an interrupt when a new punch approaches. This resets the peak to 0.
    - 1 (high-speed) pulse triggers another interrupt when the punch passed and stores the peak for the punch, checks it for errors, and increases the punch counter. (so I end up with an array of peak values).
    - Each 360 degrees a third (not high speed) pulse resets the counter to 0
    - Average pressure is calculated for each set over all its 37 punch readings

    It works, but as said, it could be better. Instead of using that PLC, I was thinking about a seperate module that focusses only on the tasks mentioned above. The results would be send as an array to the PLC via CANbus or Serial port. Errors would be send by a digital output. Now the big question is, what Microcontroller (or something else) would meet my requirements:

    - 2 analog inputs 0..10V 10 bits or higher, high refresh rate (less than 1 ms s'íl vous plait)
    - 4 high-speed digital inputs that can generate an interrupt
    - 2 digital inputs
    - 2 digital outputs
    - Optional: 2 analog outputs for the average pressure
    - Serial communication with the PLC for sending results (1 or 2 times per second) + receiving some parameters. CANbus is ok as well.
    - No EEPROM, additional Flash, LCD, Timers or other luxery needed
    - 16 bit would be enough. No floating points required.
    - Environment: dry, normal temperature, lots of dust, quite alot vibration
    - Program and RAM requirements would be pretty low, although I don't know the overhead of Serial/CAN communication
    - A relative low price (including development tools/software)

    I'm looking at

    where you can give all kinds of parameters to find your 'perfect' microcontroller. But I don't know what kinds of speed, RAM, memory or program sizes I would need to meet my requirements. For example, what does a CAN connection cost? Or reading those two analog inputs as fast as possible? I have some programming experience with microcontrollers
    from the past, but I'm not familiar with the hardware specs.

  2. Spek

    Thread Starter Member

    Feb 6, 2009
    I'll add it to the "list of candidates". I programmed a PIC18 with MPLAB IDE in the past, so that's a plus. I think the specs you mentioned are way more than I actually need though, so are there big pricing differences? I have no clue what all this stuff costs... And the simpler, the better of course. It's a very specific/small task it has to perform.

    Neither do I know what I actually need. I mean, that Pic18 F2550, is that just the chip itself or does it come on a board with all the connectors (plug and play)? Sorry for the stupid question, but ussually I only do the programming part, certainly not the hardware!

    From what I remember (6 years ago), I would need MPLab and a programmer module; a flat disk shaped USB thingie between the computer and the controller. MPLab is free I believe, but what does the average PIC+all other requirements/programmer tools cost?

    Thanks for your tip!
  3. Spek

    Thread Starter Member

    Feb 6, 2009
    Allright, I can see that the PIC chips are ussually sold has seperate components. The only problem is that I have 2 left hands. Although I'd love to play with it, I just need to build this pressure reading component for work, and unfortunately we don't have someone here with printboard/chip experience.

    So what I'm looking for is a complete board. I can find alot of Starter kits, but I'm not sure the requirements from my first post are met there. The amount to choose from is overwhelming. So, in short, looking for:
    - 2 analog in(asap) 10 bit
    - 4 high-speed digital in, 4 on-pulse-interrupts connected to them
    - 2 other digital ins, if possible also with interrupt on high speed
    - a timed interrupt to read the analog readings asap (0.5 ms or faster if possible...)
    - Communication through RS232 or something
    - Programmable via C or another higher level language
    - Board / connectors / programming port / eventually housing
    - Low cost :)
  4. Dragonblight

    Active Member

    Aug 19, 2009
    if you want to go the pre-fab'd way of life, you could always go with a basic board or one of them thar fancy "arduno"s. People do crazy stuff with their ardunos, (I know i'm spelling it wrong, there's an I in there somewhere). They're fairly expensive, but it should satisfy all your requirements from what I know about them.
  5. vikramgholap

    New Member

    Sep 10, 2009
    I would suggest for ST Microcontroller STM32 series. It has ADC DMA enabled that means your core need not be engaged to read ADC also there are other good features w.r.t. timings
  6. Spek

    Thread Starter Member

    Feb 6, 2009
    Thanks for your replies. I think I found a good platform with the Arduino Mega. I'm surprised by the prices. I guess normally you would buy these chips/boards for mass production, but I only need 1 (or 2 as a backup). My alternative is a PLC system that will cost ~2000 euro (including its software license). 60$ or 2000 euro, I think I made up my mind :)
  7. hgmjr

    Retired Moderator

    Jan 28, 2005
    Be sure to look into downloading the free assembly language Integrated Development Environment AVRSTUDIO4 from and the free C-language compiler add-in to WINAVR from