Author Topic: Understanding Retro Electronics  (Read 22295 times)

0 Members and 1 Guest are viewing this topic.

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Understanding Retro Electronics
« on: 13:54, 24 March 17 »
Hi all,
     as there are several users here that are starting out in electronics, I thought I'd mention this here. Dave over on the EEVBlog has just posted a short tutorial video explaining the basics of logic gates and boolean algebra. For anyone looking to understand how their CPC works, this is one of the basics which needs to be understood, so if you have 30 Minutes to spare, it's well worth watching: https://www.eevblog.com/2017/03/24/eevblog-981-introduction-to-digital-logic/

Bryce.

Edit: Maybe I should make this a "sticky" thread and I will add further useful videos and documents that I know of.
 
« Last Edit: 15:36, 24 March 17 by Bryce »

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #1 on: 22:41, 10 May 17 »
Hi all,
     just recently I've been asked the same or similar questions by several new electronics enthusiasts, who've usually just bought their first oscilloscope. So I thought I'd do a short electronics tutorial to explain the situation. So what's the question:

Why is the square wave clock signal in my CPC not square?

The answer to this is a mixture of several factors, so here's a basic explanation:

Harmonics
Most square waves aren't perfectly square to start with. They are the sum of a bunch of sine waves. The fundamental frequency (16Mhz in the case of the CPC clock) plus many harmonics of that frequency. Harmonics are signals which are a multiple of the fundamental frequency, so for example with the CPC clock:

Fundamental Frequency = 16Mhz
2nd Harmonic = 32Mhz
3rd Harmonic = 48Mhz
4th Harmonic = 64Mhz
5th Harmonic = 80Mhz and so on...

This is what a real square wave (40Mhz) looks like on a Spectrum Analyser. You can clearly see the fundamental frequency (1) and it's associated harmonics right up to 500Mhz.



* Bryce_40MHZHarmonics.png
(21.19 kB, 800x480 - viewed 1250 times)



From the diagram below (only showing uneven harmonics) you can see that by adding all the harmonics together, you get a rough square wave. Each harmonic is or should be (if you haven't messed up your design) a little lower in amplitude than the frequency before it. The more harmonics you include, the more defined the square wave becomes. The edges get steeper and the top line becomes straighter. So this mixture of frequencies, not just a simple square wave, is what your oscilloscope is actually trying to measure.



* Bryce_SWHarmonics.png
(11.64 kB, 640x420 - viewed 1292 times)



Scope issues
So let's assume your shiny new scope has a bandwidth of approx. 60Mhz (the stated bandwidth is never exact). On the CPC clock, your scope will effectively be showing you the sum of the fundamental frequency plus the harmonics up to the 4th (64Mhz), but all further harmonics are too high a frequency for your scope to handle (or will be seriously attenuated). As seen in the diagram above, this isn't enough to give a well defined square wave. This also answers another frequently asked question: Why do I need a 100Mhz scope if I only intend measuring signals up to 16Mhz? ...well that's why. For sine waves the stated bandwidth is what you can accurately measure with the scope, but for square waves you need to be able to measure higher frequencies than the square waves fundamental frequency to get an accurate picture. You can test this effect on your scope by switching on/off the 20Mhz bandwidth limit. This will show you the effect that ignoring the upper frequencies has on the displayed shape.

The next issue is what's known as the rise time of the scope. Every scope has a certain rise time, ie: how fast the scope can keep up with a sharp signal rise. Even if your scope is able to handle higher frequencies, it may not be able to react to them. The very popular Rigol low-cost scopes have a rise time of about 3.5ns, so even if your scope has the bandwidth to capture lots of harmonics and you are measuring an ideal square wave with really sharp edges, the scope will show a 3,5ns slope on either side because that's the fastest it can update.
The last scope issue only applies to digital scopes. Older analogue scopes took the entire raw signal and fed it to the CRT. Newer digital scopes take samples of the signal at certain intervals and average out what happened in between the samples. So the more samples your scope can take per second, the more accurate the displayed square wave will be. However, even low-cost scopes such as the Rigol now offer at least 1GSa/s, which means that a 16Mhz signal is sampled around 62 times per wave which is more than enough to give an accurate picture.

Here's a look at a 4Mhz square wave on a 100Mhz scope. The square is relatively accurate because it can capture up to the 25th harmonic.



* Bryce_4Mscope.png
(31.56 kB, 800x480 - viewed 1291 times)



Now a 40Mhz square wave, where effectively, the scope is only able to display the sum of the fundamental frequency and its 2nd harmonic.



* Bryce_40Mscope.png
(34 kB, 800x480 - viewed 1258 times)



So... If I broke the bank, sold the wife and bought myself a >€200K 9Ghz 10GSa/s HP Agilent Keysight scope would I then see a perfect square wave? The answer is sadly still no.
For the same reason your scope couldn't show a perfect square wave, the electronics in your CPC wasn't able to produce one in the first place. The transistors that make up the clock circuitry also have their limits when it comes to the frequencies they can handle. They also have limits to the time they need to switch on or off. Additional problems such as capacitance in the tracks of the PCB will mean that even the best intentioned square wave will have been considerably rounded off due to these factors. In extremely high speed systems, very expensive parts are needed to be able to create accurate clock signals at extremely high frequencies and even the PCB track layout will be optomised to reduce capacitance.

But my $2 Chinese logic analyser shows me a perfectly square clock signal!
Of course it does. Logic analysers only measure the voltage at intervals and display them as high or low depending on the reading. Then they draw a vertical line between the high/low dashes. This isn't a representation of what the wave looks like, just a digital state readout.

So does it matter that my clock signal is all curvy?
Usually not. The clock really only has two states, on (1) or off (0). The electronics doesn't really care whether it's rounded or not. All that matters are the two thresholds for 0 and 1. As long as the clock is going below the voltage threshold for a 0 and above the threshold for a 1 at the correct frequency and the duty-cycle (high/low ratio) is approx. 50%, it is doing its job properly. The only time the waveform shape is critical is if a single waveform was somehow crossing the thresholds more than once per cycle, if the clock wasn't crossing one of the thresholds at all, or if the clock had "jitter" (the wave length of each wave was varying). To counter act multiple crossings, designers will usually use gates with hysterisis (known as Schmitt Triggers) to filter out the unintended crossing.



* Bryce_RealSW.png
(17.55 kB, 640x420 - viewed 1277 times)



I hope that explained a bit about reading digital signals with a scope. Questions are of course welcome.

Bryce.

Further reading[/attach][/attach]
« Last Edit: 10:48, 26 February 18 by Bryce »

Offline keith56

  • ちび悪魔!
  • Supporter
  • 6128 Plus
  • *
  • Posts: 572
  • Country: jp
  • Part Ma, Part Aku... All Chibi!
    • Chibi Akumas Assembly tutorials
  • Liked: 927
  • Likes Given: 211
Re: Understanding Retro Electronics
« Reply #2 on: 00:43, 11 May 17 »
Fascinating post! I've been watching many of the eevblog videos recently, and am planning to buy an oscillosocpe soon, so your post has no doubt saved me a lot of time and confusion!

I'd be interested in seeing other posts or links to other tutorials on fault finding 1980's type hardware.
Chibi Akumas: Comedy-Horror 8-bit Bullet Hell shooter!
Learn ARM, 8086, Z80, 6502 or 68000 with my tutorials: www.assemblytutorial.com
My Livestreaming Channel: ChibiAkimas Live

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.852
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1031
  • Likes Given: 1124
Re: Understanding Retro Electronics
« Reply #3 on: 00:58, 11 May 17 »
Great great contribution! Thanks!!  :-*

Offline mr_lou

  • 6128 Plus
  • ******
  • Posts: 3.135
  • Country: dk
    • index.php?action=treasury
    • 8-bit Memoirs - a Blu-ray diskmag-like eBook about the 8-bit era
  • Liked: 1298
  • Likes Given: 2593
Re: Understanding Retro Electronics
« Reply #4 on: 06:29, 11 May 17 »
Can't be long now before you've written enough material like this to gather it all into a CPC Electronics book.....

LambdaMikel

  • Guest
Re: Understanding Retro Electronics
« Reply #5 on: 06:35, 11 May 17 »
My first oscilloscope was one of these "SeedStudio DSO Nano V3 Pocket Digital Storage Oscilloscope". I bought it because it was cheap (90 $), and because I was just starting with electronics last year. I wasn't even aware of its bandwidth... until I connected it to CLK on the CPC and only saw a Sine Wave  ;D The scope is fine for audio / analog signals I suppose, but not for digital. Now I have something better - a Hantek DSO6072P that can go up to 70 Mhz. It is only twice the price of the DSO Nano, and I am totally happy with it (couldn't believe the prices of some Tektronics scopes  :o ). The CPC CLK is sharp as square with it, and I am happy. Unbeatable for the price. I would say - if you want to do digital electronics, don't buy a DSO Nano. A digital logic probe will serve you better.

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.003
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3450
  • Likes Given: 6192
Re: Understanding Retro Electronics
« Reply #6 on: 09:58, 11 May 17 »
Look at that, it's not even 10am yet and I already learned something. I'm tagging this day as 'productive'.


I don't have much use personally, but it's very interesting because if nothing else it helps me better understand the vids I watch :)


Thanks!

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #7 on: 10:32, 11 May 17 »
I intend doing more short electronics tutorials over time as there seems to be quite a few people here looking to learn more electronics, but only if the subject has a direct relation to the CPC or retro repair. If there's any particular subject that anyone wants covered, then send me a PM.

Bryce.

@Gryzor: Sorry about that, I hope you had at least already got your first coffee in?

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #8 on: 11:01, 11 May 17 »
As there was some discussion here recently about the tapedeck and what all the op-amps there are doing, here's a pretty good video from Dave over on the EEVBlog that's well worth watching:
https://www.youtube.com/watch?v=7FYHt5XviKc

Bryce.

Offline tjohnson

  • Supporter
  • 6128 Plus
  • *
  • Posts: 874
  • Country: gb
    • index.php?action=treasury
  • Liked: 263
  • Likes Given: 220
Re: Understanding Retro Electronics
« Reply #9 on: 23:18, 11 May 17 »
Very useful post, thank you for taking the time to post this, please keep them coming.

Offline talrek

  • CPC6128
  • ****
  • Posts: 290
  • Country: fr
  • Liked: 201
  • Likes Given: 207
Re: Understanding Retro Electronics
« Reply #10 on: 09:11, 15 May 17 »
Very good initiative !!!! I like it !

Offline kribjo

  • CPC464
  • **
  • Posts: 39
  • Country: no
  • Liked: 9
  • Likes Given: 25
Re: Understanding Retro Electronics
« Reply #11 on: 13:51, 08 August 17 »
This is great Bryce.  :)


I don't know much about electronics, but posts like this which is both informational and educational are really appreciated. Thank you.


I hope you continue with posts like this (electronics stuff).


Bjørn
« Last Edit: 20:40, 08 August 17 by kribjo »

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #12 on: 13:45, 28 August 17 »
Humble Beginnings...

I just had another one of those annoying "electronics is such an expensive hobby" discussions with someone who seems to think that you need to spend a five figure sum on electronics equipment before you can build your first flashing LED circuit. You don't! In fact you'll often learn a lot more by NOT having a shed load of fancy equipment that you don't know how to use properly anyway.
So I went back into my store of old bits, just to let you know what I started with:

My first soldering iron. This actually belonged to my dad, but I used it for 4 or 5 years until I finally got to buy myself something more fitting for electronics. Yes, that small coin is a 2 Euro, just so that you can appreciate the size of this beast. At the time I was around 7 years old and this thing was almost the length of my arm. The handle is wooden and it's so heavy that I had to balance it by supporting the hot end with a screwdriver. Temperature control? Yes, it had hot (on) and cold (off) :)


* First_Iron.jpg
(72.83 kB, 800x600 - viewed 1076 times)


This is my first meter. No true RMS here, no data logging, min/max or anything even close to the options available today. It was my 8th birthday present and it was a mini-revolution for me. I was one happy 8 year old.


* First_Meter.jpg
(52.09 kB, 800x600 - viewed 1090 times)


This is my first scope. A lightening fast 10Mhz dual channel scope (actually it's a stereoscope, not a dual channel scope). I cut the neighbours grass for a whole year to afford this wonder of scientific measurement. It doesn't do SPI/I²C/UART decoding, it doesn't connect via USB. In fact it doesn't even have a defined trigger or any sort of measurement features, but it was enough.


* First_Scope.jpg
(53.03 kB, 800x600 - viewed 1117 times)


All three are still working. I wouldn't use them today, because I have better equipment, but I want to point out that you don't (despite advice from some experts) need the latest and greatest equipment to start out in electronics. The equipment above is all I had available when I designed and built my first ROMBoard, first radio, first transmitter and even some of my first test equipment to expand my measurement capabilities.

If you have the resources available to buy fancy equipment, then buy what you want (and learn how to use it properly), but even if you don't, a €50 scope, €20 meter and €15 iron will get you a long way and if you do decide to stick with the hobby you can upgrade along the way when your resources allow.

Bryce.
« Last Edit: 10:56, 26 February 18 by Bryce »

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.852
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1031
  • Likes Given: 1124
Re: Understanding Retro Electronics
« Reply #13 on: 00:52, 29 August 17 »
That must be the biggest soldering iron I have ever seen , Jesus!!  :-\  How did you manage to work with it? My first iron belonged to my dad too, but it was really small, so at least I could use it in an easy way. I still use it to cut plastic and it is here with me, in UK  :laugh:


The scope and the multimeter are really nice too. Actually, my first meter was very similar to that one, but less classy. The case was pale blue.

LambdaMikel

  • Guest
Re: Understanding Retro Electronics
« Reply #14 on: 08:38, 29 August 17 »
f you have the resources available to buy fancy equipment, then buy what you want (and learn how to use it properly)

... "learn to use it properly" is a good point I think... fancy equipment also has a pretty steep learning curve that might be overwhelming for the beginner. Sometimes less is more.

Offline ||C|-|E||

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 1.852
  • Country: gb
    • index.php?action=treasury
    • Mundo CPC
  • Liked: 1031
  • Likes Given: 1124
Re: Understanding Retro Electronics
« Reply #15 on: 12:04, 29 August 17 »
hahahaha, I am still amazed at the size of that iron  :laugh:

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #16 on: 15:38, 30 August 17 »
hahahaha, I am still amazed at the size of that iron  :laugh:

Well at least I always won the "mine is bigger than yours" arguments as a kid :D

Bryce.

Offline EgoTrip

  • 6128 Plus
  • ******
  • Posts: 1.051
  • Country: gl
    • http://egochip.blogspot.co.uk/
  • Liked: 677
  • Likes Given: 294
Re: Understanding Retro Electronics
« Reply #17 on: 18:51, 30 August 17 »
Well at least I always won the "mine is bigger than yours" arguments as a kid :D

Bryce.

Did you iron your clothes with it too?
EgoTrip's Stuff
EgoTrip's Stuff

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #18 on: 12:48, 31 August 17 »
No, but the city used to borrow it to repair railway tracks :D

Bryce.

Offline chinnyhill10

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.387
  • Country: 00
    • https://www.youtube.com/user/chinnyhill10
  • Liked: 767
  • Likes Given: 522
Re: Understanding Retro Electronics
« Reply #19 on: 12:53, 31 August 17 »
I found a cheap Chinese heat gun was useful for some tasks. Although I did open the case up first to check the metalwork was properly earthed!
--
ChinnyVision - Reviews Of Classic Games Using Original Hardware
chinnyhill10 - YouTube

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #20 on: 13:10, 31 August 17 »
If anyone is looking for a really really cheap multimeter, this one is easily the best in the extreme cheap range: http://www.ebay.de/itm/Digital-Multimeter-Spannung-Strommessgerät-9999-Zählung-AC-DC-Amperemeter-AN8008/232447770807

I wouldn't use it to measure anything close to the 1000V they claim or even 240V, but for low voltage electronics it's ideal. Make sure you get the AN8008 version and not a lesser featured 8002/4/6 version. It's got a really crisp LCD display and it seems to be pretty accurate. It has all the usual volts, amps (down to µA!), resistance, diode test and can even measure capacitance and frequency/duty cycle. It's no Fluke, but for the price it's a very good meter to get you started.

Bryce.

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.003
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3450
  • Likes Given: 6192
Re: Understanding Retro Electronics
« Reply #21 on: 16:52, 01 September 17 »
Great suggestion, thanks :)

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #22 on: 10:04, 17 October 17 »
Another short retro-relative video from Dave for all those itching to design some retro hardware:


https://www.youtube.com/watch?v=rfaCFEqk05M

Bryce.

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.775
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4237
  • Likes Given: 445
Re: Understanding Retro Electronics
« Reply #23 on: 10:43, 30 January 18 »
Another interesting video from Dave about retro computer hardware. This time he explains how PC analogue joysticks work.


https://www.youtube.com/watch?v=hMBbnWjbUAU


Bryce.

Btw: This isn't how the BBCs did analogue joystick reading.

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 16.003
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3450
  • Likes Given: 6192
Re: Understanding Retro Electronics
« Reply #24 on: 16:26, 30 January 18 »
Yup, that's already on my "watch later" list for tonight. I often miss the meaning of some of the stuff he says, but his pure joy at explaining things make even my SO sit and watch :D