Divide By N - IC suggestion.

Thread Starter

MrJojo

Joined Jan 23, 2013
45
Hey all,

I'm looking to make a divide by N circuit. I really don't know what chip I should be looking at. I'd prefer something with a fast response time, this divide by N will go onto a trigger to another circuit.

I was thinking something along the lines of an up/down counter. I currently have an SN74AS867 at my disposal - http://www.ti.com/lit/ds/symlink/sn74as867.pdf. My thought is to set the input to a set binary number - say 250 - and then count up. Tell the chip to count up and once the counter gets to 255, use the /RCO to load in the 250 and then use an inverter to invert the /RCO to use that as my actual trigger.

I drew a quick schematic of what I'm thinking. It will be programmable via DIP switches and pull up resistors.

Would there be a better/faster way for me to achieve the divide by n?

Thanks,
Matt
 

Attachments

Thread Starter

MrJojo

Joined Jan 23, 2013
45
For something like this, will I need to follow the "Clear, Load Preset, Count" flow, or can I just do load preset and count up?

Also, how does this exactly work? I ask because the data sheet for explaining how the thing works is actually really crappy. I know for the most part that you want to set in the presets to a value between 0-255, but thats it. Will 255 give me a divide by 1?

Matt
 

MrChips

Joined Oct 2, 2009
30,618
A 4-bit binary counter will count up from 0-15. If you were to reset the counter to 9, for example, the counter would count from 9 to 15. Use the carry output to reload the counter to 9 and start over again.

Another way is to use a down counter. If you were to preset the counter to 9 and the counter would count from 9 to 0. Use the borrow output to reload the counter and start over again.
 

Thread Starter

MrJojo

Joined Jan 23, 2013
45
Well right now I I'm using an 8-bit counter which gives me 0-255. I bread boarded it up and set the counter to 250. I noticed that some times it tirggers correctly and other times it misses the 255 mark and has to count up to 255 again. In other words - 250->255->0->255. Do I need the "clear then?
 

djsfantasi

Joined Apr 11, 2010
9,155
Out of curiosity, what is your trigger? I.e., what is the input to the chip clock? On your planned circuit as well as your breadboarded test circuit.
 

Thread Starter

MrJojo

Joined Jan 23, 2013
45
@MrChip,

Thats what I thought, and am doing right now. It's just not working how I expect.

@djsfantasi,

Right now I'm using a pulse train at 50 Hz. I don't exactly know what my real life trigger's speed will be, but I'm thinking bellow 1k Hz. Basically I was going to try and slow my trigger down to ~ 100 Hz. A bit more of a brute force approach.

Matt
 

MrChips

Joined Oct 2, 2009
30,618
The SN74AS867 is good from DC to 50MHz.

Make sure your power supply is properly filtered with a 0.1μF ceramic capacitor and a 10μF electrolytic capacitor.
 

djsfantasi

Joined Apr 11, 2010
9,155
Ok, so you are using an external clock for your input (like a frequency generator). I was wondering if you were getting extra clock cycles, due to ground bounce. Apparently, this is not the case!

Do your outputs have an unusual load on them? Are your breadboards connections "short and sweet"? My EE relative mentioned that as a possible reason you're skipping output states.
 

Thread Starter

MrJojo

Joined Jan 23, 2013
45
@MrChips,

Currently the power is being supplied by a DC PS, but I added a .1uF ceramic and 10uf tanulum - I didn't have an electrolytic on hand.

@djsfantasi,
My leads aren't as short as possible, but they are like ~3in. long, so I'm looking at that as any drop or delay in them is negligible.

I was looking at the chip and I noticed a blemish on it, I think it may have shorted and fried something on the insides, so I ordered a new one and waiting on it from digikey. I'm hoping that the problem is that I have a bad IC.
 

MrChips

Joined Oct 2, 2009
30,618
10μF tantalum capacitor is an electrolytic capacitor, meaning it is polarized.

Where did you install the two capacitors?
Install them at the chip's Vcc and GND pins.
Posting a photo of your breadboard would help.
 

Thread Starter

MrJojo

Joined Jan 23, 2013
45
Bad news Fancy Folk,

Looks like my chip worked perfectly fine. I replaced it and nothing changed. The IC still skips every now and then. I set it to count up with a load of 254 (divide by 1) and set my frequency down to 1 Hz. I expected to see an output every 2 pulses. What I got was no output from the RCO.

Attached is a picture of what my breadboard looks like. The right side is a dip switch with pull up resistors. When the switches are open, its a 5V (logical 1), closed, its ground. They connect to the middle (SN74AS867). The ceramic capacitor goes from VCC to Gnd (pin 12 to 24), while the tantalum goes from VCC to /ENP (which is GND) - reason for not going to the official ground at pin 12 is because the capacitor wasn't long enough. The only thing that is wired different from the original post is the inputs of pin 1 and 2 are switched (which is correct, when /RCO goes low, I want that to load - S1 = H, S0 = L, otherwise Count High S1 = H, S0 = H).

Matt
 

Attachments

MrCarlos

Joined Jan 2, 2010
400
Hello MrJojo

You say:
Attached is a picture of what my breadboard looks like.

The right side is a dip switch with pull up resistors.

When the switches are open, its a 5V (logical 1), closed, its ground.

They connect to the middle (SN74AS867).

The ceramic capacitor goes from VCC to Gnd (pin 12 to 24), while the tantalum goes from VCC to /ENP (which is GND) - reason for not going to the official ground at pin 12 is because the capacitor wasn't long enough.

The only thing that is wired different from the original post is the inputs of pin 1 and 2 are switched (which is correct, when /RCO goes low, I want that to load - S1 = H, S0 = L, otherwise Count High S1 = H, S0 = H).

As much as I read and read the data sheets SN74AS867 I can not find the reason that your design does not work.

How much voltage you're biasing the IC ?. When much should be 5 Volts. Well filtered and regulated.

How high is the level of the pulses that are applied to its input Clock ?.

I am struck by this sentence of yours:
reason for not going to the official ground at pin 12 is because the capacitor wasn't long enough.
You mean the PIN 12 of IC is not grounded ? . . . Should be, if not the IC does not work
 

crutschow

Joined Mar 14, 2008
34,201
Each IC should have a 0.1uF decoupling capacitor directly from the V+ pin to the ground pin. Otherwise the fast rise and fall times of the signals can cause glitches which could cause the observed false triggering. 74ASxx devices are fast devices and have very fast rise and fall times so are especially sensitive to this. A standard 74xx or CD4xxx CMOS device would be less problematic for your slow application.
 
Top