electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
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 » Developers' Corner
CD4029 based sequencer skipping 0
Post new topic   Reply to topic Moderators: DrJustice
Page 2 of 2 [44 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: Previous 1, 2
Author Message
AlanP



Joined: Mar 11, 2014
Posts: 462
Location: New Zealand
Audio files: 29

PostPosted: Tue Apr 25, 2017 9:29 pm    Post subject: Reply with quote  Mark this post and the followings unread

Can't really contribute anything, just posting to say that following this discussion has been both fascinating and also instructive Smile
Back to top
View user's profile Send private message
electrotech



Joined: Apr 24, 2013
Posts: 32
Location: Ayrshire Scotland

PostPosted: Wed Apr 26, 2017 2:05 am    Post subject: Reply with quote  Mark this post and the followings unread

I posted my circuit suggestion above late last night and now having had another look at it, I realise that the rise and fall times might be too slow (~200ns) in order to reliably clock the counter... I should really get the prototyping board out and see if it works first !
So I now agree that this solution is probably better :-
PHOBoS wrote:
Instead of using 2 schmitt trigger inverters, which won't really help you, use a transistor (configured the same way as
Q5, Q6 in the original schematic but with a resistor to GND) followed by 1 schmitt trigger inverter. This will give you
a wider voltage range and because of the schmitt triggers smooth transitions at a logic level. Or, as I mentioned before,
some simple comparators which have always worked great for me.

So, keep the input side as I posted above using a single 2N3904 but with just one 4k7 to 10k resistor for the collector load. This will take care of the voltage translation then feed the signal at the collector into the 40106 schmitt-trigger inverter to square things up nicely.

Andy
EDIT - I thought the rise/fall times were significant because I had problems getting the counter to work in my simulation software. However I've just done what I should have done in the first place and read the CD4029B datasheet... The maximum rise & fall times for the clock input are stated as 15μs so my circuit should work just fine. Very Happy
Back to top
View user's profile Send private message
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22453
Location: The Netherlands, Enschede
Audio files: 218
G2 patch files: 319

PostPosted: Wed Apr 26, 2017 2:53 am    Post subject: Reply with quote  Mark this post and the followings unread

Heh .. just looked that 15 µs up as well.
_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Blue Hell
Site Admin


Joined: Apr 03, 2004
Posts: 22453
Location: The Netherlands, Enschede
Audio files: 218
G2 patch files: 319

PostPosted: Wed Apr 26, 2017 2:53 am    Post subject: Reply with quote  Mark this post and the followings unread

BTW, useful book : https://archive.org/details/RcaCmosI.c.Databook1983
_________________
Jan
Back to top
View user's profile Send private message Visit poster's website
Grumble



Joined: Nov 23, 2015
Posts: 698
Location: Netherlands
Audio files: 20

PostPosted: Wed Apr 26, 2017 4:02 am    Post subject: Reply with quote  Mark this post and the followings unread

Used to have that in my office...
Back to top
View user's profile Send private message Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Wed Apr 26, 2017 7:51 pm    Post subject: Reply with quote  Mark this post and the followings unread

electrotech wrote:
I posted my circuit suggestion above late last night and now having had another look at it, I realise that the rise and fall times might be too slow (~200ns) in order to reliably clock the counter... I should really get the prototyping board out and see if it works first !
So I now agree that this solution is probably better :-
PHOBoS wrote:
Instead of using 2 schmitt trigger inverters, which won't really help you, use a transistor (configured the same way as
Q5, Q6 in the original schematic but with a resistor to GND) followed by 1 schmitt trigger inverter. This will give you
a wider voltage range and because of the schmitt triggers smooth transitions at a logic level. Or, as I mentioned before,
some simple comparators which have always worked great for me.

So, keep the input side as I posted above using a single 2N3904 but with just one 4k7 to 10k resistor for the collector load. This will take care of the voltage translation then feed the signal at the collector into the 40106 schmitt-trigger inverter to square things up nicely.

Andy
EDIT - I thought the rise/fall times were significant because I had problems getting the counter to work in my simulation software. However I've just done what I should have done in the first place and read the CD4029B datasheet... The maximum rise & fall times for the clock input are stated as 15μs so my circuit should work just fine. Very Happy



Thank you very much Andy....

Your original circuit was very clear. The references here, however, confuse me. "so my circuit should work just fine", do you mean the original? Also, when you say "just one 4k7 to 10k resistor for the collector load" I'm not clear on what modification you intend for the original.

And then, going back to the original, the questions I have about that revolve around my poor grasp of the deeper workings of transistors.

1) how did you arrive at particular values? 4.7 & 2.2K in particular. I mean, it seems fairly obvious that 4.7 is a standard value roughly half 10K, and 2.2 is roughly half of 4.7K, but the ratios in general are opaque to me.

2) What is the advantage of using the NPN & PNP together rather than cascading NPN stages?

Thank you again, and I'm pleased once again to see that this place is much more educational for me than the constant roar in that other synth forum Smile

P.S. Jan, thanks very much for the CMOS book link. I think I've had that on my book list for a while, but I was expecting I'd have to buy it..... so I hadn't yet.
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu Apr 27, 2017 12:21 pm    Post subject: Reply with quote  Mark this post and the followings unread

Well, it's frankenstein, but it works Very Happy


IMG_20170427_141719247.jpg
 Description:
 Filesize:  1013.33 KB
 Viewed:  92 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20170427_141719247.jpg


Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu Apr 27, 2017 12:22 pm    Post subject: Reply with quote  Mark this post and the followings unread

(let's not discuss the ridiculously sized cap Wink )
Back to top
View user's profile Send private message
electrotech



Joined: Apr 24, 2013
Posts: 32
Location: Ayrshire Scotland

PostPosted: Thu Apr 27, 2017 1:04 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've decided to build the clock interface circuit on a prototype board to make sure it works properly - however, this usually means that things like resistor values change because 'real life' circuits don't always behave like theoretical ones...
Once I've tried and tested it I'll post the results here, probably in a day or two.
The 'scope hasn't been powered up for a few months so the exercise will be good for it.
The biggest problem with bipolar transistors is actually switching them off once they're on, especially when they're 'saturated'. That's why I've got lowish value resistors between base and emitter - to help remove charge from the base region, but I'm sure that transistor theory isn't what you want to hear about !
Elmegil, when I came up with the NPN/PNP two-transistor circuit I didn't put that much thought into the precise values and just picked some that experience told me would be 'in the ball-park'. Turns out the two 4.7k's at the input were not optimal, in fact they load the voltage across the zener diode so much that the input would need to be more than 15V before it started to 'zener'... so I'll need to make some changes there.
The 2.2k in series with the 10k form a split-load resistor for the NPN transistor and act as a potential divider to reduce the bias voltage for the PNP transistor. This enables it to switch on and off cleanly.
You also asked about advantages of an NPN & PNP together rather than cascaded NPNs ?
Well, you save on one resistor for a start but also the switching times will be slightly different, but we're talking about one or two micro-seconds which I don't think would be noticeable !
Going back to your sequencer circuit, which I'm interested in making BTW, if you have a spare inverter gate in a 40106 then it makes sense to use it here, with a single NPN transistor in front of it for the voltage conversion.
I'll have a go at that too and will report back with some new circuits.

Andy
EDIT - Elmegil, you've beaten me to it !
I was typing the above when you made those posts.
I'm glad the circuit 'works' but could probably be improved...
Back to top
View user's profile Send private message
gdavis



Joined: Feb 27, 2013
Posts: 359
Location: San Diego
Audio files: 1

PostPosted: Thu Apr 27, 2017 1:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Just to add to what Andy wrote, choosing resistor values for circuits like this is usually a balance between static power dissipation and switching speed. Larger values will use less power but switch slower and vice versa.

There's a fair amount of leeway in DIY synths where you're not running at very high frequencies and not too concerned about minimizing power, though you do want to be reasonably mindful of these things. In higher performance applications these things become more critical (and a large part of the reason many things use CMOS instead of BJT's).

electrotech wrote:
Turns out the two 4.7k's at the input were not optimal, in fact they load the voltage across the zener diode so much that the input would need to be more than 15V before it started to 'zener'...


Do you even need a zener here? Wouldn't a normal diode suffice since the input can go up to V+ without any harm?

elmegil wrote:

Thank you again, and I'm pleased once again to see that this place is much more educational for me than the constant roar in that other synth forum Smile

OMG, thank goodness I'm not the only one!!

_________________
My synth build blog: http://gndsynth.blogspot.com/
Back to top
View user's profile Send private message
electrotech



Joined: Apr 24, 2013
Posts: 32
Location: Ayrshire Scotland

PostPosted: Thu Apr 27, 2017 1:43 pm    Post subject: Reply with quote  Mark this post and the followings unread

Correct, you don't actually need the zener with the circuit as it stands... a design error on my part.
So yes, an ordinary 1N4148 would get rid of negative voltages if present.

Andy
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu Apr 27, 2017 3:41 pm    Post subject: Reply with quote  Mark this post and the followings unread

electrotech wrote:
EDIT - Elmegil, you've beaten me to it !
I was typing the above when you made those posts.
I'm glad the circuit 'works' but could probably be improved...


Yah, probably, but you got me going Smile

I did not, btw, do the following:

also put the same circuit in front of the reset input, which in fact is now not working for reasons I haven't gotten to yet. Still working out other stupid mistakes Smile Like putting a 10K resistor in the "input" side of those 4051's, which made the other side turn into voltage dividers, oops.

use actual zeners -- I had the diode in the circuit already, and I'm not really going to be putting any stress on this iteration of the circuit. It will take a new PCB spin before I'm ready to actually exercise it seriously.

Also, I have no 40106 in the circuit currently, and after I realized I had to do run/stop (I keep forgetting....) I suddenly needed 7 inverters instead of 6, so I took it back out entirely. We'll see how layout looks, whether I think I can/should put one back in for some of the inverters.....
Back to top
View user's profile Send private message
electrotech



Joined: Apr 24, 2013
Posts: 32
Location: Ayrshire Scotland

PostPosted: Sun Apr 30, 2017 4:13 am    Post subject: Reply with quote  Mark this post and the followings unread

A bit late I know, but I've now tested the clock interface circuits on a breadboard and looked at the signals on the 'scope and have updated the circuit slightly. (shown below)
Both circuits give a 12V output when the input is above 3V and will withstand higher input levels without a problem.
Negative polarity signals are removed by the diode as already discussed.

Circuit 1
Since both transistors are switched ON when the input signal goes 'high' the response is very quick ( <300ns) so just what's needed for the counter chip. The output transition from ON to OFF is a bit slower though but I don't think that matters for this application.

Circuit 2 shows the simpler circuit that can be used if there is a spare inverter gate available.
This switches ON with a similar response time to Circuit 1 but the switch OFF time is much faster with very sharp rise and fall times.

Anyway, I hope this is of interest.

Andy


circuit1.png
 Description:
Circuit1 NPN/PNP clock interface
 Filesize:  5.59 KB
 Viewed:  3073 Time(s)

circuit1.png



circuit2.png
 Description:
Circuit 2 NPN plus Schmitt inverter clock interface
 Filesize:  4.83 KB
 Viewed:  99 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

circuit2.png


Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Tue May 02, 2017 11:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

I just wish E-M would email me with updates. Those are great, thank you
Back to top
View user's profile Send private message
droffset



Joined: Feb 02, 2009
Posts: 505
Location: London and Oxford
Audio files: 2

PostPosted: Wed May 03, 2017 2:43 am    Post subject: Reply with quote  Mark this post and the followings unread

This is a cool project.
I know you're already far along, but thought you might enjoy looking at my 4029/4067 based sequencer. There's a writeup at:
http://droffset.blogspot.co.uk/2010/12/cheack-out-this-16-step-updown.html

_________________
==================
Check out the FREE Intro to Lunettas Document
https://docs.google.com/Doc?docid=0AZIwOP-PR9sSZDlidzgzbV8wY3RjenJqanY&hl=en

Edit: Spelling mistakes.
Back to top
View user's profile Send private message Visit poster's website
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu May 03, 2018 1:25 pm    Post subject: Reply with quote  Mark this post and the followings unread

So I've been fighting with the latest prototypes on this for a bit now.

I got past "skipping 0" every time, but now depending on the combination of rate and clock width, as well as the switch settings, I sometimes get a bounce at the start of a clock cycle. Blue line is pin 15 of the 4029. Yellow is in between the 1.2K and 10K resistors in the processing section. When I measure at the input to the processing section, I get a much slower slope, with a tiny little wiggle at the point of the glitch.

It occurs when one gate is off, and the next gate is on, at which point it skips the on step and goes on to the next one. If I go off -> off, I don't skip and if I go on -> on I don't skip. Faster clock speeds and wider gate lengths are less susceptible. Using an external clock from an MI Module Tester doesn't exhibit the problem. But I've looked at the clock I'm generating and it doesn't look like there's an issue, I don't see any glitches in that waveform (other than it being slow-ish.... hm...........)

All my chips are appropriately bypassed. There's not path that I can see between the switches and the counter -- all the switches are on the other side of 4051's. I've tried a few attempts to use flying wires to re-route traces incase there was trace interference, but nothing definitive (at one point I thought I had solved it, but then found changing the speed/width settings a little bit brought the problem right back).


My current operating hypothesis is that I need some kind of hysteresis in the processing section -- If I were using a 40106 or similar inverter, that would probably solve it. There's probably room on the PCB to put it, but it seems a waste for just a couple of gates.

Of course as I type this now I'm thinking about that slow clock (slow as in a few ms rise time....). The last buffer for the clock section is an LM358 I wonder if I'm just using a lousy amp for such purposes and ought to use something else for my pulse width modulator. Time to go read up on the slew rate of the LM358.


Curious if anyone else has any ideas.....


IMG_20180503_144940725.jpg
 Description:
 Filesize:  1.26 MB
 Viewed:  11 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20180503_144940725.jpg


Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu May 03, 2018 2:06 pm    Post subject: Reply with quote  Mark this post and the followings unread

Yeah. Datasheet says unity gain config is able to slew at .3V/us so the 10/12 V here should be able to do the rise in 3.6us. Instead, even unloaded (pulled up the output pin) in the comparator configuration it's taking 600us to rise, and if I change the settings to stop skipping, the angle is noticeably sharper.

So I have to find out how to overcome the slow rise time.

Either another single sided op amp, or some change in the way it's loaded.


IMG_20180503_160111008.jpg
 Description:
 Filesize:  653.46 KB
 Viewed:  8 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20180503_160111008.jpg


Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu May 03, 2018 4:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

Interesting development. I figured "ok, maybe I should use a real comparator".

In fact, this does actually work better. I had some LM2903's lying around and they match the pinout, so yay. I put a pullup on it as you do with these kinds of comparators and voila.

Except....

I tried a 1K pull up as I have on a different circuit with an LM3900, and I got oscillation on the "high" side of the the operation.

I then moved to a 5.6K pull up (the datasheet shows 3K for a 5V supply, I have 12V, so almost double), now the "low" side is oscillating.

AND IT'S TZ FM Y'ALL.

Weirdest thing ever.

I had thought it was possibly due to how I had terminated the other unit on the chip; for the op amp I grounded + and tied - to output. So I disconnected - and output and tied - to + which is grounded instead. No change in the oscillation.


IMG_20180503_184446962.jpg
 Description:
 Filesize:  701.95 KB
 Viewed:  10 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

IMG_20180503_184446962.jpg


Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 2037
Location: Chicago
Audio files: 16

PostPosted: Thu May 03, 2018 5:56 pm    Post subject: Reply with quote  Mark this post and the followings unread

Ok, I put a 10K resistor between the buffer and the comparator and that has tamed the oscillation.

Oops Smile


Screen Shot 2018-05-03 at May 3 7.44.09PM.png
 Description:
 Filesize:  84.84 KB
 Viewed:  11 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Screen Shot 2018-05-03 at May 3 7.44.09PM.png


Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: DrJustice
Page 2 of 2 [44 Posts]
View unread posts
View new posts in the last week
Goto page: Previous 1, 2
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Developers' Corner
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
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


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