Sunday, 9 February 2014

Setting the time

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

I've had a query about how I have been setting the time on the LED clocks I've made. Well, it depends. When I replaced the LED driver board on my old Cascade LED clock radio, I didn't bother with any buttons etc., so the only way to set the time is to reprogram it.
So every 6 months, I plug it into the PC via an FTDI cable (as shown here) or an Arduino USB Serial Light (as in the original article). I then upload the code with the following line uncommented.

  RTC.begin();
  //RTC.adjust(DateTime(__DATE__, __TIME__));

This sets the time to the system time and date at the point of programming. I then comment the line out again and immediately reprogram it, or it would reset to that that time each time power was applied.
That's fine for me, but for the ones other people have to use, I tend to add buttons to set the time, such as on this LCD clock. Note in this case, I use the USB cable for power, there is no data connection.
So I suppose it's down to how complicated you want to make it. I'm happy to reprogram a few clocks twice a year to cope with daylight saving. But obviously the average user would prefer buttons to change the time. You could use serial (directly or via USB) to set a time from a PC, but that's probably more work that reprogramming it. You could even use an Arduino Ethernet and get the time over the internet via NTP, or connect to a rugby radio module if you wanted to.

Monday, 20 January 2014

Commodore 64 DRAM fault diagnosis with Thermometer

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

One common source of failure in consumer electronics new and old is memory. Often indicated by random failures, video RAM by garbage on the screen, and sometimes just blank screens. Usefully, this is often accompanied by the chips getting hot.
Older computers usually had multiple chips, 8 one bit chips arranged to make an 8 bit byte. This means that if one goes wrong, every byte of memory is affected.When there are multiple chips, it sometimes be difficult to identify the culprit. When there have been replacements before, it is often a good idea to replace all the RAM with a matching set of tested, working chips.
Here we have a Commodore 64 with a blank screen. No, this time it isn't the PLA, that's working fine. The CPU is also OK, and the ROM can be ruled out as it also fails with a cartridge present. So the DRAM is the next candidate. You can usually tell by touching each chip with a finger, if any are getting hot. This is not terribly accurate, and you can get your fingers burned.
This is a handy little infrared termometer. It's good for this sort of thing as there is a small laser pointer which indicates the area it is tested, so you can see where the reading is from. Here are the results from the 8 DRAM chips.

Most are in the 25-30 degrees range, and are fine, but there are three from 37 to 45 degrees which are likely to be faulty. A quick bit of desoldering and some replacement chips and a run through with the Commodore 64 diagnostic cartridge I put together last year, and another Commodore 64 is restored to life.


Sunday, 12 January 2014

Raspberry Pi SD Card Socket Repair

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

I've seen this happen a few times, the SD card slot on the Raspberry Pi is on the bottom, and if you press down on that part accidentally, some of the plastic can snap away.
That leaves the slot so that the card isn't held in place any more, and can just drop out.
I've seen a few solutions to this on the net, some involve glueing the card in place or sticking bits of card or plastic over the socket, or soldering a Micro SD adapter in place. The better solution would be to replace the socket, but I hadn't been able to locate a suitable socket from RS or Farnell etc. I did find some on ebay, so bought a couple.
These look to be the right thing, so I removed the original socket and cleaned up the board.
The new connector is removed from the packet.
Then soldered in place.
The card is now held in place like it should be and this Pi is now back in action.
Ironic I suppose as the SD Card slot is one of the things that I don't have to remove to fit it into a Spectrum USB keyboard, here is the rest of the board.

Friday, 3 January 2014

Eneloop Batteries and BL700 Charger Review

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

Rechargeable batteries are great, but they don't last very long, even when not in use. I've noticed the rechargeable batteries in one camera that I don't use very much tend to need recharging almost as often as the ones in the camera I use every day. NiMh are an improvement over the original NiCads (I couldn't even find any of those to test), but they still go flat even whilst sitting on the shelf. They are great for high drain applications like cameras or games where they are likely to be drained before they self discharge.
Normal alkaline batteries self-discharge at a much slower rate, but cannot of course be recharged. OK, you can sometimes partly recharge them once or twice with a PRC waveform, and I used to do this many years ago when I used MP3 players a lot. But I had too many batteries leak - after all this is not what they are designed to do.
In recent years, a best of both worlds solution has emerged, 'low self discharge' or 'pre-charged' NiMH rechargeable batteries. These hold their charge for long enough that they will can be supplied pre-charged. You couldn't do this with normal rechargeable batteries as they would have self discharged by the time you open the packet. They claim to hold their charge for several years, so are suitable for remote controls, clocks etc., things you wouldn't traditionally expect to be able to use rechargeable cells for.
In order to test these, I bought a set of 4 AA cells back in July 2012. These were 'Uniross Rechargeable Hybrio'. They came with a set of adapters to turn them into D cells, and I installed them in a Maglite 4D torch. I did have to modify the spring it the cap slightly to make contact with the AA in the adapter.
That is an 'emergency' torch, so isn't used very often, but it still works on that original set of cells which arrived charged, and hadn't been charged by me. Very impressive. I've had sets of normal batteries that were looking a little dodgy after 18 months. I took those cells out recently to see how much charge they have lost. They are rated at 2300mAh, but it only took 1100 mAh to get them back to full, so more than half capacity after 18 months plus however long they were in the packet. Based on the success of those, I've started slowly replacing all my batteries with low self discharge cells.
In the main, I've been buying Sanyo Eneloop's. These seem to be a good alternative. The standard ones are 2000 mAh (well, 1900 mAh minimum they say), and they work out around £1.79 each. That's cheaper than a lot of rechargeable batteries and less than double the price of a Duracell, so you're in profit after two charges, and they claim to be able to be recharged 1800 times (that's once a day for about 5 years). I get 10 for £17.85 from BatteryLogic.co.uk - I'm happy to recommend specialist sellers like these as I have been very impressed by their service (even around Christmas time), and I'm getting sick of poor service from big players like Amazon and eBuyer.
The AAA ones are rated at 800mAh (750mAh min). There are also 'XX' versions 'for professional use' which claim 2550 mAh (900mAh for AAA), although these have a lower claim for the number of recharges.
One thing to note with these and other decent NiMh cells, is to avoid 'rapid chargers'. The two hour or even 15 minute chargers tend to markedly reduce battery life due to stresses and heat generated during rapid charging. The slower overnight charges at 200mA are gentler on the cells, and overnight charging shouldn't be a problem, as you shouldn't have to charge them as often. I've tried out a few chargers and have been most impressed with the Technoline BL700 (which looks to be also sold as the LaCrosse BC700U, Accucell alpha700, the Voltcraft IPC-1L and several others).
This is an intelligent charger, so it will stop charging once the cell is full and switch to trickle charge. It treats each cell independently, rather than charging pairs in series which isn't good for the batteries if they aren't in the same condition. It displays useful information such as voltage, time, charge current and amount of energy supplied. This can be used to show battery capacity if the cell is first discharged using the Test function.
It can charge at 200, 500 and 700mA, but I like the fact it defaults to the slower (and better for the batteries) 200mA. It's also got various modes to test battery capacity by fully discharging and then charging, and can also attempt to refresh older cells by repeating the discharge / charge cycle until the capacity stops improving. The display and setting buttons are far easier to use that most of the other chargers I've had which basically have one LED (often not even one per cell), and a switch marked 'Mode' or 'A or B', which you forget what it does when you come back to it after a month or so. You can also select what to show for each cell individually.
I ran a few capacity tests to see how some of the cells I had were doing. I picked the eneloop with the worse capacity from previous testing and tested it against the 2000mAh Energizer NiMh cells I had been useing in the camera, the 1300mAh Uniross ones I had before those (both of which cost more than the eneloops), and an unbranded 600mAh cell from a garden solar light.
Yes, the Uniross one is the right way around, it really does have the silver band at the negative end, no one could possibly put those in the wrong way around, could they. You sometimes wonder what they are thinking of when they do things like that.
So the unit discharges all the cells, then charges them from flat. It then calculates capacity based on current supplied over time. As you can see, the unbranded one is a joke, less than a quarter of rated capacity. The others were reasonable, the Uniross one must be about 10 years old, and had been used a lot, so did quite well. I left those four cells sitting in a plastic container for a month. I checked the voltages every couple of days, and after a month, all but the eneloop were pretty much flat. The figure on the eneloop was improving, they say they can take a couple of charging cycles to get to full capacity, the other eneloops I tested were showing 1900-2000 mAh.
I'd also been seeing poor performance on rechargeable AAA cells used in my DECT phones, so with the test function, I've been able to go through the batteries I had and weed out the rubbish ones. The refresh function has recovered a few, but some just weren't worth bothering with.
The purple cell is one of four like that which are marked 1800mAh, not one of them got even 10% of that. Most of the black Energizers failed dismally, this 850mAh was the best of the ones I tested and got 211mAh, the other two phone ones marked 750mAh didn't perform well enough to score. It's not just the test function on this unit, although it will reject some really flat cells unless you give them a quick burst in a less intelligent charger beforehand. I also tried them with a constant current power supply and dummy load and got similar results. It is a fair reflection of how they were preforming in service (badly). They've all got eneloops now.
At Christmas and birthdays, I am the one with the supply of batteries ready to deal with the 'batteries not included' presents. This year, that box was full with the best of the part-used batteries I had replaced with eneloops. Apologies if this reads like an advert, it's just nice to be able to report that something works and does what it says on the tin. Do yourself a favour and get some eneloops and a decent charger.

2022 Update: The BL700 charger and the Eneloops are still going strong. 

Sunday, 15 December 2013

Commodore 64 Diagnostics Cartridge

This is an old post, preserved for reference.
The products and services mentioned within are no longer available.

I've finally got a replacement for my desoldering station, after giving up on my original supplier and going elsewhere. Now I can catch up on all the jobs which are likely to need a lot of desoldering, and have been old hold whilst I've been waiting. Here we have another Commodore 64 to repair. The initial fault was a black screen.
I went straight to the usual culprit and, yes, it was the PLA. Desoldering station working well, removed, socked and replaced that. The PLA was verified as faulty in another machine, and a working PLA brought this back to life (well, sort of).
This is actually the later CSG 251064-01 which seems to be more reliable than the original MOS 906114-01. There was now something to show on the screen, but it was random garbage
Just to side track for a moment, on the subject of random garbage. I remembered years ago finding a good demonstration that the random number generation on this sort of computers wasn't as random as you might think. There is an example in one of the Spectrum + user guides which shows some 'random' coloured blocks.
If you type it in, you also get random coloured blocks, but exactly the same random coloured blocks as shown in the book!
This is due to the Spectrum's psuedo random number generator being seeded in exactly the same default way. Always remember to choose a suitable seed your random number generators - a trap for young players as Dave Jones might say.
Anyway, back to the Commodore 64. At some time in the past, two of the DRAM chips have been replaced. This always starts the alarm bells ringing, particularly when they are different speeds. I thought it might be a good time to use the Commodore 64 Diagnostic Cartridge and see if it could pick out the faulty chip. I had been using a bit of a hack using a 2764 EPROM, but I thought it might be time to make a neater one. I got a couple of game cartridges and had a look inside.
The Omega Race one on the right looked the best bet as that was a simple 8K chip.
Desoldering station on call again, nice clean removal of the original Omega Race chip.
These 24 pin chips are not compatible with the standard 27 series EPROMs (like the 2764 I had used which is 28 pin, 8K), so I used the same type of MCM68766 24 pin 8K EPROM I had used to replace a VIC20 Kernal ROM.
The Diagnostics program ran, and highlighted problems with 4 of the DRAM chips, the mess on the rest of the screen is due to the memory fault.
Time to change the DRAM. More desoldering, at least it's a good test.
I installed sockets for the DRAM chips and tried various combinations. It seemed there was actually only one chip at fault, but when that was present, it caused another three to report failure. I'm not sure if this is a deficiency in test program, or something to do with the mixed timings and manufacturers (which I normally try to avoid).
After further testing, I decided the best option was a fresh set of DRAM chips.
Retesting with the new DRAM, all was well.
I've made up a suitable label for the cartridge, stuck over the original, so if I ever feel the urge to go back to Omega Race, I can.
That's now part of the testing toolkit, ready to test the next one.
The new desoldering station has passed with flying colours, time will tell if I get the same issues with tip deterioration as I did with it's predecessor.

2022 Update: After much experience, I now replace any of the Micron chips with the MT logo on as so many of them fail, it's better to replace the lot.