electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
How to "wrap" a pair of 4029s?
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [14 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Sun Jun 28, 2009 2:29 am    Post subject: How to "wrap" a pair of 4029s?
Subject description: Any CMOS gurus know how to tackle this?
Reply with quote  Mark this post and the followings unread

The pair of 4029s (pictured) sucessfully count up and down across 8bits (256steps) using the carry out of the first connected to the carry in of the second.
What I want next is a way of getting the whole counter to change direction when the count equals 00000000 or 11111111, thereby "wrapping" the edges around.
I've done a bit of experimenting with a 4027 J-K and a 4013 D type flip-flops, trying to use the effects of the unused "carry" pins, (5 on the upper and 7 on the lower) but can't get it to work yet.
According to the data sheet, carry in will go high for as long as all outputs are low, and carry out will go low for as long as all outputs are high.


Re-Animator-Main-Clock-28-6.gif
 Description:
 Filesize:  13.32 KB
 Viewed:  628 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Re-Animator-Main-Clock-28-6.gif



_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Sun Jun 28, 2009 9:13 pm    Post subject: Reply with quote  Mark this post and the followings unread

I reckon you're on the money with the flip-flop idea.

I don't think you will be able to use the carry in/out signals to identify when the direction change should occur though as I think the carry out on the second counter will fire when it reaches 1111/0000 (depending on the direction) regardless of the state of the first counter. A more reliable method might be to decode the outputs to find 00000000 and 11111111 and drive a flip flop connected to the U/D lines.

Attached is the circuit I knocked up to simulate this in Cedar logic. This seems to do what you want it to.


CountUpThenDownAndBackAgain.PNG
 Description:
 Filesize:  15.49 KB
 Viewed:  626 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

CountUpThenDownAndBackAgain.PNG



_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Sun Jun 28, 2009 9:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

Actually you can simply that previous circuit a whole bunch by ANDing the carry out of both counters and sending the result to the clock of the flip flop.

Cheers,
Adam-V


CountUpThenDownSimpler.PNG
 Description:
 Filesize:  9.91 KB
 Viewed:  772 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

CountUpThenDownSimpler.PNG



_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Mon Jun 29, 2009 12:08 am    Post subject: Reply with quote  Mark this post and the followings unread

Does this last schem really work? It seems way too simple to be true, but it's exactly the kind of simple solution I thought might be possible. Thanks heaps Adam, I'll give it a go and let you know. Very Happy
_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Mon Jun 29, 2009 3:20 pm    Post subject: Reply with quote  Mark this post and the followings unread

I ran it through cedar logic and it works there. Simulators and reality do not necessarily coincide but I reckon it should do what you're after. Please do let us know if it works.

Cheers,
Adam-V

_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Mon Jun 29, 2009 4:47 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm gonna try it this morning.
The main thing that came up while I've been mulling it over was whether, because it's only using the carry out, it might count down to 00000000 then hit 11111111 before changing direction. This would cause a momentary spike in the R/2R output. (It's the main counter on my Re-Animator)
If that's the case, it's possible I could use the same reasoning to trigger the FF "from the other side" also, with a pair of inverters and another AND hanging off the carry ins.
I don't spose you could try that in cedar logic could you? Very Happy
Thanks heaps either way,
Andrew

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Mon Jun 29, 2009 6:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

When I AND both carry outs, it flatlines, (ie the counters sit on the same value, OR they are jumping back and forth between two adjacent values)
BUT,.... when I just send the second carry out to the flip-flop, it works fine!
I had to send my master sync signal to the set input of the flip-flop so it started in the same direction for each wave, but that's cool. It even adds the option of starting with an up or down count, (Set/Reset)
I still haven't checked the possible spike effect, which in this case might still be apparent, as it would still tip over from all 0s to all 1s in order to change direction and come back to all 0s. That fraction of a second at all 1s may be audible, but I can't see a spike on the scope.

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Mon Jun 29, 2009 6:57 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here's a quick mp3. I still haven't sorted out taking a shot of the scope, so open it with Soundforge etc, just to have a look at the wave.
It's very low frequency, as I had to wind out the sync from my VCO so I could get a bottom and top turn around included.
Which you can see very clearly. The wave "bounces" off the upper and lower edges.
The vertical flat point is where the sync pulse resets the wave to start again.


Re-Animator 30-6-09.mp3
 Description:

Download
 Filename:  Re-Animator 30-6-09.mp3
 Filesize:  80.61 KB
 Downloaded:  1539 Time(s)


_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Mon Jun 29, 2009 7:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

Interesting. There maybe a difference in the way Cedar handles U/D counters versus the real world.

What should happen is, when counting up and 11111111 is reached, is that the carry out of both counters should pulse (counter 1 briefly before counter 2). Similarly when counting down, the same should happen when 00000000 is reached. This should clock the latch and change the direction logic accordingly.

Maybe you have an issue with edges here, some flip flops and counters are positive edge triggered, others are negative edge. I just tried this in Cedar by inverting the ANDed carry out signal before sending it to the flip flop clock input and you get some weird results, flipping between 00000000 and 11111111.

Running with just the carry out of the second counter causes it to count between 00001111 and 11101111 as the second counter outputs a carry pulse when it reaches 0000 or 1111 depending on the direction.

You can download Cedar logic from here - its free.

http://cedarlogic.scienceontheweb.net/

Looks like there is a newer version to the one I am using.

_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Mon Jun 29, 2009 7:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

Just looking at the datasheets, both the 4029 and 4013 are positive edge triggered so that can't be the issue.

You could try ripple clocking them rather than parallel clocking.

Take the carry out of counter 1 and apply it to the clock in of counter 2 instead of your clock signal. Then use the carry out of counter 2 to toggle the flip flop which controls the direction.

Cheers,
Adam-V

_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Tue Jun 30, 2009 12:43 am    Post subject: Reply with quote  Mark this post and the followings unread

I can't remember why I didn't want to ripple count them. There's something I'm missing here about the nature of the carry in/out.
Anyway, it seems to work fine with just the carry out from the second one. I'm going to investigate the functionality of the carry pins and see if I can work out why.
Looking at the scope, it is definitely reversing at each end, and there's no spike at the turn around point.

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Tue Jun 30, 2009 12:58 am    Post subject: Reply with quote  Mark this post and the followings unread

Adam-V wrote:
the second counter outputs a carry pulse when it reaches 0000 or 1111 depending on the direction


I just re-read the description in the datasheet, and the above statement is true "provided the carry input is at logical 0 state."
Does that change what we are expecting? I'm getting myself very confused about what is happening across both counters in the up and down modes.

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Adam-V



Joined: Jan 29, 2007
Posts: 300
Location: Australia
Audio files: 1

PostPosted: Tue Jun 30, 2009 3:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

There's the difference between the counter in Cedar logic and the CMOS counter you are using!

In Cedar, the second counter outputs the carry pulse regardless of the carry in state.

Sounds like you've got it sussed though.

Cheers,
Adam-V

_________________
Digitalis Effect | Fractured Symmetry (www.spiralsect.com)
Back to top
View user's profile Send private message Visit poster's website
Uncle Krunkus
Moderator


Joined: Jul 11, 2005
Posts: 4761
Location: Sydney, Australia
Audio files: 52
G2 patch files: 1

PostPosted: Tue Jun 30, 2009 7:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

Adam-V wrote:
Sounds like you've got it sussed though.


I don't know if I'd say I've got it sussed just yet.
I've read a couple of online tutorials about using the 4029, but haven't found anything specific about this situation.
I still don't know exactly what's going on. Only that it is.

_________________
What makes a space ours, is what we put there, and what we do there.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: mosc
Page 1 of 1 [14 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Lunettas - circuits inspired by Stanley Lunetta
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use