NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Project Help and Ideas » A small diagnostics helper...
September 16, 2009 by rusirius |
I do some repair work for a local company... Mostly what I get in are various boards from some "chick counters" they have. Basically after chicks are hatched, each one after being sexed is sent down a chute where they pass through one of these counters... The counters aside from keeping track of the chicks, evens them out by placing 50 in the front of a box and 50 in the back... And of course making sure that each box contains exactly 100... Since these things fail pretty frequently, and they were originally made by a company in France that's no longer around to support them, I get a lot of them to diagnose/repair... One of the things that's helpful when diagnosing a problem is seeing exactly what it's current count is while it's running through a cycle... I've been meaning to whip together a couple 4511s (7-seg decoder) with displays to attach while looking at one, but was never really motivated enough to do it, so generally I've just always ended up looking at each pin and doing the add-up in my head... Rather annoying for certain problems... Anyway... Since I got the kit a couple days ago (been wanting to get into microcontrollers for a while now and just never took the plunge) I figured I needed a "real" problem to address in attempting my first project... So I figured why not... Eventually I'll probably tie in a few more things that might make diagnosing even easier yet, but for now this will be a tremendous help... In fact, I think I'm gonna fire up eagle and lay out a permanent version... Just because... ;) So with all that said... Here's the synopsis followed by the code... The project is simple at this point and I've commented the code pretty well, so it should be pretty easy to follow along... Nothing complex in there at all, but of course if you have any questions feel free to ask... Or suggestions for that matter! It simply takes the 4 bits from a decimal counter that represents the 1's place of the count and and loads them up into an int. Then it does the same with the 4 bits from the 10's place (okay, technically also the 100's place at the moment the count rolls... ;)... Then it displays the current count on the LCD as well as the serial port... Code follows:
|
---|
Please log in to post a reply.
Did you know that you can impress a loved one with a digitally-controlled Valentine's Day Card with randomly twinkling LEDs? Learn more...
|