Alternative Econet analogue circuits

discuss both original and modern hardware for the bbc micro/electron
Post Reply
User avatar
arg
Posts: 1293
Joined: Tue Feb 16, 2021 2:07 pm
Location: Cambridge
Contact:

Alternative Econet analogue circuits

Post by arg »

While it is still feasible to use the traditional (75159/LM319-based) Econet analogue circuit on modern designs, it has some limitations:
  • The 75159 is notionally still 'in production' with TI, but if you actually buy some you find that they are old stock. It seems likely that no more will ever be made and they will eventually become unavailable (as has already happened, ironically to the equivalent part used on later Acorn products, 26LS30).
  • The parts are somewhat expensive
  • PCB area consumed is not small.
  • A regulated 5V power rail is needed, often not already present on modern designs (even if USB powered, USB Vbus may be as low as 4.4V f plugged into a passive hub).
So, I've been considering alternatives and offer my current proposed design for comment. I'm particularly interested in using it to accompany my Econet implementation using the RP2040 PIO in place of the 6854 ADLC, but it could in principle apply to any modern Econet design.

My objectives are:
  • 100% compatibility with classic Econet
  • 3.3V power supply
  • Cheap and easily-available parts, particularly with respect to JLCPCB availability/pricing
  • Given the modern requirement for primarily 'table top' ad-hoc networks, providing on-board clock/terminators is desirable.
  • Reasonably low power.
This is what I have, providing the standard 5 Econet host signals - TxD, RxD, Clock, Tx_enable, Collision_detect:
Econet-analogue.pdf
(238.01 KiB) Downloaded 52 times
There are several elements to this:

Line drivers/receivers
This is the easy part. Econet voltage levels have always been RS-422, just with a higher input impedance to permit a larger number of stations than RS-422's 32. There's lots of RS-422 transceiver chips around; older ones will have the 32-station limit, but there are plenty available that are "1/4 load" or "1/8 load" compared to traditional RS-422 and so support up to 256 stations. And there are 3V3 powered versions: they use FET output stages to achieve equivalent voltage levels to traditional 5V parts with bipolar output stages.

Lots of parts to choose from, though some are expensive. I've settled on the 65HVD75: these are reasonably cheap (about 50p for the genuine TI parts, or even less for the Chinese knock-offs with the same part number). They are a "3/20 load", so not quite as good as the "1/8 load" parts you can get, but that still allows up to 200 stations per network which I consider sufficient.

I have tested these and they work well, giving output levels indistinguishable from classic parts.

Each device gives one driver and one receiver, so two needed in total and that gives you a driver for a clock output "for free". They have separate pins for Tx/Rx, but on this particular design I'm using an RP2040 so a single pin on there can be either a PWM output to drive the clock or an input if this station isn't the clock source - and the Rx logic can read the pin state either way. So I have the two linked together for CLK_IO, where other designs might want to split them into CLK_IN and CLK_OUT.

Collision detection

Unfortunately, the standard chips don't give you CD. Some people believe CD isn't needed, in which case the two 65HVD75 chips are all you need for the complete interface. However, I believe CD is somewhat important - though it's less necessary to be 100% equivalent to the original since the original wasn't always fitted and (I suspect) wasn't always completely successful in detecting collisions. Something that works well in typical conditions is acceptable, even if it diverges from the original (maybe better, maybe worse) in extreme conditions. This opens up the option for something that works in a different way.

The traditional circuit is voltage-based - a collision is detected if the voltage on the line is smaller than the expected level due to two drivers driving in opposite directions. This circuit is current-based - a collision is detected if the line driver draws more current due to 'fighting' with another line driver rather than the expected current driving into the termination. As a historical note, Lawrence Hardwick tells me that the original 'drawn on a napkin over dinner' Econet suggestion from Andy Hopper was current based, but when he (Lawrence) came to implement it the voltage approach turned out to be easier/cheaper to get to work.

In principle the voltage-based circuit gives you more information - when not transmitting you can tell if the line is driven actively to the idle state or not; this was unsuccessfully used in Econet V2, but all current Econet (since 1982) only uses the CD when transmitting and so this is not a problem with the current-based approach.

I have prototyped an earlier version of this and the principle is sound, but there are some snags. You would think naively that a line driver driving into a constant termination would draw a constant current (perhaps with some spikes at the bit boundaries), and driving into a collision would be much higher than that, so you could smooth off the spikes and use a fixed threshold value: above the threshold is collision, below is normal. Or just look for ripple: during a collision, the current will be unusually low when both stations are driving the same bit value and unusually high when driving opposite values.

Unfortunately, it's not that simple: the normal value varies significantly between '1' and '0' bits due to the asymmetric termination, and the absolute value will vary depending on the exact type of termination (classic Acorn, SJ, other modern designs), how many terminators there are, and cable type/length. A single threshold value would probably work a bit - you'd have to make it fairly high to avoid false triggering on a short network with 100R terminations, and it would then fail on a long network with SJ terminators or a short network with only one terminator (BTW, I doubt that the classic circuit reliably detects collisions between distant stations on a long network).

So, the circuit here is straightforward with a sense resistor in the line driver power (1R is acceptably small against the 50R expected load on the output of two cables at 100R impedance, each terminated 100R). That's then amplified to give a voltage inversely proportional to the current, and I've hedged my bets on thresholding it. I have a simple comparator, but the reference is a voltage derived from a PWM output on the micro, and the raw value is also fed to an ADC input. So the software can simply set a fixed threshold value, or software can do calibration at startup (or on suspicious results) and set a variable threshold value, or software can read the ADC continuously during Tx of the scout packet and apply more complex algorithms.

More testing/software work is needed here, but I am fairly confident this will ultimately yield good results.

I've cheated somewhat to save cost: originally I had a nice current sense amp chip here (INA381, providing both the current sense and the threshold comparator), but instead I've gone for a super-cheap opamp (~10p for 4 channels) which only works because I happen to have a nominal 5V rail to power it from. However, it just needs a bit of headroom above 3V3 so should still be OK if that '5V' is actually a Vbus at 4.4V. This is partly driven by wanting some opamps for my, arguably overdesigned, termination circuit; maybe for the plain station circuit the extra cost of the INA381 is worth it.

Clock and terminator

BITD, I was strongly against on-board clock/terminator arrangements, especially that of the FileStore with it's "automagic" configuration that inevitably resulted in it turning on when you didn't want it and stuffing up the network. But that was in the era of multi-room, permanently installed networks where the extra cost of dedicated clock and terminator was trivial and the convenience of knowing that there was always precisely one clock, permanently powered, was invaluable. Nowadays, table-top networks with ad-hoc combinations of stations predominate, and it seems sensible to have a clock/terminator in every station - just make sure they are clearly and explicitly enabled so you can tell what is going on!

Here, I've gone for software enable/disable, with LEDs to indicate the state and avoid FileStore-style swearing. I'm still not sure whether that's actually better than doing it with DIP switches. There always needs to be a software configuration for the clock speed/mark-space ratio, and the software needs to know that it's enabled if saving a pin by making the clock pin bidirectional (originally on this design the enable pins were on an I/O expander and so the saving of one precious RP2040 GPIO pin was still realised even though it takes an extra pin for the enable; as it happens, that's no longer true on this particular board). So the DIP-switch isn't that much of a saving, and especially so if you want to make it just one switch rather than several.

Providing the offset clock needed to drive SJ-style phantom-powered terminators is difficult, especially using the driver that 'comes for free' in the clock receiver, and I consider that this design is strictly intended to clock/terminate tabletop networks. If you have a network large enough to have remote, standalone, terminators then you should use a dedicated clock too (and Beebmaster will happily sell you one); conversely, if it's a tabletop network then you can clock and terminate in the same station if necessary.

The clock part of this is obvious - just enable the driver and set up a PWM in the micro to generate the appropriate waveform.

For termination, what you are aiming to achieve is a 100R AC impedance across the lines for both clock and data, plus a DC voltage offset between the two data lines of about 0.4V. All the existing circuits have some drawbacks:
  • The very original Acorn design used germanium diodes to create the offset voltage, and capacitors to provide short-circuit that at AC, with the 100R then being provided by a pair of 47R series resistors. This has the disadvantage that the capacitors (if not infinitely large) can get charged up by a long string of zero bits in a packet and take time to settle back to the right voltage at the end of the packet. Also, germanium diodes are not ideal in a modern design.
  • The SJ terminator design (copied in later Acorn terminators) uses a network of resistors and assumes that the power supply is zero impedance (supplemented in the actual phantom-powered terminators by a capacitor). This suffers less from the 'reverse charging' problem, but it actually provides too high a terminating impedance (I can't remember why that was chosen, but I suspect there simply isn't enough power available from the clock to drive the correct impedance). While this evidently worked in practice, I don't like implementing something that's 'wrong' in a new design.
  • A version similar to the SJ circuit but locally powered and with the resistor values scaled to give the right impedance (100R) should be satisfactory (I believe some of Ken Lowe's designs do this). However, that consumes quite a lot of power: 3.3V and a 470R-120R-470R string gives about the right impedance and voltage, but consumes 3mA whether in use or not.
So this version generates the reference voltages with a much larger resistor string and uses opamps to deliver them at low impedance, with a pair of 56R series resistors to provide the desired approx 100R impedance. The clock side is just a pair of 56R without the bias. Current consumption should be negligible when turned off and small even if turned on with no traffic.

That's straightforward enough, but then it needs turning on and off - needing to apply no load even if the applied clock/data has an offset to it (eg. from an SJ clock. I used an analogue switch chip on an earlier design which worked OK, but is only legitimate if the pin voltages are within the power rails - which they might not be, particularly with an SJ clock (typically 5.5V if terminated, could be as much as 7V unloaded). So I've gone for simple FETs. Trouble then is that the gate voltage to turn them on needs to be threshold above the highest possible applied voltage, so 3.3V is not nearly enough; even doubling that for 6V is still not enough even with expensive low-threshold FETs. Final option is cheap 2N7002 FETs and a diode tripler to generate the (very low current) 9V to turn them on. The tripler is driven by the same PWM that sets the CD threshold level - could have used any source of pulses here, such as the econet clock itself.

I'm sure this will all work, and is in fact pretty cheap, but looking at it again after a year I'm not sure I can justify the complexity.
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

Thanks for posting. There's a lot to take in here, but one thing I would request is that you consider implementing the extended 'Blundell' standard, and in particular, leave pins 3 & 6 on your RJ45 connectors floating (actually, connect 3 to 3 & 6 to 6 to allow pass through from one connector to the other), so if plugged into one of my 11 port hubs or the PiEconetBridge it doesn't disable the remote power function?

viewtopic.php?p=365397#p365397
User avatar
arg
Posts: 1293
Joined: Tue Feb 16, 2021 2:07 pm
Location: Cambridge
Contact:

Re: Alternative Econet analogue circuits

Post by arg »

KenLowe wrote: Sat Aug 19, 2023 10:47 pm Thanks for posting. There's a lot to take in here, but one thing I would request is that you consider implementing the extended 'Blundell' standard, and in particular, leave pins 3 & 6 on your RJ45 connectors floating (actually, connect 3 to 3 & 6 to 6 to allow pass through from one connector to the other), so if plugged into one of my 11 port hubs or the PiEconetBridge it doesn't disable the remote power function?
OK. I did briefly look at this at the time and concluded I couldn't sensibly use the remote power, so I thought grounding both was how to indicate "I'm not playing". Or does that disable the power on all of your ports if any one says "no"?

Reading that again, you now seem to be offering 450mA, so maybe I could usefully be powered by this mechanism (I can't now remember exactly why I thought not at the time). One issue is what to do for pass-through: this particular board is the 1MHz bus adapter, which has to have RJ45 sockets because 5DIN won't fit under the keyboard, but it has two of them wired in parallel and one pointing left, the other pointing right. So you could have a row of BBCs with these fitted daisy-chained with RJ45 cables, and no constraint on how much power they are using. But if you already parallel them between your 11 ports I suppose this would be the same.
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

arg wrote: Sun Aug 20, 2023 9:12 am I did briefly look at this at the time and concluded I couldn't sensibly use the remote power, so I thought grounding both was how to indicate "I'm not playing". Or does that disable the power on all of your ports if any one says "no"?
That's correct. If one says 'no' that will switch power off to all. So, at the very minimum, even if you don't use the power, it would be helpful if your board didn't disable it for others.
arg wrote: Sun Aug 20, 2023 9:12 am Reading that again, you now seem to be offering 450mA, so maybe I could usefully be powered by this mechanism (I can't now remember exactly why I thought not at the time).
Yes, I was just about to edit my post to make that point. If going down that route you might need to add an extra resistor to the Vsense line to request power. This would only be required if nothing else on the network has already requested power. If connecting to one of my 11 port hubs, you wouldn't need this, because the hub already has the sense resistor. But if connecting directly to the Bridge, you would need this, because the Bridge doesn't have the sense resistor.
arg wrote: Sun Aug 20, 2023 9:12 am One issue is what to do for pass-through: this particular board is the 1MHz bus adapter, which has to have RJ45 sockets because 5DIN won't fit under the keyboard, but it has two of them wired in parallel and one pointing left, the other pointing right. So you could have a row of BBCs with these fitted daisy-chained with RJ45 cables, and no constraint on how much power they are using. But if you already parallel them between your 11 ports I suppose this would be the same.
Yes, that could become an issue in both cases.
User avatar
arg
Posts: 1293
Joined: Tue Feb 16, 2021 2:07 pm
Location: Cambridge
Contact:

Re: Alternative Econet analogue circuits

Post by arg »

Right, I've now spent a _long_ time reading those old threads, as I couldn't find clearly stated anywhere what the final, final, spec for the power pins was.

As I now understand it:
  • Pin 3 is Vsense. This has a window comparator at the source end, and a weak pull-up: if at 5V (due to the pull-up) or GND then the output is disabled, only if it is pulled down to a mid voltage is the output enabled. 4K7 is the preferred pull-down.
  • Pin 6 is Vout, somewhere near +5V if enabled. But quite limited due to series resistance of the cable.
On the face of it, this doesn't really work for paralleled/daisy-chained consumers: too many 'enable' resistors in parallel ends up turning it off again!

However, some rough calculation (I haven't simulated it properly) suggests that the voltage with 4K7 pull-down is about 1.25V. So if instead of the 4K7 pull-down we put a pair of silicon diodes in series, you could have multiple consumers wired in parallel and it would still work.

This leaves various options for my board:
  1. Leave pins 3,6 open. I'm not playing, but don't spoil the game for anyone else.
  2. Pass pins 3,6 through my board but don't connect to them. Allows, say, a terminator at the far end of a string - though not a major application since I have terminators on my board already. Voltage drop after multiple daisy-chained machines also an issue.
  3. Pull down pin 3, and draw power through a diode from pin 6, separately on my two connectors but don't connect them. This allows my board(s) to be powered from one of your hubs, but needs a star wiring arrangement to power multiple of them. Star wiring probably beneficial for reduced voltage drop anyhow.
  4. Pull down pin 3 with the pair-of-diodes version and through-wire. This would allow a whole string to be attached, but cumulative voltage drop might be excessive.
Current consumption by my board is about 30mA when idle, plus whatever the line driver consumes when actually transmitting - could be another 50mA into a hard-terminated network, though of course only one station at once. So actually powering a whole string of machines from one end is not out of the question, though with the cable voltage drop plus the extra diode for ORing with the Vbus power from the USB probably means that I have to give up the idea of using "VDD_5V" to power analogue stuff.
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

arg wrote: Sun Aug 20, 2023 9:37 pm Right, I've now spent a _long_ time reading those old threads, as I couldn't find clearly stated anywhere what the final, final, spec for the power pins was.

As I now understand it:
  • Pin 3 is Vsense. This has a window comparator at the source end, and a weak pull-up: if at 5V (due to the pull-up) or GND then the output is disabled, only if it is pulled down to a mid voltage is the output enabled. 4K7 is the preferred pull-down.
  • Pin 6 is Vout, somewhere near +5V if enabled. But quite limited due to series resistance of the cable.
Yup, that sounds right. Worth noting that Vout is nearer 4.7V on my system without any cable related voltage drops or load attached, but that may be down to an underrated PSU connecting to my Pi. I'll investigate later
arg wrote: Sun Aug 20, 2023 9:37 pm On the face of it, this doesn't really work for paralleled/daisy-chained consumers: too many 'enable' resistors in parallel ends up turning it off again!
Yeah. I've never been overly happy with the way the 'enable' function works because of the parallel resistor problem you mention.
arg wrote: Sun Aug 20, 2023 9:37 pm However, some rough calculation (I haven't simulated it properly) suggests that the voltage with 4K7 pull-down is about 1.25V. So if instead of the 4K7 pull-down we put a pair of silicon diodes in series, you could have multiple consumers wired in parallel and it would still work.
The series diode option sounds like a good plan. I'll test that here with a couple of 1N4148s and see if I can get it to work. If going down the series diode route, please note that I already supply the 11 port hubs with the 4K7 enable resistor and termination. All can be enabled / disabled independently on the hub, so I guess both types of devices could co-exist on the same network.

Edit 1: Yes, it works with series diodes connected between pin 3 and GND! I much prefer that to the 4K7 resistor solution because of the 'too many enable resistors' issues that you previously mentioned. I'll update my latest development Piconet board design, and ditch the 4K7 resistor in favour of the two diode solution. I've also just had a quick look at my 11 port hub, and I can neatly squeeze the two series diodes into the footprint for the 4K7 resistor, so I should be able to adapt existing hubs, if required.

Edit 2: Hmmm. I've just added the two series 1N4148 diodes to one of my hubs and unfortunately the power didn't turn on. I measured the Vsense voltage and it was sitting at just above 1V. It seems that this is just a little bit too low. Adding a third diode in series got it working, though.

Edit 3: The hub does seem to be working intermittently with just two diodes. I think it might be temperature related. After I've worked on the board I clean then dry it off with a bit of heat. It fails to work immediately after that process. However, leave it a few minutes and it starts working. Possibly once the board / diodes have cooled off a little bit. I'm a little bit concerned, though, that the trigger voltage for switching on Vout may be just a little bit marginal.
arg wrote: Sun Aug 20, 2023 9:37 pm This leaves various options for my board:
  1. Leave pins 3,6 open. I'm not playing, but don't spoil the game for anyone else.
  2. Pass pins 3,6 through my board but don't connect to them. Allows, say, a terminator at the far end of a string - though not a major application since I have terminators on my board already. Voltage drop after multiple daisy-chained machines also an issue.
  3. Pull down pin 3, and draw power through a diode from pin 6, separately on my two connectors but don't connect them. This allows my board(s) to be powered from one of your hubs, but needs a star wiring arrangement to power multiple of them. Star wiring probably beneficial for reduced voltage drop anyhow.
  4. Pull down pin 3 with the pair-of-diodes version and through-wire. This would allow a whole string to be attached, but cumulative voltage drop might be excessive.
Whichever way you go with the enable circuit, and if you are going to take power from pin 6, I'd certainly recommend you diode OR the feed from pin 6 with an external source, and use that commoned feed to power your board.
arg wrote: Sun Aug 20, 2023 9:37 pm Current consumption by my board is about 30mA when idle, plus whatever the line driver consumes when actually transmitting - could be another 50mA into a hard-terminated network, though of course only one station at once. So actually powering a whole string of machines from one end is not out of the question, though with the cable voltage drop plus the extra diode for ORing with the Vbus power from the USB probably means that I have to give up the idea of using "VDD_5V" to power analogue stuff.
Yeah. That is, at least partly, why I ended up adding the voltage boost circuit to the Piconet module.
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

KenLowe wrote: Mon Aug 21, 2023 2:37 am
arg wrote: Sun Aug 20, 2023 9:37 pm However, some rough calculation (I haven't simulated it properly) suggests that the voltage with 4K7 pull-down is about 1.25V. So if instead of the 4K7 pull-down we put a pair of silicon diodes in series, you could have multiple consumers wired in parallel and it would still work.
Edit 2: Hmmm. I've just added the two series 1N4148 diodes to one of my hubs and unfortunately the power didn't turn on. I measured the Vsense voltage and it was sitting at just above 1V. It seems that this is just a little bit too low. Adding a third diode in series got it working, though.

Edit 3: The hub does seem to be working intermittently with just two diodes. I think it might be temperature related. After I've worked on the board I clean then dry it off with a bit of heat. It fails to work immediately after that process. However, leave it a few minutes and it starts working. Possibly once the board / diodes have cooled off a little bit. I'm a little bit concerned, though, that the trigger voltage for switching on Vout may be just a little bit marginal.
Taking this to a new post so I'm not constantly editing the original post. The issue I'm seeing is definitely temperature related, and the datasheets seems to back this up. When the board is heated up, the voltage across the diodes drops to just above 1V. This is insufficient to switch on Vout. Let the board cool down and the voltage across the diodes increases to about 1.15V. This seems to be enough to switch on Vout.

As a reference, with the 4K7 resistor the Vsense voltage sits at just under 2.1V. At this voltage, I calculate the current through the resistor would be about 0.45mA. If we assume this is also the current flowing through the diodes (when replacing the resistor with the diodes), then the datasheet indicates that the forward voltage would be about 575mV, which is exactly what I am measuring. I'm not sure if my logic about the current is quite right here, though?

If we go with the two diode solution, would I be correct in thinking that the overall Vsense voltage will drop slightly as we add extra devices in parallel, due to the current through the diodes dropping (which assumes a constant current from Q1 (BC842), which I'm not sure is correct)? If that is the case, then I would be concerned that we drop below the trigger point for switching on Vout as we add more devices. Would it be safer for us to increase the number of diodes to three; increasing Vsense to about 1.75V?

Sorry, I've taken your thread a bit OT here!
User avatar
arg
Posts: 1293
Joined: Tue Feb 16, 2021 2:07 pm
Location: Cambridge
Contact:

Re: Alternative Econet analogue circuits

Post by arg »

KenLowe wrote: Mon Aug 21, 2023 3:45 pm As a reference, with the 4K7 resistor the Vsense voltage sits at just under 2.1V. At this voltage, I calculate the current through the resistor would be about 0.45mA. If we assume this is also the current flowing through the diodes (when replacing the resistor with the diodes), then the datasheet indicates that the forward voltage would be about 575mV, which is exactly what I am measuring. I'm not sure if my logic about the current is quite right here, though?
OK, I'd miscalculated the nominal voltage, so it would need three diodes (or maybe even 4 if that puts us closer to the centre of the permitted range and we are using something like BAV99 with two in a package).
If we go with the two diode solution, would I be correct in thinking that the overall Vsense voltage will drop slightly as we add extra devices in parallel, due to the current through the diodes dropping (which assumes a constant current from Q1 (BC842), which I'm not sure is correct)? If that is the case, then I would be concerned that we drop below the trigger point for switching on Vout as we add more devices. Would it be safer for us to increase the number of diodes to three; increasing Vsense to about 1.75V?
Q1 isn't a constant current circuit per se, but if we achieve the same voltage (which is what we are trying to do) then the current will be the same; multiple in parallel will cause the current per diode to reduce and hence the voltage to drop (increasing the current from Q1 but not proportionately).

Could go to something more tightly controlled like a TL431 if 2.5V is comfortably inside the window; on a quick check, JLC offer a TL431 look-alike called CJ431 (part ref C3113, price $0.03, and it's a Basic Part) which would seem to fit the bill.

Could do with knowing the actual target voltages we are shooting for - I wonder if @wiggy kept the simulation of the circuit.
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

arg wrote: Mon Aug 21, 2023 6:47 pm Could do with knowing the actual target voltages we are shooting for - I wonder if @wiggy kept the simulation of the circuit.
I was thinking about doing some tests to get real world values. Can I just hook up a bench supply between pin 3 and GND and ramp the voltage up from 0V to 5V?

Edit: Right, I went for it, and hooked up my bench supply to Vsense, and Vout responds roughly as follows:

OFF < 1.08V
ON > 1.08V
ON < 2.25V
OFF > 2.25V

So, perhaps select a nominal voltage of 1.7V with a TL432 (unfortunately, I can't find an equivalent in the JLC Basic range)? Or just go with the three diodes that also gets us to about 1.7V?
Last edited by KenLowe on Mon Aug 21, 2023 8:43 pm, edited 1 time in total.
wiggy
Posts: 510
Joined: Fri Feb 12, 2021 12:19 pm
Contact:

Re: Alternative Econet analogue circuits

Post by wiggy »

arg wrote: Mon Aug 21, 2023 6:47 pm Could do with knowing the actual target voltages we are shooting for - I wonder if @wiggy kept the simulation of the circuit.
Some rummaging later, it turns out the answer is yes - see attached... well almost - looks like it got tweaked while we were discussing this issue back then.

I think I've put the resistors back to how it got built (which is how it originally was, I think), and stuck a voltage ramp on the front - that gives "on" between 1.18V and 2.42V, at least in ideal-simulation-land.
Attachments
hub_det.zip
LTSpice simulation files
(17.87 KiB) Downloaded 5 times
User avatar
KenLowe
Posts: 4697
Joined: Mon Oct 18, 2004 5:35 pm
Location: UK
Contact:

Re: Alternative Econet analogue circuits

Post by KenLowe »

For the avoidance of doubt, this is what is implemented in the bridge:
Bridge Power Enable Circuit
Bridge Power Enable Circuit
wiggy
Posts: 510
Joined: Fri Feb 12, 2021 12:19 pm
Contact:

Re: Alternative Econet analogue circuits

Post by wiggy »

OK, that matches the simulation attached.
User avatar
Winston
Posts: 74
Joined: Tue Apr 01, 2008 3:24 pm
Location: Isle of Man
Contact:

Re: Alternative Econet analogue circuits

Post by Winston »

arg wrote: Sat Aug 19, 2023 4:14 pm Final option is cheap 2N7002 FETs and a diode tripler to generate the (very low current) 9V to turn them on. The tripler is driven by the same PWM that sets the CD threshold level - could have used any source of pulses here, such as the econet clock itself..
What frequency are you running the PWM at? Try as much as I can, I'm getting nowhere near 9v off the tripler circuit.

I've simulated it in LTspice (using generic schottky diodes, I don't have a BAT54 model) and the best I can get regardless of frequency/period (this is with just the tripler circuit simulated and nothing else) off 3.3v term enable and 3.3v PWM input is just under 6.5 volts. If I delete the 470k resistor it gets up to about 8 volts or so.
User avatar
arg
Posts: 1293
Joined: Tue Feb 16, 2021 2:07 pm
Location: Cambridge
Contact:

Re: Alternative Econet analogue circuits

Post by arg »

Winston wrote: Sat Apr 27, 2024 6:19 pm
arg wrote: Sat Aug 19, 2023 4:14 pm Final option is cheap 2N7002 FETs and a diode tripler to generate the (very low current) 9V to turn them on. The tripler is driven by the same PWM that sets the CD threshold level - could have used any source of pulses here, such as the econet clock itself..
What frequency are you running the PWM at? Try as much as I can, I'm getting nowhere near 9v off the tripler circuit.
I have to confess that I didn't simulate this, nor have I actually built this revision of the design yet (the previous revision is working well enough that I wanted to finish the software on that before ordering more PCBs).

However, I've built diode pumps just like this (and using BAT54) that worked well - they usually droop under any material load, but here we are supposed to be drawing only a few microamps. Is yours failing only in simulation or have you actually built one?

The circuit fundamentally delivers 3x the input supply, less 4x the Vf of the diodes; there's no actual load current, so the only current should be that in the 470k resistor - about 20uA, x2 because only half the diodes are conducting at any time. At 40uA, BAT54 should be less than 240mV (datasheet value for 100uA), so 3.3*3-0.24*4 = 8.94. The only way this can go wrong is if Vf is bigger than we think it is (maybe due to extra current from leakage in the caps?), the output is discharging significantly between cycles (PWM too slow?), or never get fully charged in the first place. Actually, R20 looks much too big - 100R or so would be more appropriate (it's only there to be kind to the RP2040 output during startup when the current will be large).

The PWM frequency needs to be fast relative to the time-constant of the 470K/100nF at the output - I was thinking of the order of 100kHz.
User avatar
Winston
Posts: 74
Joined: Tue Apr 01, 2008 3:24 pm
Location: Isle of Man
Contact:

Re: Alternative Econet analogue circuits

Post by Winston »

I've built the circuit and was getting only millivolts at the output, so I simulated exactly what I built to sanity check it (given I had basically transposed your circuit into kicad, I could quite easily have made an error, so I transposed what I had in kicad into LTspice to do a sanity check).

[facepalm] I now realise why I'm only getting microvolts at the output...the thought struck me that maybe I ought to test the diodes. It turns out that there are single diode versions of the BAT54 in SOT23 packages, and guess what I've got. It'll probably work well enough with the correct diodes!
User avatar
Winston
Posts: 74
Joined: Tue Apr 01, 2008 3:24 pm
Location: Isle of Man
Contact:

Re: Alternative Econet analogue circuits

Post by Winston »

I just put the correct diodes on the board, and I get 7.5v on the output which is a volt better than LTspice predicted. (I don't think I have any 0603 resistors bigger than 470k so playing with the resistor value will have to wait)

I've not yet fiddled around with the PWM frequency, because it's late and I've been breathing solder and flux fumes most the evening :-) so that can wait till the weekend.
User avatar
Winston
Posts: 74
Joined: Tue Apr 01, 2008 3:24 pm
Location: Isle of Man
Contact:

Re: Alternative Econet analogue circuits

Post by Winston »

Actually I found that I do have a BAT54 model for LTspice, and replacing the generic schottky diodes for a BAT54 model makes the LTspice simulation match reality, which in turn makes fiddling around with the circuit much easier.

Changing the 5.1k resistor on the input for 100R as suggested increases the voltage (in the simulation) from 7.5v to about 9.2v so that would appear to be the solution.
User avatar
Winston
Posts: 74
Joined: Tue Apr 01, 2008 3:24 pm
Location: Isle of Man
Contact:

Re: Alternative Econet analogue circuits

Post by Winston »

Changing the resistor on the real circuit did the job as expected, I get 8.9v on the test point which is good enough. So the whole thing now works with my FPGA board providing the clock/termination and a direct cable to my BBC Master. Termination voltages are correct, and I sent about 10,000 messages (full 4 way handshake) from the BBC Master to the FPGA with no errors.

Incidentally I did take the lid off the AVR-based clock box I have, it is indeed the abombination of which you speak, it's just a bare ATtiny45 witih no line drivers (the only components are the AVR, the decoupling capacitor and (I think) a pull up resistor and DIP switches to select the frequency. It did however work on my network of 2 stations so at least for small tabletop networks it does work.
Post Reply

Return to “8-bit acorn hardware”