I've been offered a Dataman S4 programmer, which needs a bit of TLC to make it work properly again after some time on the shelf. A key feature of the S4 is that data can be entered directly into it by hand, for example a few dozen bytes of bootstrap loader, as well as accepting bulk data over a serial line, so this is directly relevant to getting my 6502 projects off the ground.
It's a fairly common set of things that go wrong with that unit - it needs new batteries and the power jack is broken. It powers up just fine if power is applied via the internal battery connector, but it needs a functioning battery before it can run from external power (a poor design choice, IMHO), and the jack is of a type that's not very robust and also hard to find a direct replacement for. The manufacturer's advice on choosing a non-official PSU also suggests that the internal battery charger is rather primitive, which seems likely to cause premature failure of the battery - official replacements being rather expensive to obtain, especially with international shipping.
So, of course, I set about redesigning it. It should, after all, be entirely feasible to bypass the original power jack and power the unit entirely from the internal battery connector.
The official 7-cell NiCad pack offers about 5 watt-hours of capacity, but I can get 7.2 Wh from just three modern NiMH AA cells, costing a handful of euros from my local supermarket. The only problem is that the voltage has to be stepped up from 3.6V nominal to the 9V expected. NiMH cells are also a bit more finicky to charge in-situ than NiCad, and a 3-cell AA holder takes up slightly more space than the same number of cells in pack format. Armed with measurements of the original battery compartment, I determined I could fit a 47x53mm PCB in beside a 3-cell holder.
That's not a lot of space to build a combined PSU and battery charger into, with two parallel supply paths being needed so that the unit can be used without disrupting the battery charging logic. Here's what it looks like when you try:
Attachment:
dataman-battery-1.png [ 462.46 KiB | Viewed 1806 times ]
Technically, that should
work, but with through-hole components on both sides and consequently the solder points for some components being hidden by others, assembling it is likely to be difficult. I'm also not entirely happy with relying entirely on the 10µF low-ESR capacitors I was able to squeeze on there, given how little capacitance the S4's motherboard has on it, and thus how much it must have relied on the original batteries for ballast when running on mains power (another factor possibly contributing to short lifetime).
Closer examination of the S4's casing suggests that if a thin plastic partition is cut away, it might be possible to fit the battery holder in a more favourable orientation, leaving about 10mm more space for the PCB. That doesn't sound like a lot, but in this context it means being able to arrange the components for easier assembly at the very least. It also raises the possibility of fitting some larger capacitors, maybe off-board and tucked into random corners of the case, just to make sure the power delivered is clean.
Attachment:
dataman-battery-schema.png [ 103.24 KiB | Viewed 1806 times ]
The top half of the schematic is the direct path from mains input to unit power, and should be able to operate without the bottom half (or the batteries) fitted. Essentially it's a rectifier for the original unregulated AC input, then a buck-converter down to 6V regulated, and a boost-converter back up to about 9.6V. On the potential divider selecting that last voltage, there's a second tap which offers the correct feedback for 8.8V, for the benefit of the otherwise identical boost-converter attached to the battery. The latter should thus go idle whenever mains power is available, operate in discontinuous mode for standby and "edit" mode, and in continuous mode for the 180mA power consumption specified for actual programming operations.
It may seem excessive to have effectively five regulator circuits, four of which need a relatively beefy inductor and flyback diode, for this job. Perhaps I can find a way to combine the two on the direct power path, although it'll have to be a different regulator than the LT1110, as the datasheet advises against using it for stepping down to move than 6V. The unregulated input voltage might sag under combined charging and programming loads, far enough that a simple LDO regulator wouldn't hold the output voltage out of the boost converter's target, and the load this would impose on the battery would likely trip the charge controller to prematurely end the charge cycle. Using separate buck and boost stages avoids this scenario, but for example a SEPIC topology could also handle it with fewer components.
The complicated part remaining is the battery charger, based around a BQ2004 charge controller. This itself requires a 5V supply, but at low enough power that using a simple linear regulator is sensible. To the lower-left of this is a resistor network to calibrate the thermistor (to be inserted into the battery pack somehow) with sane temperature limits and the BQ2004's expected voltage relationships for dT/dt detection. Configuration pins are tied as appropriate for a NiMH charge algorithm (peak voltage detection and top-off charge enabled, C/2 rate during fast-charge phase), and to make the LEDs on the right properly distinguish all the important phases of charging. To the lower right, a potential divider configures the dV/dt sensor for a 3-cell battery, and the current-sensing resistor selects 1000mA charging current. Finally, the MOD output is used to drive a buck-switching MOSFET through a simple gate driver.
This arrangement of the BQ2004 is
much simpler than the suggestion in the most relevant application note I could find. As well as completely unnecessary (and rather unclear) provisions for charging Li-Ion battery packs with the same circuit as for NiMH, it used an active gate driver circuit to accelerate switching off the MOSFET at the end of each pulse - which I consider completely unnecessary, with a simple resistor being sufficient to discharge the gate rapidly when the driver is switched off. For all that complication, the application note left the LED outputs completely unused.