Pages: [1]   Go Down
Author Topic: divider/counter chip  (Read 3437 times)
0 Members and 1 Guest are viewing this topic.
Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not quite sure what I'm looking for here

or rather I know what I want, but don't know what it's called or even if it exists

I want (stamps little feet) a chip that I can:
a) feed a clock signal into
b) feed an 8-bit number into

the chip counts until it reaches the 8-bit number then resets back to 0 and starts again

hope that's clear

please make me look stupid and tell me that a 74XX999 does it all in one package!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26442
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure - go to ww.ti.cm & search for counters  - they have parts that can be preloaded & then count from there.  Might have to count down from the # to 0.
CD40103 looks good - presettable 8-bit counter with an output that signals when 0 is reached.
« Last Edit: January 28, 2011, 01:20:10 pm by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6649
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you you want the OUTPUT of this chip to be?  And for that matter, how do you intend to "feed an 8bit number into" it ?
There are a large number of "presettable counters" implemented withing simple logic families (the CD40103 mentioned being a good example), BUT they 1) tend to be DOWN counters that count downward from the preset value.  2) The "reset" at zero may not be automatic; you may have to detect zero and reload the preset.  (ie the "load" command is separate from anything else, and the value is lost as counting begins.  To have the value RE-load, you at least need to have two copies of the loaded value; one that sticks around to be loaded next, and one that actually is present in the counter.)  There may or may not be a zero detect, though "wrap" (overflow/underflow) is pretty common.

These problems lead you to the more complicated "timer/counter" chips, the most famous probably being the 8254 used in the original IBMPC (and therefore copied (in some form) into every PC compatible ever since.  But these have microprocessor-bus oriented interfaces, so you probably don't have access to the count at intermediate stages, and "feed in a number" may be more complicated than you had in mind.

The internal timers in the Arduino's AVR chip can generally be programmed to behave as you request.  But they're all in use by the the arduino core functions for generating PWM and etc.  Depending on how fast you need it to count, using some other microcontroller is a possibility.  Counter/timer hardware is very common even in very low-end micros (say, those 6-pin PIC micros), and at lower clock speeds the whole thing can be done in software.   Even an arduino-class CPU is liable to cost less than the 8254 timer chip I mentioned...
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I must confess having looked at the chips available, that a software solution may be the way to go
thanks, btw to CrossRoads for the hint

count up or down isn't an issue
maybe better expressed (now I have seen some chips) that divide-by-n is what I want, but n to be software configurable
happy to feed in "n" however it needs, but not every n cock ticks, please!

I want to be able to pass in a clock and get a transition after n clock cycles
count up or down kinda doesn't matter
but having to keep reloading might be

to confuse the plot I want to have three or four of these on the go at any one time, with different "n" values for each

I may well go down the route of a second ATmega chip to do the work
off to do some test timings

smiley
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26442
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe a bank of CD4059's will do the the trick then:
http://focus.ti.com/lit/ds/symlink/cd4059a.pdf
divide by 4 to 15,999.
Maybe with a 16 bit shift register in front of them to load them up from a couple of arduino pins.
Or just hardware the inputs hi/lo if the divide-by won't change.
You haven't said how fast of clock, so unknown if an arduino could do it.
Course, buy 4 of these from digikey and now you've spent more than the cost of an arduino clone
http://shop.amcnano.com/Narduino-Arduino-clone-SKU2003.htm
Depending on this goes into, a promini from gravitech might be the way to go also.
http://yhst-27389313707334.stores.yahoo.net/arpromi5v.html
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

that's my thinking
get 4 of them and you're close to the cost of an xxxduino!
and software is soooooooo much easier to wire up (and change later!)
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6132
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Not sure what level of effort you are looking into, but you might consider a CPLD.  You can "program" the device to be whatever counter you want.  If you aren't familiar with PLDs, there will be a learning curve.  However you can design the exact divider you are looking for.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm there's a thought!

standby caller...
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just ran a loop test

looks like I can achieve better than 62 KHz with 6 "divide-by-n" counters and some fringe processing
that will do nicely! smiley

Looked at  CPLDs - as you say - bit of a learning curve - :gulp:
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Brisbane, Australia
Offline Offline
Newbie
*
Karma: 6
Posts: 36
B.E.E. / B.Inf.Tech.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

FPGA's are the future. I used a Digilent Nexys quite a bit:
http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,400,789&Prod=NEXYS2

-Igor
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

very likely
d******d expensive though
smiley
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1643
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

To me... it sounds like you are talking about a 74192 or 193 (presettable up/down counter)

http://www.datasheetcatalog.org/datasheet/motorola/SN74LS193.pdf

In the 80's, I made a COUNTDOWN DARKROOM TIMER with these that you could preset to the number of seconds you wanted the enlarger light to be on.  (Preset using BCD thumwheel switches)
« Last Edit: January 29, 2011, 11:18:18 am by pwillard » Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

looks a bit more likely!
not overly expensive
need to tie a couple together to get 8 bit but that's doable

thanks for the sterr!
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

0
Offline Offline
Full Member
***
Karma: 0
Posts: 107
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I agree with Pwillard.

You could use one or two 74ls193 4 bit up down counters and use the 74154 as a de-multiplexer.  A few NAND Gates (7400) to toggle which one is counting and thats that.
Logged

Leighton Buzzard, UK
Offline Offline
Edison Member
*
Karma: 21
Posts: 1339
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yup, that's probably the way I'll go
Busy prototyping in software before I commit to metal
Thanks all for the input smiley
Logged

there are only 10 types of people
them that understands binary
and them that doesn't

Pages: [1]   Go Up
Jump to: