Connect with us

Micro Progamming help-CLARIFICATION

Discussion in 'Electronic Design' started by Kim, Nov 15, 2004.

Scroll to continue with content
  1. Kim

    Kim Guest

    As I was not terribly clear in my original post, and several good questions
    have come up, I will attempt to clarify. A copy of the original posting is
    at the end of all of this, just in case the thread disappears.

    -Again, I must stress that this is a counter, not a timer. Often describing
    a specialized function is the hardest part of a job. This is a counter, not
    a timer, at all. just consider this a counter that happens to count by 5's,
    until it gets to 60, then it places a prefix of 1 ahead of the 5 count,
    until it counts to 60 again, then it prefixes the count by 2....and so on.
    So if you drop the idea of seconds, minutes, hours etc, it may be easier to

    -It can display the numbers any way that is practical, with the available
    display, that is also easy to understand.
    It can display as XXsec,XXmin, XXhrs,XXdays,XXmonths,XXyears...or
    alternately it can display by XXsec...blank...Then XXmin...blank....etc.

    -The display can blank after displaying the current count once a new count
    is triggered.

    -I would like it to be as small as possible, but be made out of "off the
    shelf" components.

    -I would prefer that the count be held if the batteries were changed, but if
    this is not possible, then forget it.

    -I would prefer it be battery operated for at least a few months, if
    possible. If this requires larger batteries, then so be it.

    I don't have enough experience, or common sense to complete this project, so
    I need some help, and finally realised that I will have to pay for someone
    else to do it for me. I'll list the basic requirements, but Email me for
    specifics for the job, or if you are willing to take it on, along with a
    price quote. As well, if you think that the project is impossible, then also
    let me know. There is no real time constraints, so if you only do it in
    your spare time, and it takes a long time to do, that will also be ok.

    I require a circuit that will:
    -display in 5 second increments, every time a switch is closed, on a basic 1
    line lcd display (it wont actually be a 5 second increment in reality, this
    is count, not a time, but the count has to be in 5 second increments)
    -add up these 5 second increments, until they "rollover" into minutes, hours
    days months, years.
    -be battery operated (If it could be run for long periods of time on button
    cells, or equivalent batteries, then that would be great, if not... a few
    AAA cells, or a 9v batteries size is ok).
    -the display only needs to turn on for a minute after the switch is closed,
    if this will help extend the battery life.
    -and be as small, and thin as possible (space is at a ABSOLUTE premium)
    -the unit can be hard-wired or wire-wrapped, it doesn't need to look
    "finished", or be done on a pcb.
    -as a matter of fact, if I can be supplied with a chip, display, and
    schematic, I can wire it myself.

    IF there is a way to do this with a small, single chip
    microcontroller....fairly easily, please let me know.
    If you require more specifics, please email me with any questions you may
    have. This is NOT going into mass production, so I WILL NOT be making
    buckets of cash with this. This is just a item for a specific piece of
    machinery at my work, and will DEFINATLY be a one-off.

    Thanks, in advance
  2. Ken Smith

    Ken Smith Guest

    So it counts: 000, 005, 010, 015 ... 055, 100, 101


    You want to make this out of just chips you can buy easily off the shelf.

    If you make a counter for each digit, you can connect a BCD to 7 segment
    decoder to it and drive a 7 segment LED display or better yet if you find
    the right one, a 7 segment LCD.

    The bottom digit can be just a simple flip-flop like a 74HC74. It only
    has to remember if it is "5" or "0" so there are just 2 states.

    The next digit counts up to 5 and the starts over at zero. There are
    several counter chips that have a parallel load function that will cause
    the counter to load in a value on the next clock. If you use a logic gate
    to decode the fact that the digit is 5, you have the signal needed to
    cause it to load and also the signal to tell the next stage to count up by

    The other digits divide by 10 until we get up to the 24 hours. These
    digits can be done with simple decimal counter chips.

    23 hours is decoded with logic gates and causes the hour of the day
    counters to be reloaded.

    Now you have to include some more information. Are these months normal
    Jan, Feb etc or can they just be 30 days each?

    If you use 74HC parts, you can include a "super cap" in the power circuit.
    Even just a normal large value capacitor would give you enough time to
    take out one battery and put in another. The "super cap" would give you
    hours. If we assume at least 8V from the battery.

    ------ D3
    Vin ---+--!LM7805!----+-------->|---------- To display chips
    ! ------ !
    --- ! +-------->|---+------ To counter chips
    --- V D1 ! D2 !
    ! --- --- \
    GND ! --- / 100R
    GND ! \
    GND !
    --- Supercap

    D1 causes the LM7805 to regulate at 5V + one diode drop.

    D2 powers the counter normally and prevents the Supercap from trying to
    run the display.

    D3 just makes the drops equal.
  3. Kim

    Kim Guest

    Actually, it would count 5s, 10s, 15s, 20s, 25s, 30s, 35s, 40s, 45s,
    50s,55s, 1m, 1m5sec,1m10s........1m,55s,
  4. hamilton

    hamilton Guest

    OK, its better understood what you want.

    So the next question that all the gear heads here want to know:

    Are you looking for a bid on this project, or are you looking
    for an off-the-shelf solution that can do this with minimum effort
    on your part.

    I am sure 100s of "Midnight Engineers" (C) on the list can do this type
    of thing. I am sure there will be at least 50 ways of getting it done.

    I am sure my way can get it done as well as the next guys.

    As has been posted in another thread, how much do you want to spend
    to get this done ?

    Do you want just one unit ?
    Do you want 10 units ?
    Do you want xxx units ?

    The cost of ten is almost the same as one.
    Engineering costs time and money, the more you make the cheaper each
    unit will cost. ( everyone in this group knows this )

    Again, as has been posted in another thread, I am sure you can figure
    this out for yourself. How soon do you need (want) this built ?
    If you have no clue, it may take a while.
    If you have money, it can be done in a few weeks.

    So, Kim, what do you want to do ?

    hamilton AT dimensional DOT com
  5. Kim

    Kim Guest

    Well, as nobody has offered up a hard quote... its hard to say.
    I realise that the engineering is the lions share of the project, and that
    requires a great deal of experience, and in ANY field, a great deal of
    experience costs money.
    Its not so much the effort that has made me assume that this is "outta my
    league", its the thought that it would probably require a pic , or other
    type of programmable chip, that I am simply not set up to deal with, and
    have absolutely no experience with, either in construction, or especially in
    I only need 1 unit, with another programmed controller, and display as a
    backup, if somehow I manage to kill the first during my ham fisted
    construction (assuming that I would construct it). Time is not a factor, as
    I do not require this immediately.
    Obviously, a very high price quote will kill off this project in a hurry,
    which is why I've tried to stress the "off the shelf" parts, and the lack of
    time constraints would help bring down the costs, if even only slightly.
    All I can say is "here are the specs"...I wont be making ANY money on this,
    now its up to the individuals out there to tell me what they will charge,
    and if they think a project of this type would interest them personally.
  6. Tim Wescott

    Tim Wescott Guest

    What happens right after 23h 59m 55s? Do you want to count days? Do
    you expect to?

    BTW: Will you be needing a reset?
  7. Tim Wescott

    Tim Wescott Guest

    This can all be done with a microprocessor, for much less (precious)
    board space than 7400 logic -- although the logic would certainly serve.
    Since it's battery powered one would want to see if there were a
    microprocessor out there that'd operate over a wide Vdd range and think
    of using just two or three cells and no regulator.
  8. And here I had figured:

    000, 005, 010, 015 ... 055, 100, 105 <---

    I must have missed something he said... ;)

    Anyway, sure is strange to run that last digit as only a 5 or 0. Could just be
    a light that goes on and off, I suppose. ("It can display the numbers any way
    that is practical, with the available display, that is also easy to
    I think the LCD will have to be the ticket if he's to work towards the "months"
    of operation by battery he'd like to have.
    I don't know. When thinking about months of operation and the earlier thought
    about "could be run for long periods of time on button cells" I start thinking
    about an all-2.7V-to-3.0V system, no regulator, LCD display, etc.

    Take a CR2025 (commonly available, thicker version, and easier to find than the
    CR2032) as a reference here. We'll call it 140mAh (conservative) at 2.85V
    (internal resistance has risen to 5X the starting resistance at this point and
    is rising steeply at this point.) At 140mAh and, say, 60 days of operation (on
    the very short end of "at least a few months"), we get 140mAh/(60*24) = 97uA --
    call it 100uA continuous. I'd tend to want to go for about 50uA as the average

    Of course, if you were to think of using a higher voltage source and adding in
    an LM7805, keep in mind that the quiescent current for it is as much as 8mA.
    Not something I start thinking about when I'm also thinking of months of
    operation on tiny batteries.

  9. hamilton

    hamilton Guest

    Thank you for your response.

    Lets say that this project is properly documented. ( so far its a good
    start, but only a start)

    If a reasonable engineer would accept this project, what would the costs be.

    We will ignore the cost of the parts for the moment.

    Lets say the total project would take, Hmmm 40 hours.

    At what price would be 40 hours.
    $ 5.00/hour = $200
    $10.00/hour = $400
    $12.50/hour = $500

    You get the idea.

    If someone says they can do it 20 hours, the cost per hour would be
    higher for the better engineer. So it will still be hundreds of dollars.

    So, where does that leave you.

    You are correct that it can (should) be done with a single chip micro.

    Pick one !!

    OK, you said PIC, pick one.

    Study it until you think you understand how you would use this PIC for
    this project. Please ask questions here about anything you find confusing.

    But understand, now one is going to hand you a complete project.

    The two things that will need to be done is understand the hardware and
    understand the software.

    The discussion so far has been around the functions of the counter.
    Thats good, but thats software. The hardware discussion has been around
    long battery life and a LCD display.

    To help get you started, I would suggest that you use a ATMEL AVR
    Butterfly Evaluation Kit.
    Includes an LCD display and will run a long time on a coin cell.
    ( you can build your own package )

    Its available from Digikey for only $19.99.

    This is a good starting point for learning microprocessors.

    TI also makes evaluation kits for little money, so you can learn.
    The TI kits include an LCD display and runs of a coin cell.
    Check ti TI site for MSP430 evaluation boards.

    Good luck, we will help you in any way we can.

  10. Tim Wescott

    Tim Wescott Guest

    hamilton wrote:

    -- snip --
    Have you checked engineering salaries in the last 50 years? I think
    you're off by a decimal point.
    This is a good example of the hypothetical eval board I mentioned
    earlier -- assuming the LCD is sufficient it has everything you need.
  11. Leon Heller

    Leon Heller Guest

    I quoted 200 GBP for this (about $350), using the TI MSP430 Day 'watch'
    which I have lying around, which seems quite fair.

  12. Very fair.

  13. Guy Macon

    Guy Macon Guest

    If anyone had, you would have been advised to run away from that
    person. Nobody here would dream of giving a quote without nailing
    down the definition of what you want first.
    I really do think that you can do the programming yourself with
    a Basic Stamp. (forget what I said about them when I thought you
    needed precision timekeeping). The are *really* easy to program,
    the book explain everything, and there are experts hanging out at who will help you at no charge.
    I really think you should give it a try.

    I suggest these products:
    9V battery to power it all. (battery will last a long
    time if the unit spends most of it's time in sleep mode)
  14. Guy Macon

    Guy Macon Guest

    The CR2032 is thicker.
  15. Guy Macon

    Guy Macon Guest

    That's a good price, and Leon certainly appears to be well-qualified
    judging from his posts.
  16. hamilton

    hamilton Guest

    Hi Tim,

    Yes, you are very correct. The cost of an engineer is much higher. I
    just did not want to cause a heart attack ;-).

    The Atmel kit was only a point of discussion, I have used it a few
    times so I could help Kim get started.


    PS: Yes ~$350 sounds like a very fair price for this project. But I am
    sure Kim will want to do it himself.
  17. Leon Heller

    Leon Heller Guest

    I quoted that because there isn't a great deal of work if I use the MSP430
    watch. TI has the time and date routines in their application literature, so
    it's mainly a question of putting them together and modifying the existing
    display code slightly. There is no hardware development required.

  18. Yes, I know that. I just phrased my English very poorly to express it.

  19. Ken Smith

    Ken Smith Guest

    Yes but if it is a PIC, someone has to program it.

    BTW: A PIC will work over a wide enough range for 3 AA cells to power it.
    The issue then is the display current if you want to have the capacitor
    hold the count while the batteries are changed.
  20. Tim Wescott

    Tim Wescott Guest

    Yea, I'm assuming programming no matter what.

    Assuming 3AA cells and a series schottkey (who's drop I'd have to check
    to see if the PIC could handle) a clever programmer could turn off the
    display driver in the event of battery loss.
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