[SOLVED] 4040 to control the adress of an eeprom

Status
Not open for further replies.

bareil76

Newbie level 6
Joined
Sep 28, 2012
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,357
Hi,

I want to use a cd4040 (or similar... see attached image for pin description) to pilot the address of an eeprom.

The eeprom will be programmed with a certain type of signal and output it with using a parallel port to a DAC converter to generate the signal I need. I use parallel port to increase the speed of the conversion. I will then drive the cd4040 using PIC to change frequency.

However, I have a problem understanding the 4040. I need only the counter to fold back to 0 after getting to 255. That means I need 8bit and not 12bit.. how do I ensure that the counter automatically reset when it is at 256?

Thanks for your help!
 

I you are sure that the eeprom signal levels are compatible with the CD4040 and the speed suits you. Just use the first 8 bits. (9.7,6.5,3,2,4,13). There is no need to do anything else. Just ignore the remaining outputs.
 

Thanks...

But... if I ignore the other output.. how will the 4040 "know" that it needs to stop counting at 255?
 

An eight bit counter can only count to 255 then will return to zero and start again. It will not stop counting unless you stop the clock or keep reset high.
To understand this write in a paper the counting sequence of a 4 bit counter (that will count from 0 to 15 and the start again). And look what happens with the 2 or 3 bits of lower order.
Going back to the 4040 when the first 8 bits rollover from 255 to 0 they will increment the next bits by one. so the total count will be 256. The 2nd time the first 8 bits rollover will increment the next bits again and the total count will be 512. An so on. But the lower 8 bits will count from 0 to 255 forever.
Hope that I am not confusing you more with my explanation.
 

Not confusing at all!!!!

I just have to route the bit9 (256) to the reset pin!!!! tada... thanks very much!
 

Well. Now I am confused. The counter will go from 255 to zero in its natural count. There is no need to reset it. I suppose that you want to generate a waveform by going thru all the address of the eeprom that works as a 256 byte lookup table. If you store one complete period the only thing you need to do is clock the 4040 at 256*required frequency to get a periodic wave.
Unless you want to generate a single shot wave there is no need to do anything else. In that case you should gate the clock to stop the counter.
 

But if I dont do anything, the counter will go from 0 to 2^12, if I want it to stop and reset at 2^8, I need to reset it at 256 no?
 

Just pretend that the extra 4 bits doesnt exists. The first 8 will count 2^8 and you dont need to do nothing else.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…