DE0-Nano power

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Wed Sep 25, 2013 2:33 pm

danielj wrote:But as I said, I don't know whether power switch will work as the nano still ends up drawing power from the other powerlines - it certainly gets enough to make it show up on my M128 but it falls over repeatedly...
On my M128 it sometimes shows up without power but, yes, isn't strong enough to work.

Hmm, I'm terrible at tracing circuits. I don't see any powerlines connected on the 20pin. And the "use.html" documentation also implies no powerlines.

Code: Select all

Description 	Pin 	Pin 	Description
LV1 	1 	2 	GND
nRST 	3 	4 	D0
nTUBE 	5 	6 	D1
nIRQ 	7 	8 	D2
2MHzE 	9 	10 	D3
RnW 	11 	12 	D4
A2 	13 	14 	D5
A1 	15 	16 	D6
A0 	17 	18 	D7
LV2 	19 	20 	GND

Normally, the pins marked 'LV1' and 'LV2' are not connected. However, if there is no on-board regulator, a 0 Ohm resistor (on the backside of the PCB) may be used to connect the pin, which should then provide the 'low voltage' power (usually 3.3 V) to TubeSilencer. 
Where is this power coming from?
Rgds
Stephen

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

Re: DE0-Nano power

Post by 1024MAK » Wed Sep 25, 2013 2:36 pm

s1paulr wrote:Yeah, most utility ROMs go nuts when the Tube is enabled as they are trying to work out what is going on in the I/O processor. I have painstakingly gone through all my ROM images to find the ones that do work with the Tube enabled. If you are interested I could send a list of these.
It would be useful if you post such a list in a new thread ;-)

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: DE0-Nano power

Post by danielj » Wed Sep 25, 2013 4:00 pm

sweh wrote: Hmm, I'm terrible at tracing circuits. I don't see any powerlines connected on the 20pin. And the "use.html" documentation also implies no powerlines.

Where is this power coming from?
Sorry Stephen, typo on my part, I meant to write data/address/other lines but was distracted. Basically there is enough current leaking down the lines to power the nano, at least partially

d.

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

Re: DE0-Nano power

Post by 1024MAK » Wed Sep 25, 2013 4:31 pm

The power flows from any data/address or control lines that are logic one (high) through the protection diodes inside the chip to the positive power rail.
However, as the amount of current via this route is limited, devices that appear to power up do not, and will not work correctly.

Note that this problem is not limited to just this device or to Beeb's. Other hardware where two power supplies are used can also suffer the same problems. This can confuse the end user more than a little!

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Wed Sep 25, 2013 4:47 pm

Now my hardware ignorance is showing... In the "off" scenario, could we add a 4K7 resistor between the power connector on the NANO and Gnd? Would that act as a pull-down and drain the leakage?
Switch.GIF
Switch.GIF (8.12 KiB) Viewed 152 times
Rgds
Stephen

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Thu Sep 26, 2013 12:19 am

And... this appears not to work.

On the model B I currently have this plugged into, if there's no power to the NANO then the Beeb hangs after displaying the normal "BBC Computer" prompt. I guess there's enough on the bus to make it think there's something talking, but not enough power to make it actually work.

I directly connected the GND of the TubeSilencer to the +v of the NANO. And... it still hung.

I guess there's something more than just power. Hrrmmm...
Rgds
Stephen

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: DE0-Nano power

Post by danielj » Thu Sep 26, 2013 6:18 am

sweh wrote:And... this appears not to work.

On the model B I currently have this plugged into, if there's no power to the NANO then the Beeb hangs after displaying the normal "BBC Computer" prompt. I guess there's enough on the bus to make it think there's something talking, but not enough power to make it actually work.

I directly connected the GND of the TubeSilencer to the +v of the NANO. And... it still hung.

I guess there's something more than just power. Hrrmmm...
The actual power input (both from the pins and the usb port) for the nano flows through a voltage regulator that takes it down to 3.3V for the FPGA. The 3.3V that is leaking across from the data/address lines within the FPGA that powers it won't go back through the regulator to the power pins so whatever you're doing there won't have any effect on what's going on on the 3.3V side of the circuit.

Save for pushing the 20 lines for the tube silencer->nano through one of those parallel port switches so it gets properly disconnected I don't think you're going to have much joy.

d.

User avatar
hoglet
Posts: 7355
Joined: Sat Oct 13, 2012 6:21 pm
Location: Bristol
Contact:

Re: DE0-Nano power

Post by hoglet » Thu Sep 26, 2013 7:00 am

Is the idea here to end up with a physical switch that will prevent the Beeb from recognising the DE0-Nano on reset?

Another way to achieve this might be to build this capability into the FPGA design. I don't thing John has release the VHDL Source Code for this project, he would need to be persuaded to add this.

Dave

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Thu Sep 26, 2013 1:18 pm

hoglet wrote:Is the idea here to end up with a physical switch that will prevent the Beeb from recognising the DE0-Nano on reset?
Pretty much, yeah. Continuously removing the cable, inserting the cable isn't friendly and is likely to cause damage
Another way to achieve this might be to build this capability into the FPGA design. I don't thing John has release the VHDL Source Code for this project, he would need to be persuaded to add this.

Dave
I've mailed him, asking. My thought was that he could monitor a couple of pins on GPIO0 (the one he isn't using) and if they're connected then disable the co-pro. It'd be easy to extend those pins to a switch. I didn't want to use the onboard switches 'cos they're not easy to get at if we want to put the nano into a case.
Rgds
Stephen

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: DE0-Nano power

Post by danielj » Thu Sep 26, 2013 4:52 pm

Oooh, good idea. Let us know what he says :)

d.

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Thu Sep 26, 2013 8:35 pm

John thinks he could easily make the "slowest speed" setting on the DIP switches mean "disable tube detection". This would provide a way of disabling the co-pro without needing to disconnect it.

My gut feeling is that this is better than nothing, but it's not "friendly"; if we want to put it in a case then getting to the DIP switches (not easy, at the best of times) becomes a chore.

What do others think?
Rgds
Stephen

User avatar
danielj
Posts: 6366
Joined: Thu Oct 02, 2008 4:51 pm
Location: Manchester
Contact:

Re: DE0-Nano power

Post by danielj » Thu Sep 26, 2013 8:40 pm

Personally I'll be leaving as is (the lowest speed is best for ELITE :D), but I guess it's better than nowt? Other than the Toolkit+ ROM, has using a software disable actually caused probs with anything else?

d.

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

Re: DE0-Nano power

Post by 1024MAK » Thu Sep 26, 2013 9:58 pm

So, I have just had a quick look at the Beeb schematic. The line that "selects" the second processor on the "tube" (as far as the Beeb is concerned) is /TUBE (or nTUBE) on pin 8 of the tube connector.

To disable a system plugged in to the tube connector, you could cut or break this line (cut a track or cut the core in the ribbon cable). Add an on/off switch across the break. Then on the second processor / DE0-Nano side, add a 4.7k pull-up resistor to +5V.

Now the OS on the Beeb will try to communicate with the second processor, but the second processor will never see /TUBE go low, so will not respond. Hence the Beeb should operate as if there is no second processor connected.

It may help if the DE0-Nano is powered up, as this will reduce the loading on the CPU address bus and data bus (the TUBE connector address and data lines are not buffered and are electrically connected to the CPU).

Mark

PS And no I have not tried this yet, have only just thought this idea up tonight.
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Thu Sep 26, 2013 10:09 pm

Something like this?
switch.gif
switch.gif (9.58 KiB) Viewed 152 times
I'm happy to leave the power to the nano on; it's not much of a drain. A logical "off" is good enough :-)
Rgds
Stephen

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

Re: DE0-Nano power

Post by 1024MAK » Thu Sep 26, 2013 10:42 pm

I was actually thinking of this arrangement...
Switched line w pull-up.png
Switched line w pull-up.png (1.15 KiB) Viewed 152 times
This way, the "output" line can never float.

Mark



The following images/attachments are for image testing on the forum only:
Switched line w pull-up e2.png
Switched line w pull-up e2.png (1.09 KiB) Viewed 152 times
Switched line w pull-up e2.jpg
Switched line w pull-up e1.gif
Switched line w pull-up e1.gif (2.05 KiB) Viewed 152 times
Switched line w pull-up e3.png
Switched line w pull-up e3.png (3.54 KiB) Viewed 152 times
End
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
retroclinic
Posts: 3018
Joined: Thu Jul 03, 2008 1:22 pm
Location: East Riding of Yorkshire
Contact:

Re: DE0-Nano power

Post by retroclinic » Fri Sep 27, 2013 10:56 am

Hmm, better to do this, as 4k7 may not be enough to pull the voltage down....
switch.jpg
switch.jpg (11.04 KiB) Viewed 152 times
That way, there is no permanent resistance on when the nano is powered, and a strong 4.7 Ohm pull down when it is off. You need to ensure you use a break-before-make switch as well.

Mark.

Edit to mods - how do I get the JPG attachment to show as a picture? I thought it did JPGs automatically?
Image

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

Re: DE0-Nano power

Post by 1024MAK » Fri Sep 27, 2013 11:04 am

retroclinic wrote:Hmm, better to do this, as 4k7 may not be enough to pull the voltage down....
switch.jpg
That way, there is no permanent resistance on when the nano is powered, and a strong 4.7 Ohm pull down when it is off. You need to ensure you use a break-before-make switch as well.
@ Mark - me thinks you need to read through the thread again :roll:
The posts since this one are talking about holding an active low control line high so that the second processor circuitry and Beeb ignore one another... (not that this has been tested yet mind).

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Fri Sep 27, 2013 11:15 am

I'm probably confused as to the direction of /TUBE; is this an output from the Beeb or an input to the Beeb? I thought it was an output, so I did my switch that way (nano on the common pin). if it's an input then /TUBE of the Beeb would on the common pin instead.

(Told ya I not a hardware guy :-))
Rgds
Stephen

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

Re: DE0-Nano power

Post by 1024MAK » Fri Sep 27, 2013 1:23 pm

/TUBE is an output from the Beeb.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Fri Sep 27, 2013 1:49 pm

So, surely then, we want the input to the nano to be the one that connects to +5V if the connection is broken ("off"); wouldn't my switch do that?

Your version would appear to connect /TUBE on the beeb side to +5V via a 4K7 when the tube is "on". Why wouldn't this leave the line in an a mid-way state? Or is this a trick to hardware design that I just don't get (being a hardware ignoramus)?
Rgds
Stephen

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

Re: DE0-Nano power

Post by 1024MAK » Fri Sep 27, 2013 2:19 pm

If the switch is operated when everything is powered down, no problems occur with either design.
In theory if the switch worked perfectly and it was operated while the sysyem was powered up, again both designs would be okay.
However, in practice switch contacts take time between breaking and making. And even when the contacts do make, the contacts often "bounce" (made and break lots of times in typically 10 to 250mS). This may or may not cause problems with an input that is not designed to cope with this problem. Remember computer logic chips are fast enough to see this effect.

The /TUBE control line comes from a 74LS138 logic chip in the Beeb. This has an output that is more than capable of pulling the voltage low. So it has no trouble driving the /TUBE line with the 4.7k resistor wired as shown. Indeed if needed, such an output could drive a LED.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Fri Sep 27, 2013 8:09 pm

It's odd... I don't have many 40 pin cables any more! Since IDE cables got replaced with 80 pin UDMA cables, I'm short of 40 pins!

So I ransacked a couple of "dispose" machines at work and grabbed a couple. I'm gonna see what I can learn.

Also been chatting a bit more with John. He likes the DIP switch solution 'cos it's something people can use without additional hardware. I like the GPIO switch solution 'cos it's something we can put into a case.

So we compromised on "both"; if DIP set _OR_ GPIO switch closed then disable tube. I think that'll work :-)

However he hasn't committed to any time to deliver 'cos he's very very busy on real-world work and (of course!) that takes priority. Totally understandable.

So in the mean time I'm gonna see what I can do with the /TUBE line as a proof of concept :-)
Rgds
Stephen

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Fri Sep 27, 2013 9:20 pm

1024MAK wrote:However, in practice switch contacts take time between breaking and making. And even when the contacts do make, the contacts often "bounce" (made and break lots of times in typically 10 to 250mS). This may or may not cause problems with an input that is not designed to cope with this problem. Remember computer logic chips are fast enough to see this effect.
Given that the computer would need to be reset after throwing the switch, anyway, is this a big deal?
Rgds
Stephen

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Fri Sep 27, 2013 11:52 pm

1024MAK wrote:So, I have just had a quick look at the Beeb schematic. The line that "selects" the second processor on the "tube" (as far as the Beeb is concerned) is /TUBE (or nTUBE) on pin 8 of the tube connector.

To disable a system plugged in to the tube connector, you could cut or break this line (cut a track or cut the core in the ribbon cable). Add an on/off switch across the break. Then on the second processor / DE0-Nano side, add a 4.7k pull-up resistor to +5V.

...

PS And no I have not tried this yet, have only just thought this idea up tonight.
So today I sacrificed an old IDE cable; cut cable 8 and let it float. With the cable cut the copro was not detected and the Beeb ran just as if it was not plugged in (Toolkit Plus *STATUS even worked). I wrapped the two halves of the cable back together, control-break and it's detected again. Unwrap them, control-BREAK and it's no longer detected.

The concept looks good to me!
Rgds
Stephen

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Sat Sep 28, 2013 10:45 pm

1024MAK wrote:So it has no trouble driving the /TUBE line with the 4.7k resistor wired as shown. Indeed if needed, such an output could drive a LED.
Where would such an LED be put? Something like this?
switch.jpg
Rgds
Stephen

User avatar
retroclinic
Posts: 3018
Joined: Thu Jul 03, 2008 1:22 pm
Location: East Riding of Yorkshire
Contact:

Re: DE0-Nano power

Post by retroclinic » Sat Sep 28, 2013 10:53 pm

1024MAK wrote:
retroclinic wrote:Hmm, better to do this, as 4k7 may not be enough to pull the voltage down....
switch.jpg
That way, there is no permanent resistance on when the nano is powered, and a strong 4.7 Ohm pull down when it is off. You need to ensure you use a break-before-make switch as well.
@ Mark - me thinks you need to read through the thread again :roll:
The posts since this one are talking about holding an active low control line high so that the second processor circuitry and Beeb ignore one another... (not that this has been tested yet mind).

Mark
Hmm yes, ok, I see what's being tried, I assumed the system worked as a "proper" second processor, in that it was disabled when powered down.
Image

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

Re: DE0-Nano power

Post by 1024MAK » Sun Sep 29, 2013 9:24 am

sweh wrote:
1024MAK wrote:So it has no trouble driving the /TUBE line with the 4.7k resistor wired as shown. Indeed if needed, such an output could drive a LED.
Where would such an LED be put? Something like this?
Image
No [-X
My earlier post was written to try to explain that a 74LS138 output pin was powerful enough to "supply" enough current to light a LED when the output was low.

This is the circuit:
LED logic low.jpg
LED logic low.png
LED logic low.png (2.89 KiB) Viewed 152 times
IC1 (74LS138N) is the chip in the Beeb. Resister R2 is included to limit the LED current. In this case, if a red or green standard LED is used the current will be about 7.7mA.

I have put the word supply in quotes because in practice the 74LS138 output pin is actually providing a path to ground rather than producing a "positive" output current.

If a standard LED is used, as the 74LS138 output pin is rated for 8mA in this configuration, it can affect the logic level (by logic level, I mean the defined voltages as per the TTL specifications, logic low is between 0V and 0.8V, and logic high is between 2V and 5V). This is not a problem if the only function required is a LED.

If however, the 74LS138 output pin is required to control a LED and provide a good logic level to another chip, then either an additional circuit known as a buffer (also known as a driver) is needed, or alternatively a high efficiency low current LED can be used.
Switched line w pull-up & LED.jpg
Switched line w pull-up & LED.png
Switched line w pull-up & LED.png (2.31 KiB) Viewed 152 times
Now resistor R2 is 1.5k, so with a red or green high efficiency low current LED, the current is about 2mA.

Now I presume you are after an indicator to show if the second processor is active?
If a LED is added to the /TUBE control line, it will only light when the 6502 CPU in the Beeb reads from or writes to the second processor. Depending on how much data is being transferred, you may see it flicker on, but without having tried this, the results may be disappointing.

One other thing that I really should have mentioned earlier. The TubeSilencer chips are of the CMOS type. These can give unpredictable results if an input line is left floating (disconnected without a defined logic level) as the wire to them acts as an aerial (CMOS inputs are high impedance - a very, very low current can affect them when an input is floating). And yes I know this is hard to understand.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Sun Sep 29, 2013 11:04 am

1024MAK wrote:Now I presume you are after an indicator to show if the second processor is active?
If a LED is added to the /TUBE control line, it will only light when the 6502 CPU in the Beeb reads from or writes to the second processor. Depending on how much data is being transferred, you may see it flicker on, but without having tried this, the results may be disappointing.
Ah, OK. Would it make sense for me to use a double-throw switch instead, then, and have the second switch circuit just have a simple +5 ...resistor ... LED ... Gnd setup?

Hmm, checking my box of stuff, the only LED I have is one of these. Possibly not suitable.
One other thing that I really should have mentioned earlier. The TubeSilencer chips are of the CMOS type. These can give unpredictable results if an input line is left floating (disconnected without a defined logic level) as the wire to them acts as an aerial (CMOS inputs are high impedance - a very, very low current can affect them when an input is floating). And yes I know this is hard to understand.
I did notice that just touching the wire with a multi-meter probe was enough to cause odd effects :-) Definitely seems that I need to pull up the input if it's not connected to the Beeb.
Rgds
Stephen

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

Re: DE0-Nano power

Post by 1024MAK » Sun Sep 29, 2013 11:45 am

sweh wrote:Would it make sense for me to use a double-throw switch instead, then, and have the second switch circuit just have a simple +5 ...resistor ... LED ... Gnd setup?
Yes I think that would be a better approach :D

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
sweh
Posts: 1933
Joined: Sat Mar 10, 2012 12:05 pm
Location: New York, New York
Contact:

Re: DE0-Nano power

Post by sweh » Tue Oct 01, 2013 6:15 pm

So I put together a "3 function" circuit.

On the tubesilencer I soldered a couple of header pins; on 0V and 5V. This power goes to a small piece of vero-board. I soldered 4 pins to the vero-board; connected to two middle ones (for ground) then ran the two outer ones to the switch. This gives me a simple on-off circuit. So power from the silencer->board->nano. function 1="I can switch power on and off".

On the switched side of circuit I also added an LED+resistor. function 2="When the power is turned on the LED lights up."

Finally on the second switch (it's a DPDT) I simply stuck two wires. This connects to pin 8 of the cable. (that's function 3; make/break /TUBE).

At the moment I'm not pulling this high but I decided "black" goes to beeb, and "green" goes to nano, so I could in theory either connect the unconnected side of the switch via a resistor to +5 (so it's pulled high when the switch is broken) or do what Mark suggested and have it permanently connected. Either is do-able.
tube-silencer-power.jpg
switch_1.jpg
switch_2.jpg
Why did I do it this complicated way? Basically there is nothing soldered directly to thetube silencer nor the nano. It's all "plug in".

If I can get a small IDE extension cable (or build one; damn; I don't have any 40-pin sockets!) then this can all go into a black box with a socket, switch, LED being exposed.

(EDIT: damn, just realised that I can't mount the LED like that! I'll need to unsolder it!)
Rgds
Stephen

Post Reply