Monday, 6 October 2014

BBC Micro keyboard repair

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

I recently build a BBC Micro USB keyboard, from the external keyboard of a Viglen BBC case.
That worked well and it is a very nice keyboard to use. There were a couple of problems. One, a few of the keys weren't working properly, and two, the original keyboard had a paper overlay that was too tatty to use, so I had removed it.
The BBC keyboard is made up of individual key switches, so it was a case of identifying the ones which weren't working and replacing them.
The switches are desoldered from the back and then unclip from the front.
A donor keyboard then provides replacement switches, and it's ready to go again.
The key caps were then washed and reinstalled. Two of the arrow keys were marked, so I swapped the 4 arrow  keys and the copy key from my set of spares.
That just left the case, I didn't think I could be able to neatly cut out a suitable black paper label like the original, so I masked and painted the black area.
That's better, much more like a BBC.
More USB keyboards are available for sale in my Etsy store, or contact me if you are looking for something custom.

Friday, 3 October 2014

Windows 10 - First Impressions

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

Microsoft have announced the next version of Windows, Windows 10, and have made available a technical preview. I've been running that for a few days, and from first impression, it looks like a proper desktop operating system. It has a task bar, aero effects (transparent taskbar etc.), a functional start menu, no charms etc.
So this is version 10. Well, actually it's version 6.4. Vista was 6.0, Windows 7 went out as 6.1. Windows 8 as 6.2 and Windows 8.1 as 6.3. So this is 6.4. A lot of this seems to be down to how applications check which version of Windows is running. A lot of programs were fine in XP (that's Windows 5.1 by the way), which followed on from Windows 2000 (5.0). These programs checked the Windows version started with 5 before they ran. So when Vista came along (6.0), some programs didn't like the new major version number change, so didn't run. Since then, they have stuck with 6.x, even though they called it 7. 8 and 8.1 confused things further and now missing out 9 gives version 6.4 for "Windows 10". Mad. Oh, and why not 9? One theory I've heard is again down to version number checking again. This time programs checking you weren't running Windows 95 or Windows 98 by looking for a version string starting "Windows 9". The version numbering of later OS's comes from the NT line, where NT4.0 (the last OS to actually have the right version number!), was followed by Windows 2000 (5.0). Windows 95 and 98 were part of a different family of operating systems and didn't use that numbering scheme.
Aside from the version numbering, this may be what I've been after. I like Windows 7, and have stuck with it up to now. I've tried to get to like Windows 8 a number of times, since it's initial tech preview. I even bought it when the retail version came out, but have always gone back to 7. I have helped numerous people who bought new computers preloaded with Windows 8 and couldn't find familiar points of reference they were used to from XP or 7. There are many nice things on Windows 8, the incrementally better small internal changes, things like a better task manager, better file copy dialogue etc., but they were always offset by the major changes to the user interface with the start screen and live tiles etc. Windows 10 has kept most of Windows 8, you can configure it to run just like Windows 8, but at least on the Tech Preview, out of the box, it runs a lot more like Windows 7.
The start menu now has the tiles on the left, which can be resized, added, removed, etc. like the Windows 8 start screen. Seems to be very usable like that. Most of the general operating stuff seems to work. It detected all my hardware without a problem. It handles multiple monitors better than 8 did, although you still can't snap to the side of an individual monitor, only the desktop as a whole.
You still get the dual personality of modern Windows, so if you want to use a calculator, you can use the standard Windows calculator, which hasn't changed much since XP, or you can use the Metro (or whatever it's called these days) style app. But now, the Metro apps can run on the same screen, in Windows, appearing on the task bar, almost like it was a proper desktop app.
So two calculator apps, one designed for people with a big screen and a keyboard and mouse, and one for the people with tablets and fingers. So Windows 10 is bringing those more together, but it's still difficult to see why they need to be in the same OS. Microsoft is very keen to push this one OS for all devices, but I'm not sure the users really care. Do they not just want to sit with their desktop or laptop and use apps in the traditional way, I don't think they would expect them use the same apps on a tablet? To facilitate this, they seem to have changed the window chrome (lower case w and lower case c), the box around the windows, for all apps. So any apps which don't use the standard title bar, may look odd.
You may have noticed that internet search results are now part of the same search list, and not clearly distinguished, so you can easily end up with a website when you were looking for an app (for example, Windows 10 doesn't have solitaire - there's a deal breaker right there! So if you click start and type solitaire, you get a bing search which shows a list on online gambling websites. Probably not what you were after.
There are also multiple desktops, like Unix based system have had for decades, where you can have a whole load of apps open, and then switch to a clean desktop and open a new desktop and then switch between them, although that only shows one monitor, so not ideal if you have a multi monitor setup. There are hints that the licensing model may change, the licence agreement seemed to imply it was a licence to use the software, rather than having been purchased. I don't know if the will be the case with the retail version.
So there it is, I'm a lot more positive about this after having used it for a while than I was with Windows 8. There is a theory that every odd numbered Star Trek films was rubbish. Windows was the reverse of that, the odd numbered ones were the good ones (Windows 98SE, XP, 7), and the even ones were the ones to avoid (Windows ME, Vista, 8). By skipping 9, have they missed the good one and gone for another rubbish one, or have they fixed it? Time will tell.

2022 Update: It seems I liked Windows 10 from the off, and I used it since then (was it really 2014?). About once a year I would get annoyed by some change or other and switch back to Linux for a bit, but would have to go back to Windows 10 at some point when I was developing Windows software. I don't do that these days, so it's been a while since I ran Windows as a main operating system (other than a Windows 7 VM I keep around to run the last few bits of software that don't run under natively on Linux, or under wine).

Friday, 19 September 2014

Simple battery powered, LCD clock / calendar

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

In a similar style to the battery powered LCD clocks I made a while ago, I have been asked to make some LCD calendars.
The desk clock used an 8x2 LCD, but I went for something different for this, the display from an Nokia 5110 phone. These are 84x48 graphical LCDs using the Philips PCD8544 controller. These is a simple interface, but it runs at 3,3V. I followed the guides on the Adafruit site to use a 4050 as a level converter and drive this from an Arduino Uno.
The plan for this is to run from 2x AA batteries, so the 4050 will not be required, and the LCD can be connected directly. As usual with these things you can't have everything, so it's 'cheap, lower power, accurate - pick two. In this case, it's cheap and low powered, so I'm running the ATmega328P with it's internal 8MHz RC oscillator, divided down to 1MHz, As with the previous clock, I'm using a 32768Hz watch crystal on a timer interrupt to count seconds.
The crystal is hidden under the chip socket, and that's all that's required for the final unit, one display, the watch crystal, 4 buttons and one 100nF decoupling capacitor on the back. The switches and display lines are wired to the nearest pin on the ATmega328P, as usual switched to ground and using the internal pullup resistors.
I've used a three pin connector for power, the centre pin is the blue backlight which isn't currently used, but could be wired up if required, obviously reducing battery life
Normally it just shows the date, but the yellow button switches into date / time mode so the time can be set. The other buttons increments day/month/year or hours/minutes/seconds, depending on mode.
I also build a portrait version, to be used on a different project.
So far testing has shown this may be out by a few seconds a day. That's not ideal for a clock, but this is to be paired with an analogue clock movement, so will mainly be used to show the date. In which case, it should be fine as long as it changes date around midnight and not at three o'clock in the afternoon.
Since there is no battery backed real time clock, it will not remember the time. I've added a function to write to the EEPROM when it changes at midnight. This is checked on power on, so the date will be correct and just the time will need to be set when the batteries are changed. The EEPROM has a limited life of 100,000 writes, so storing the time would wear it out too soon.

Saturday, 13 September 2014

Commodore PET transfer cable

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

The Commodore Pet 4032 is now complete, and ready to use, I just need to get some software on there.
I have some Pet software on 8250 style floppy disks, but have yet to repair the 8250 drive. For other Commodore computers, I use the SD2IEC which plugs into the IEC port and provides easy access to .PRG and .D64 files.
The Pet doesn't have an IEC port, so unfortunately, I can't use that. It does have IEE488, which is parallel, and is what the IEC serial interface was based on. I have a few ideas for an SD card based solution, but for the moment, I'm relying on the cassette ports, and the recently refurbished Datasettes. Looking around, I found this page, where the author had used a Commodore 64 to assist in the transfer process.
The idea was to load the program into the Commodore 64, and then save it to tape. The tape could then be loaded on the Pet. Not quite as straight forward, as the load addresses are different, so there is a series of steps to follow on the Pet.

  1. NEW - clears existing programs
  2. 0 REM - start a new program with line 0
  3. LOAD - load the program
  4. SYS 1024 - start the system monitor program
  5. M 0401 0408 - display memory from address 0x0401 to 0x0408
  6. cursor up and change the line to start :0401 01 08 - this points to 0x0801, the address where the code from the C64 was loaded
  7. X - exit the monitor
  8. 0 - remove line 0 and relocate the rest of the code
  9. SAVE "name" - save the program to tape

It looks a bit of a faff, but once you've done it a few times, it's quite quick.
To get programs on the C64, I added a directory to the SD2IEC SD card and copied on a selection of Pet .prg files. After a few successful transfers, I wondered if I could cut out the step of saving to tape on the C64, rewinding it and then loading it into the Pet. The cassette port is quite simple, It is a 12 pin connector, but the top and bottom rows are the same, so it's only 6. Would have been nice if they had reversed the bottom row, so the connector could go either way up, but never mind. The connections are as follows;

  1. GND
  2. 5V - permanent 5V supply
  3. Motor - switched unregulated 9V
  4. Read - data in
  5. Write - data out
  6. Switch - connect to GND when play (or any of the other keys) is pressed

So there is a data in and a data out, both TTL level, both pretty much direct to PIA I/O pins. All the analogue stuff is handled in the datasette. So can I just connect them together? It turns out no. Whether by design or mistake, the signals are inverted. I inverted the signal using a 74LS04 inverter and fed the inverted signal into the Pet.
Bingo, it worked. I wanted to make a lead up, and didn't think I would fit a 14 pin chip into the plug, so I tried a simple NPN transistor inverter, and that also worked fine,
It actually gave a slightly cleaner signal than the TTL gate did as it was pretty much full swing on the supply rails (top is output, bottom is input, both 2V per division).
I built this up into a cable, with the components wired directly to the plug. I used a 2N3904 but any NPN transistor should do. The emitter is wired to 0V. The base is wired via a 1K resistor to the write output of the C64. The collector is connected to the read input of the Pet, and pulled high via a 10K resistor to 5V.
The switch input on both plugs is wired to 0V.
And that's it. I found 15 way D connector hoods were a close fit. The screw holes didn't match, so these are just held on with cable ties.
With the cable in place, it simplified the process as I could load the program on the C64. Setup the Pet with 0 REM and then LOAD and as soon as I start the SAVE on the C64, it loads on the Pet. Then just sort out the load address as above and save to cassette.
Another nice thing about the Pet is that is has two cassette ports, the rear is port 1, the side is port 2. So I can do LOAD (which is short for LOAD "",1), and then when finished, SAVE "name",2. So no unplugging is required for the whole transfer process.
Finally some new software, here I'm trying some of the newly written Pet games from Revival Studios.
These are now free downloads. I particularly like Down, a very simple but fast and addictive game. Too fast in fact to be able to take any decent photos. Sorry.
Update: This doesn't seem to work with some machine code only programs, and ones that load at unusual addresses. Bit it's fine things like space invaders, fire, blitz etc. Also watch out for ones that include the 'killer poke' code 'POKE 59458,62'. That normally appears at the start of the code, so just remove the offending code before saving. On early Pets, it can speed up the video. This isn't required on the later CRTC based pets, where it causes monitor to lose vertical sync, generating a bright spot or line which could damage the monitor after a while.

Commodore PET Repair Part 12 - Datasettes

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

Now that my restoration of the Commodore Pet 4032 is complete, it's time to start using it.
This is one of the original Commodore Datasette drives I got with the 4032 long ago.
I love the plaited cables on these. I don't know if they were supplied like that, as I haven't seen any others like these. They appear to be three pieces of speaker cable plaited together.
Also unused for 20 years, all these needed was a general clean up, a new belt and a head clean and they worked fine.
The other was the same, just a different plug. The DYMO labels are original by the way.
The same design was used with early VIC20s, black and grey replaced by white and gold, and the addition of a tape counter (like the imperial Daleks in Remembrance of the Daleks, apart from the tape counter that is)
The white seems to sit better with the Pet, and the tape counter is useful. These also seem a lot more solid that the later 1530 Datassettes (or C2N, they seem to use the name interchangeably).
During the testing, I've been using a tape with space invaders on it. It is a good game, and has sound and reasonable graphics. But mainly because last time I was working on a Pet, I tried various methods to transfer from a PC to tape, and this was the only one that transferred successfully.
Now all I need is to get some more software onto tape.

Thursday, 11 September 2014

Commodore PET Repair Part 11 - Finished

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

The Commodore Pet 4032-32N is now complete again, for the first time in about 20 years. It's taken about a month to get this far, but I think it's been worth it. The full story starts in Part 1.
I've always liked the distinct 'Commodore Pet' shape, it looks rather smart now it's all cleaned up and working.
I've left the badge off for the moment, I think I'll try and make something like the standard 4032 one, since the original one is damaged.
Inside, the new parts are as close as I could get to the originals, which I didn't have.
Most of the parts are dated 1982 or 1983. The replacement board is a 'Universal' 40/80 column one this would probably have started off with the fixed 40 column board.
I do, however, have the original datassette drives from this Pet, more on those later.
For the moment, I've been using a standard Commodore 64 one
So there it is,
Commodore Pet 4032-32N serial number WG 0018 lives again.

2022 Update: This PET is still sat on the bench next to me in regular use. These days the mainboard is stored safely away and it is running with a Mini PET 40/80 D.