Weird behaviour with simple BASIC program

discuss both original and modern hardware for the bbc micro/electron
User avatar
daveejhitchins
Posts: 6081
Joined: Wed Jun 13, 2012 6:23 pm
Location: Newton Aycliffe, County Durham
Contact:

Re: Weird behaviour with simple BASIC program

Post by daveejhitchins » Fri Oct 02, 2020 5:29 pm

Well . . . Confession time :oops:

I knew and know all about the diode, why it's needed and how it works . . . So, how did I make the same error e.g. placing the diode across the transistor instead of the coil. Basically I'd just been reading the ARA Handbook (American Radio Society) which shows exactly the same error, in a schematic for a transceiver, as the Acorn issue 3 schematic . . . No excuses at all! This was a design for a down converter for an Israeli company called Harmonic Light Waves. Fortunately we only ever had "1" failure :roll:

I didn't really get into too much bother about the mistake as virtually the whole design team had reviewed the schematic in VERY great detail!!

Dave H.

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Fri Oct 02, 2020 6:25 pm

Haha, I won't hold it against you!

I guess the best way to fix this is to add an additional diode ... this time across the relay. I am wondering if I can get away with doing on on the keyboard end since it is much less crowded there than the main logic PCB. I don't have a schematic of the keyboard though so I am not sure.

Looking at the attached snippet of the (corrected) schematic, it seems the diode needs to be from CAS LED to +5V, which makes me think I can do it more neatly at the keyboard end and not have to solder on my fairly pristine Issue 3 board.
Attachments
Screenshot from 2020-10-02 13-22-37.png
Portion of schematic

User avatar
MartinB
Posts: 5357
Joined: Mon Mar 31, 2008 10:04 pm
Location: Obscurity
Contact:

Re: Weird behaviour with simple BASIC program

Post by MartinB » Fri Oct 02, 2020 7:38 pm

You should always mount such protection diodes as close - physically - to the relay coil as possible to ensure maximum effectiveness and to minimise EMC. If you solder it on the back of the board across the two relay coil soldered connections, you won't be 'spoiling' anything. Locating it remotely is not a good idea.

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Fri Oct 02, 2020 7:58 pm

I guess I will do it more 'locally' then.

I was being lazy and seeing if I could do it without even taking the board out of the case.

julie_m
Posts: 274
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Weird behaviour with simple BASIC program

Post by julie_m » Tue Oct 06, 2020 2:58 pm

There's nothing wrong with using a Zener diode across the collector and emitter of a transistor which is being used to switch an inductive load; but it must have a PIV somewhere between the supply voltage and the PIV of the collector-base junction.

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Tue Oct 06, 2020 6:57 pm

I have procured some diodes, but I have yet to attempt to install one. Soon!

1N4148 is not a zener though.

User avatar
MartinB
Posts: 5357
Joined: Mon Mar 31, 2008 10:04 pm
Location: Obscurity
Contact:

Re: Weird behaviour with simple BASIC program

Post by MartinB » Tue Oct 06, 2020 10:35 pm

The 1N4148 D13 non-zener diode as shown in the Beeb circuit diagram is intended to suppress the back emf at source (at the relay) such that in addition to protecting the transistor and LED, it will also minimise perturbations that may adversely affect anything else sitting nearby on the same 5v rail as the relay.

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Thu Oct 08, 2020 2:59 am

I think I need to add a diode as shown in the attached image - with the cathode attached to the collector of Q3 and the anode going to the nearby 5V rail. Look okay, before I get soldering?
Attachments
IMG_0136.jpg

User avatar
1024MAK
Posts: 10475
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Weird behaviour with simple BASIC program

Post by 1024MAK » Thu Oct 08, 2020 8:44 am

The diode must be installed with the cathode connected to the +5V / VCC supply. On most axial diodes, the cathode end is indicated by a white or black band at one end of the body. If you get the polarity wrong, it will blow up the diode and the transistor as soon as the computer tries to switch the relay on.

Remember, in normal use the diode is reverse biased and does not conduct.

Mark

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Thu Oct 08, 2020 3:58 pm

Yep will be sure to make sure it is normally reverse biased or it will cause some magic smoke for sure. I will double check with the multimeter rather than just trusting the markings on the diode.

(I just realized I got cathode and anode back to front in the my previous message - ooops!!)

User avatar
Bobbi
Posts: 605
Joined: Thu Sep 24, 2020 12:32 am
Contact:

Re: Weird behaviour with simple BASIC program

Post by Bobbi » Sat Oct 10, 2020 3:24 am

I figured before I attempted to solder anything on the mainboard I would replace the LED on the keyboard PCB and solder a 1N4148 diode across the LED (in the opposite sense - anode to cathode / cathode to anode) to protect the LED against back EMF.

Turns out this is enough to prevent my test program from crashing the system, so this fix is good enough for me.

Soldering looks really ugly in closeup! Looks better to the naked eye ;)
IMG_0148.jpg
IMG_0147.jpg

Post Reply

Return to “8-bit acorn hardware”