Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« on: January 28, 2011, 01:08:32 pm » |
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
Online
Brattain Member
Karma: 270
Posts: 17051
Available for Design & Build services
|
 |
« Reply #1 on: January 28, 2011, 01:14:57 pm » |
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
|
|
|
|
|
SF Bay Area (USA)
Offline
Faraday Member
Karma: 80
Posts: 5513
Strongly opinionated, but not official!
|
 |
« Reply #2 on: January 28, 2011, 02:09:24 pm » |
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
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #3 on: January 28, 2011, 03:29:53 pm » |
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 
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
Global Moderator
Boston area, metrowest
Online
Brattain Member
Karma: 270
Posts: 17051
Available for Design & Build services
|
 |
« Reply #4 on: January 28, 2011, 03:49:29 pm » |
Maybe a bank of CD4059's will do the the trick then: http://focus.ti.com/lit/ds/symlink/cd4059a.pdfdivide 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.htmDepending on this goes into, a promini from gravitech might be the way to go also. http://yhst-27389313707334.stores.yahoo.net/arpromi5v.html
|
|
|
|
|
Logged
|
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #5 on: January 28, 2011, 04:05:54 pm » |
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
Faraday Member
Karma: 42
Posts: 5248
CMiYC
|
 |
« Reply #6 on: January 28, 2011, 04:12:38 pm » |
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
|
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #7 on: January 28, 2011, 04:37:08 pm » |
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
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #8 on: January 28, 2011, 04:52:37 pm » |
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!  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
Newbie
Karma: 3
Posts: 35
B.E.E. / B.Inf.Tech.
|
 |
« Reply #9 on: January 28, 2011, 09:54:59 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Leighton Buzzard, UK
Offline
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #10 on: January 29, 2011, 07:13:58 am » |
very likely d******d expensive though 
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
Port Angeles, Wa
Offline
Edison Member
Karma: 13
Posts: 1411
Ultimate DIY: Arduino
|
 |
« Reply #11 on: January 29, 2011, 11:15:59 am » |
To me... it sounds like you are talking about a 74192 or 193 (presettable up/down counter) http://www.datasheetcatalog.org/datasheet/motorola/SN74LS193.pdfIn 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
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #12 on: January 29, 2011, 12:18:07 pm » |
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
Full Member
Karma: 0
Posts: 107
Arduino rocks
|
 |
« Reply #13 on: January 30, 2011, 08:25:15 am » |
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
Edison Member
Karma: 11
Posts: 1049
|
 |
« Reply #14 on: January 30, 2011, 07:15:51 pm » |
Yup, that's probably the way I'll go Busy prototyping in software before I commit to metal Thanks all for the input
|
|
|
|
|
Logged
|
there are only 10 types of people them that understands binary and them that doesn't
|
|
|
|
|