Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 21:21 03 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM interfacing with 5V CMOS

     Page 4 of 7    
Author Message
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 01:17pm 13 Apr 2020
Copy link to clipboard 
Print this post

Ah yes, the two Ronnies sprang into my mind but maybe I'm mixing them up with
someone else.

Yes it would be possible to do what you say. It would take a few more ICs to do it
though. Gate the first clock pulse to the latch, the next 8 to the clock, somehow
tell the CMM when to read the data... maybe the falling edge of the clock.

It's a bit like using a sledge hammer to... well you know.

If you have two 555s they could be used to interface the clock and latch signals to
5 volt logic levels using your existing open collector outputs and pullup resistors.
They can act as inverters if you tie the threshold and trigger inputs together.
I have used them like that. A 1K pullup resistor on the 555 might help because the
output is pulled high by the emitter of a transistor so it will not go all the way
to 5 volts. The CMOS version may be different but I'm not sure.

Bill

EDIT Some of the switches were over 300 miles away.
Edited 2020-04-13 23:19 by Turbo46
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 06:51pm 13 Apr 2020
Copy link to clipboard 
Print this post

Hi Bill,

  Turbo46 said  Yes it would be possible to do what you say. It would take a few more ICs to do it though. Gate the first clock pulse to the latch, the next 8 to the clock, ...


That's what I propose using the decade counter for. Use the 555 to clock the 4017. Tie output 1 of the 4017 to the "4021" latch, outputs 2-8 to the "4021" clock (you only need to push the 4021 clock 7 times, not 8), output 9 to the 4017 reset. Note I have no practical experience so this may be bollocks

  Quote   ... somehow tell the CMM when to read the data... maybe the falling edge of the clock.


That problem didn't occur to me until after my previous post. Though it wouldn't need to be solved if all I wanted was to confirm that the "4021" was behaving itself at 5V.

  Quote  It's a bit like using a sledge hammer to... well you know.


Yes, I wasn't proposing it as a long term solution, more as an alternative with the components I have at hand.

  Quote  If you have two 555s they could be used to interface the clock and latch signals to 5 volt logic levels using your existing open collector outputs and pullup resistors ...


If you say so, I know the 555 is the simplest of IC's but my electronics journey hasn't taken me that way yet. Note I think I may have regular 555s and 556s, not CMOS L555/6s.

Thanks again,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 12:48am 14 Apr 2020
Copy link to clipboard 
Print this post

Not bollocks but not that simple either.

The 4017 outputs 2-8 are separate outputs. They would need to be combined by one big or several OR gates. The propagation delay between the outputs may give you individual clock pulses but I'm not sure about that but you could use the output to gate the clock pulses.

A better way would be to use outputs 2 and 8 (or 9?) to set and reset a simple NOR latch and use the output of that to gate the clock pulses. You may also need to gate the 1 output with the clock pulse to give some separation from the clock pulses. That may be a good learning exercise - slow it right down and drive some LEDs and see if they flash as required.

You will still need to read the data in to the CMM to know if it is working though.
(2nd Edit) You could add a LED to the data line to indicate the state of the switches.

I would just use a CD4050 supplied by 5 volts to drive the clock and latch lines using the existing CMM outputs. You could use any other logic gate IC you have to hand instead - like a 4011 for instance _ perhaps connect two gates in parallel for each line for more drive capability. Bearing in mind that some ICs will invert the signal.

I hope that makes sense

Bill
Edited 2020-04-14 16:43 by Turbo46
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 09:03am 14 Apr 2020
Copy link to clipboard 
Print this post

G'Day All

It started out as a beautiful day. By 9:05 I was home with 3 x CD4021 and some 10k's
I then set about engraving a small board that I had designed on Monday.
As a result of moving camp, replacing a PC and Sod's law things did not go well but I finished up with a board.
Then I had to sort out this SetPin LATCH,ooooout rubbish and that were it fell into a heap.
A bloke I worked with on a project described that project as like a Russian novel, starting with disease pestilence, famine and then things go bad. That about sums it up.
My Maximite is not being nice after I went to all the trouble of updating the firmware.
Am I just getting old or is the MMBASIC system getting too complicated?
I need a bottle of Cab. Sav.

With you young blokes trying to use 555's to synthesis signals I would use an Arduino but then it would probably leak oil or something.

Peter
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5029
Posted: 09:30am 14 Apr 2020
Copy link to clipboard 
Print this post

Hi PeterB,

I then set about engraving a small board that I had designed on Monday.


Are you also using a laser engraver to make boards ?
What CAD packages do you use ?

I read CaptainBoing's writeup, and he uses EAGLE, through Inkscape, then Laserweb.
I tried this same workflow using KiCAD (not EAGLE), and have not been successful.
KiCAD can generate SVG's, but these cannot be read by Laserweb (hangup), and when I run them through Inkscape and save them in Inscape SVG format (like CaptainBoing) it still can's be ready by Laserweb. Maybe something to do with the layer stack up or so.
Wasted a lot of time to try this route.
Apparantly there is a french guy who got it working (youtube) but can't follow his french, the youtube quality is unreadable, and there is no accompanying text.
So that is a dead end for me.

Have tried Gerber output form KiCAD, and then convert to Gcode (pcb2gcode + GUI), but then I could not get Laserweb to play the gcode (***.ncg) file.

KiCAD can also output Gcode directly, but that will also not play in Laserweb. Plus the fact that you cannot select outline milling/engraving in KiCAD. So it will mill/engrave everything that is not copper.

Anyway...what do you use ? How do you do this ?

Regards,

Volhout

P.S. I have an Eleksmaker A3 with 2.5W laser.
Edited 2020-04-14 19:37 by Volhout
PicomiteVGA PETSCII ROBOTS
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 10:03am 14 Apr 2020
Copy link to clipboard 
Print this post

G'Day

About 25 years ago I decided to make my own PCBs rather than use VERO. After a great deal of thought (25 mins) I cobbled up some extruded aluminium, MDF, steppers and a Dremel. I also bought KCAM and to design the board I use FREEPCB. It worked quite well however, I got involved with helping a young bloke in the U.S. who had a 3040 CNC machine and was having troubles setting it up. One thing lead to another and so I bought a 4060. All the bits of extruded aluminium went under the bench.
So that is what I have been using for many years now.
It does not make perfect boards but it is a lot better than VERO and I can design, engrave and load a board in a day and sometimes it even works.
The problem now is, I am getting old, KCAM is no longer supported, there are other better methods available but I do like my existing system. It is fun.

Your system is an order of magnitude or two better than mine.

Peter
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 02:09pm 14 Apr 2020
Copy link to clipboard 
Print this post

  PeterB said  ... A bloke I worked with on a project described that project as like a Russian novel, starting with disease pestilence, famine and then things go bad. That about sums it up.

My Maximite is not being nice after I went to all the trouble of updating the firmware.
Am I just getting old or is the MMBASIC system getting too complicated?
I need a bottle of Cab. Sav.


Sorry this is giving you grief Peter. If you can attach screenshots/screen photos or code then i'd be more than happy to take a look.

  Quote  With you young blokes trying to use 555's to synthesis signals I would use an Arduino but then it would probably leak oil or something.


I think that's just me trying to work with what I've got, anything else is on the slow boat from China.

Don't you program an Arduino in "C" ? I'm surprised MM-BASIC proves a challenge to anyone who can manage that.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 06:28pm 14 Apr 2020
Copy link to clipboard 
Print this post

Hi Bill,

I realise I'm starting to stray off topic and simply mine your electronics knowledge for my benefit. Please feel free to tell me to bugger off, or start a different thread (elsewhere), I'm diffult to offend online

  Turbo46 said  Not bollocks but not that simple either.

The 4017 outputs 2-8 are separate outputs. They would need to be combined by one big or several OR gates. The propagation delay between the outputs may give you individual clock pulses but I'm not sure about that but you could use the output to gate the clock pulses.


Right, being dozy I thought I could just tie the lines together to OR them ... but that would just result in short circuits, now I know better. I guess there is probably something that could be done with diodes, but that probably has its own downsides, e.g. a drop in V.

  Quote  A better way would be to use outputs 2 and 8 (or 9?) to set and reset a simple NOR latch and use the output of that to gate the clock pulses.


Do you mean something like a CD4043 ?

You must forgive my eccentric attachment to 4000 series CMOS (and running them off-spec at 3.3V), I just happened to get some of those early on and until directed otherwise just keep adding to that collection.

Would I be better off using 74HC with the Maximite ? since its 3.3V highs are good enough for a TTL high logic level.

  Quote  You may also need to gate the 1 output with the clock pulse to give some separation from the clock pulses. That may be a good learning exercise - slow it right down and drive some LEDs and see if they flash as required.


Thanks, I'll add that to my list of things to try.

  Quote  I would just use a CD4050 supplied by 5 volts to drive the clock and latch lines using the existing CMM outputs.


Ummm, I haven't quite worked out the purpose of 4049/4050 wouldn't I still need to use open collector output on the MM because I need > 4V to register as a high to the CD4050, and then it just converts that to a 5V signal ... what am I achieving? It looks like they are good for bringing the voltage down to Vcc, but not up? They don't even appear to have terribly impressive source/sink characteristics. Or am I failing in my understanding of their datasheets.

  Quote  You could use any other logic gate IC you have to hand instead - like a 4011 for instance _ perhaps connect two gates in parallel for each line for more drive capability.


Now you've definitely lost me. I could use them for what? I can just about grasp the idea that if I tie two gates in parallel then I can possibly source twice as much current from them.

Best wishes,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 09:57pm 14 Apr 2020
Copy link to clipboard 
Print this post

Hi Bill,

  thwill said  
  Turbo64 said  You could use any other logic gate IC you have to hand instead - like a 4011 for instance _ perhaps connect two gates in parallel for each line for more drive capability.


Now you've definitely lost me. I could use them for what? I can just about grasp the idea that if I tie two gates in parallel then I can possibly source twice as much current from them.


A random firing of neurons helped me understand your suggestion (possibly), and I built this:

Note: C1 is 10uF, not 1uF. And if it is significant the logic IC is a CD4069BE without the U.

Just in case I've drawn it wrong, I've gated the CLOCK signal sequentially through a pair of NOT gates in a 4069B.

And wonder of wonder it works!!! The shape of the resulting CLOCK signal is better defined so does that suggest that was the cause of the problem?

Please feel free to critique both the design and schematic, otherwise how will I learn.

I'm still interested in answers to the other questions I raised regarding 4043, 4049 & 4050, and whether I would be better off investing in 74HC to use with the MM.

A thousand thanks,

Tom
Edited 2020-04-15 08:32 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 12:30am 15 Apr 2020
Copy link to clipboard 
Print this post

G'Day Tom et al

Arduino uses a cut down version of C and was developed for schools. It is very easy to learn. The Chinese produce things like "mini pro" that cost about the same as an IC so it is often just as easy to stick in an Arduino. The problem is that no two manufacturers use the same footprint. I do have a bit of a problem changing from MMBASIC to Arduino and back.
My MAXIMITE has been on the shelf for years and never used so I will have a bit of a play and then bin it if it gets too difficult but thanks for the offer.
My instruction manual gives SETPIN pin,cfg[,option] so SETPIN 11,DOUT,OC is what I expected and you wonder why SetPin LATCH,oout upsets me. You young people have no respect for the elderly (senile?).
I am still confused as to why the simple circuit fails.

Peter
Edited 2020-04-15 10:31 by PeterB
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 01:05am 15 Apr 2020
Copy link to clipboard 
Print this post

Yes!!!

That is exactly what I was trying to suggest. I would connect a second inverter in parallel with the second one for more drive capability and duplicate that circuit for the latch signal. Just to be sure to be sure. And yes I think the clock signal needed an active pullup to work more reliably.

  Quote  there is probably something that could be done with diodes, but that probably has its own downsides, e.g. a drop in V

Yes you could make diode/resistor OR gate and use a buffer gate after that to get rid of the drop in V. You may get individual clock pulses due to propagation delay between stages but it would be iffy.

  Quote  Do you mean something like a CD4043 ?

Yes but I was thinking of making one out of a quad NOR gate. That would leave a couple of gates for gating the clock. Google "NOR latch". A NAND latch would need the inputs to it inverted I think.

  Quote  Would I be better off using 74HC with the Maximite ? since its 3.3V highs are good enough for a TTL high logic level.

If you want to run the IC from 3.3V - yes. At 5V I'm not sure the highs are good enough to be 100% reliable. Minimum 3.15V at 4.5V for one I have used - not specified for 5V but it would be pretty close to 3.3V.

  Quote  Ummm, I haven't quite worked out the purpose of 4049/4050

  Quote  Now you've definitely lost me. I could use them for what?

Well you have that sorted. Sorry my explanation was not all that clear.

Bill
Keep safe. Live long and prosper.
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 01:30am 15 Apr 2020
Copy link to clipboard 
Print this post

G'Day Peter,

I have only just recently learnt how to pronounce "Arduino" when a fellow at Jaycar used it. I've always struggled with C.

Don't bin your Maximite, I'll have it. I'll swap it for a bottle of Redmans's Cab Sav

Are you looking at the Micromite manual and not the Maximite manual? The Micromite has the SETPIN command as you say but the Maximite manual has OOUT instead.

I am still confused as to why the simple circuit fails as well. I think the 'black blob' is more fussy about the clock pulse and needs a good sharp clock pulse with and active pullup. All of the clock pulses on Tom's DSO look fine to me (I have to stop myself from writing CRO all the time).

Bill

Edit:
Tom, I forgot, I prefer circuit diagrams that show the individual gates rather than the IC as a single block only gates though not complex ICs.  It means you don't have to have the datasheets available to follow it.
Edited 2020-04-15 12:00 by Turbo46
Keep safe. Live long and prosper.
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 07:30am 15 Apr 2020
Copy link to clipboard 
Print this post

G'Day Bill etc

One of the disadvantages of retirement is not drinking coffee with like minded idiots so we never get to learn things like pronunciations. I have no idea how to pronounce gerber and I have my way for LINUX it's LINUX not LINNUX.
I had no idea there are two manuals, thanks.
Today has been a day of recovery and house work and I still haven't washed the floors. SHE is in a nursing home which is in lock down so today we had a phone chat. SHE told me that yesterday she came home and cleaned the floors. So it goes.

Peter
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5029
Posted: 07:43am 15 Apr 2020
Copy link to clipboard 
Print this post

Hi Peter,

It's hard when she is not around, and you see her drift away.
I am pleased to hear that you still maintain contact. Even if she is unable to digest all you tell her, it will make a difference. By her answer you can tell that in her mind she is with you.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 655
Posted: 08:54am 15 Apr 2020
Copy link to clipboard 
Print this post

Bill

I have tried to reply to your PM it may have worked. Why is everything so difficult

Peter
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 09:21am 15 Apr 2020
Copy link to clipboard 
Print this post

Hi Peter,

It did work thanks, I hope we are all OK when this rotten thing has been beaten. I hate this isolation business. Imagine what it would be without smart phones and the internet.

I echo Volhout's thoughts.

Bill
Keep safe. Live long and prosper.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 09:40am 15 Apr 2020
Copy link to clipboard 
Print this post

  Quote  I echo Volhout's thoughts.


Likewise.

Best wishes from Blighty (and never has "Blight" been more true),

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 03:54pm 15 Apr 2020
Copy link to clipboard 
Print this post

  Turbo46 said  Yes!!!

That is exactly what I was trying to suggest. I would connect a second inverter in parallel with the second one for more drive capability and duplicate that circuit for the latch signal. Just to be sure to be sure. And yes I think the clock signal needed an active pullup to work more reliably.


OK. Depending on other requirements I may end up using some IC other than the inverter (i.e. a non-inverting buffer) but I think I get the idea now.

  Quote  Yes but I was thinking of making one out of a quad NOR gate. That would leave a couple of gates for gating the clock. Google "NOR latch". A NAND latch would need the inputs to it inverted I think.


OK, thanks

  Quote  
  Quote  Would I be better off using 74HC with the Maximite ? since its 3.3V highs are good enough for a TTL high logic level.

If you want to run the IC from 3.3V - yes. At 5V I'm not sure the highs are good enough to be 100% reliable. Minimum 3.15V at 4.5V for one I have used - not specified for 5V but it would be pretty close to 3.3V.


Whoops, I think I meant 74HCT but anyway I think I'm getting to grips with this ... until the next time.

  Quote  Well you have that sorted. Sorry my explanation was not all that clear.


The explanation was perfectly clear, I just needed a little more background knowledge or (as it turns out) a leap of intuition to make sense of it.

Onward and upward, see you in a different thread.

Thanks again,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:36pm 15 Apr 2020
Copy link to clipboard 
Print this post

<Screams and gibbers>

Turns out it isn't working after all. In all the changes back and forth the CLOCK had ended up configured as dout and it looks like its 3.3V was (suprisingly?) enough for the 4069 inverter to register it as a high the result being that the two gates were pulling the CLOCK up to 5V which was enough for the epoxy blob to work.

If I configure the CLOCK as oout then I am back where I started except with cleaner CLOCK (and LATCH) pulses.

Is there room under that bed for me?

For the sake of all our sanity I'm giving up on trying to run with with an open collector as I have other ways of making the controller work. Perhaps if I'm unlucky enough not to forget this whole sorry episode I will try again in a few months time ... when it will of course just work.

Whimpers,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1638
Posted: 11:47pm 15 Apr 2020
Copy link to clipboard 
Print this post

"I don't believe it"   (quoting another old bald bloke)

You still have the two inverters in series and the only difference is whether you use OUT or OOUT? I cannot imagine that there is any noticeable difference in the clock pulse for those two conditions. Did you try two gates in parallel to drive the clock pulse?

I'm beginning to believe that you were sold a pup and the blob is a bit suss. After all the latch signal appears to work as expected.

Bill
Keep safe. Live long and prosper.
 
     Page 4 of 7    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025