Monday, October 28, 2013

An AVR ATmega configurable production line counter

Updated to version 01b

This project here is a production line counter build on an ATmega 8 micro.



It has 4 digit seven segment display.
It can count from 1 to 9999 pieces.
(01b) Input can be delayed, so that every input recived will block the counter for an amount of time, to prevent double reading on too sensitive item sensors.

User can program it to emit an alarm when a number of items is reached.

Also a plus and minus button are present to adjust items count, if something has to be changed manually.
Holding the select button for a while make the counter reset.

To enter programming mode the select button have to be pressed while the device startup.

Setup parameters are contained in main.h, key.h and sevseg.h

This library was developed on Eclipse, built with avr-gcc on Atmega8 @ 8MHz.


Changelog
  • 01b: added the input delay capability
  • 01: first release


Code

Notes
  • read risk disclaimer
  • excuse my bad english

36 comments:

  1. Ebay search for character LCDs. They're as cheap as $3 - perhaps less than your 4x7-segment. Fewer wires too!
    http://www.ebay.com/sch/hd44780
    http://www.swharden.com/blog/2011-07-24-frequency-counter-gen2/

    ReplyDelete
    Replies
    1. led display deserve here to make counter more visible.
      of course you could adapt this code to any output you want :)

      Delete
  2. ...nm, I see on your G+ you've done this :)

    ReplyDelete
  3. Sir, can you send me hex file? I want build this project. Thanks

    ReplyDelete
    Replies
    1. Hello,
      yes, just send me your email address.

      Delete
    2. Thanks sir, this is my email.
      ulywae@gmail.com

      Delete
  4. Excute me,I can't compile this project source.can you send .hex file for me?
    wisitunlimitedjib@gmail.com is my email.Thank you so much.

    ReplyDelete
  5. Excute me,I can't compile this project source.can you send .hex file for me?
    saifudinho@gmail.com tanks

    ReplyDelete
  6. when I make you this product . I have trouble on the select button does not work when it is appropriate skema . please give solution

    ReplyDelete
    Replies
    1. I suppose it should be something to do with the ADC raw value read. You can enabled the BUTTON_TEST def, read the output on the sev segment display, and then set BUTTON_ADCUP, BUTTON_ADCDOWN, BUTTON_ADCSELECT according to that.

      Delete

    2. I do not understand . I give you my compiler link . will learn from your source . bicause i loking avrr gcc i not found . my you have link for me

      Delete
    3. Hello. If you give me your mail i can send you my compiled hex.

      Delete
    4. Saifudinho@gmail.com

      This my email sir

      Delete
    5. Sam sir.the buton select does not work.

      Delete
    6. Double check your wiring. It should be a wiring issue, or a ADC threshold value issue. To solve this, you have to debug it. Try to perform steps that i write down in my "March 24, 2016 at 7:55 PM" comment, what's the UART output for that test?

      Delete
    7. Sam sir.the buton select does not work.

      Delete
    8. I'm sorry but debugging from post comments it's difficult. You have to test it using at least an UART debug technique.

      Delete
    9. This comment has been removed by the author.

      Delete
  7. Great project which I was looking for, thanx for sharing

    ReplyDelete
  8. Davide, can't compile as well, I saw You sent hex files, may I got too? waldemar.beben@gmail.com
    May You modify displays to LCD? It's so easy for You. I'm sure, still black magic for me :)
    Also increase max value and implement reset port ?
    I just began my experience with ATMega processors, as I'm from times when TV were bulbs b/w and frst computer which I saw was ZX 80 with softwares saved into cassette tapes :)
    I have some experience with eproms, I like to learn more with flash technology
    Cheers :)

    ReplyDelete
    Replies
    1. Hello. You've got the hex in mail. It will be fairly easy to use an LCD instead of the seven segment, and to increase the intervall. You have just to add an LCD library. There are a few for ATmega. I like the Peter Fleury one. It's useless if i do it for you, here the matter is to learn.

      Delete
    2. Thank You Davide, yes, at that moment I'm still fighting with WinAVR, I would like to compile myself. Makefile is fine but still Process Exit Code: 2 :)

      Delete
    3. This comment has been removed by the author.

      Delete
    4. I've read from your post below you have finally make it works. I'm happy to hear this :)

      Delete
  9. Finally I built and all works great, many thanks Davide, for project, software and hex file :) Atmega8 programed by MkAvrCalculator http://www.atnel.pl/download.php?programy/SoftPack_ATB.zip and STK 200 which I built :) Cheers

    ReplyDelete
  10. Sir please send me hex file 01b, my email ulywae@gmail.com thanks

    ReplyDelete
  11. Sir, can you send me hex file? I want build this project?
    I am interested in the whole project as a teaching me.

    ReplyDelete
    Replies
    1. Hello, just tell me your email, i will reply you back with the hex.

      Delete
  12. ok thank you for your kindness, my email is ufyded27@gmail.com

    ReplyDelete