Wiring up Atari 2600 to SCART

I recently replaced the RIOT chip on the Atari to fix a joystick issue. Fired up the Atari today for a game and the audio has now stopped working.

After reading through various forums it looks like a common problem with either the inductor L201 going open circuit or the polystrene caps C206/C207 going faulty.

Tested the inductor and didn’t see any issues. Didn’t have a proper capacitance meter but they both looked open circuit. Since these are polystene caps they are not easy to find.

Now is a good time to move away from the old RF modulator and convert to SCART. I still have a CRT TV with SCART.

Read through tons and tons of threads on doing this and there seem to be multiple diagrams to do this with varying circuits from easy to complicate, required another CD4050 chip.

Eventually came across this schematic from AtariAge forums which looked promising. I had all of these components lying around and put it together on a piece of veroboard.

Also found a layout for my exact board which made connecting up it a lot easier.

Model C012283. Rev B. Schematic here.

Connected up the 5V and GND to the closet points that I found on the schematic.


To wire the the output to the SCART connector I used this diagram I found on here.

Connected pins on SCART:

  • Pin 2 & 6 to audio
  • Pin 20 to Luma
  • Pin 15 to Chroma

Wired up and connected to the TV, powered on…..success!

Great picture and audio is back!

Commodore VIC-20 Expansion

After getting my Commodore VIC-20 working with SD2IEC  (Was a blown 7406 hex inverter) it’s now time to build a 35k expansion.

Found a great write up on Ruud’s Commodore site.   A schematic is provided which gives the  VIC-20 35k of expansion memory using 62256  (32k x 8 RAM) and a 6264 (8k x 8 RAM)  chips.

(Update: The original schematic had a error in it, which has now been corrected)

Note: There is another error on the schematic. On IC2, pin 20 should be connected to pin 22, not pin 27

Setup the schematic in Autodesk Eagle and created a PCB. If you are looking to do this you might want to import the Commodore  library for Eagle which contains all the common parts including the edge connector.

Sent the gerber files to PCBWay, 10 boards for $5. Bargain!

Datasheets for the semiconductors:

SD2IEC for Commodore 64

After winning a cheap bid on a Commodore 64 off eBay  the other day I’ve looked into  building a SD2IEC.

The SD2IEC is a storage device using an SD card and interfacing with the IEC bus using a ATMega644 microcontroller.

I used most of the information from 16 Bit Dust .  Looking at the schematic I already had most of components.

I already had a SD Card with a built in 3.3 voltage regulator so did’t need to add this into the build. Also used the ATMega1284

First step is to program the microcontroller with a bootloader.   Having already built a USB Tiny ISP it was a simple step to program it. Schematic for this I got from AdaFruit

Bootloader files are available from sd2iec.de  

Download /bootloader/newboot-0.4.1-binaries.zip, extract the files and write

newboot-0.4.1-larsp-m644p.hex  to the microcontroller. I used avrdude:

avrdude -c usbtiny -p m1284 -e -V -U flash:w:newboot-0.4.1-larsp-m1284p.hex

avrdude -c usbtiny -p m1284 -U lfuse:w:0xd7:m -U hfuse:w:0xd2:m -U efuse:w:0xfc:m

Next comes building the circuit. I used a veroboard and there were not that many components to add.  Didn’t have to use R1-R6 as they were already on the SD Card.

Data cable pinouts

Power cable pinout

Not as pretty as the bought ones but it didn’t cost me anything to build and was a fun project.

After assembling copy the S2IEC firmware to the root of the SD Card. Power on and the red LED will flash for two seconds while it looks for a valid firmware. The green LED should then flash while it accesses the card. When it starts to flash the firmware the green LED will flash rapidly.

To test if the computer is successfully connecting to the SD2IEC device you can use the following simple program:

10 OPEN15,8,15:INPUT#15,A$,B$,C$,D$

20 CLOSE15

30 PRINT A$,B$,C$,D$

This will print the current SD2IEC firmware to the screen.

Building TZXDuino

To load programs on the AZ Spectrum you need a cassette player…or so I thought.


Came across TZXDuino which lets you play files from the SD card using an Arduino and a amplifier.


Rigged this up in a morning and it works beautifully. I updated the code to use a LCD 16×2 without I2C.

Its fairly easy to build and uses:

  • Arduino Mini Pro
  • SD Card
  • LCD 16×2
  • 5 x buttons
  • LM386 amplifier (Circuit from StackExchange)



Programming the 28C256

Not having a programmer for this chip I decided to  use my Arduino. After trying out various projects on the internet I eventually came across TommyPROM which uses 74LS164 serial to parallel shift registers. Wired up to my Arduino Uno, fired up TerraTerm  and uploaded the diagnostic ROM to the 28C256.

The 28C256 is a reflashable  EEPROM and almost the same pinouts as the 27C256 (OTP)

To replace the 27C256 with the 28C256 you need to go the following:

From StackExchange:

Comparing them side by side you can see the differences:

  • The ’27 has: a. pin #1, Vpp which in circuit is not used (either Gnd or Vcc) b. pin #27, A14 which is a driven address line.
  • The ’28 has: a. pin #1, A14 is a driven address line. b. pin #27, /WE Which must be tied high in circuit.


When you place the ’28 in circuit you must:

  • Lift pin #1 of the ’28 so it does not contact the Vpp pad
  • Lift Pin # 27 of the ’28 so that it does not contact the A14 Pad
  • solder or join or bridge the lifted pin 27 to Pin #28 of the ’28 (tying /WE high)
  • connect the PAD at Pin location #27 on the board with a blue wire to the lifted pin #1 of the ’28.


Spectrum RGB DIN to SCART Pinouts

After looking on the internet there seems to be a lot of confusing information on the pinouts for building a DIN to SCART cable. I’ve looked through the harlequin schematic and SCART pinouts and it should be as follows:

Spectrum Harlequin RGB DIN to SCART
DIN  ———–> SCART PIN – SCART Function
Pin 1 ———–> pin 5, 9, 13, 17 Ground
Pin 2 ———–> pin 8 — Switching (need +5V to +8V for on @ 16:9 or +9.5V to +12V for on @ 4:3)
Pin 3 ———–> pin 16 — Blanking (need +1V to +3V to select RGB mode)
Pin 4 ———–> pin 11 — Green video
Pin 5 ———–> pin 2 (Right), pin 6 (Left) audio
Pin 6 ———–> pin 15 — Red video
Pin 7 ———–> pin 7 — Blue video
Pin 8 ———–> pin 20 — Composite sync

ZX Spectrum Harlequin

After spending a good few hours reading up on retro computers and wanting to relive my childhood I’ve decided to give the ZX Spectrum Harlequin a go.

Yes, I know its probably cheaper to buy a complete assembled board or even a ZX Spectrum from eBay, but where is the fun in that!

There are many blogs and sites out there with a wealth on info so this should be a fun journey.

From ByteDelight:

A couple of years ago, Chris Smith reverse engineered the ZX Spectrum ULA (you can obtain the ZX Spectrum ULA Book to read about that).
Chris also developed the Harlequin: a ZX Spectrum 48K clone based on parts that replace the ULA, so no ULA is needed.
ZX Spectrum fans continued on this development which resulted in the design that is now known as the ‘Harlequin Superfo’. The current rev G is the most stable one.
You can now assemble a complete and 100% compatible ZX Spectrum 48K clone yourself!


I’ve decided to try and do this as cheaply as possibly and source the components from various locations.

First order of business. Order stuff!

  • Ordered Harlequin PCB from eBay for £15

  • Ordered ZX Spectrum case and keyboard from eBay for £10
  • For the parts list I started of with a bill of materials that Sergey Kiselev posted on his blog.

I already had some of these components  so managed to trim the list down. The remainder of the items I ordered from Mouser and eBay.  (Components mostly from China shipping time will be long but prepared to wait)

Link to my  Spectrum Harlequin BOM with prices.

I’ve also ordered a AT28C256 instead of the EPROM as this lets you reprogram the chip. The AT27C256 is a OTP.

Next, while I wait for parts I need to look it an Arduino based EEPROM programmer. Simple EEPROM Programmer from this site looks interesting.



3.5″ TFT Touchscreen for Raspberry Pi

I recently purchased one of these cheap 3.5″ TFT displays for the Raspberry Pi from eBay for £10 and spent many hours trawling the web trying to get it working.




This is a summary of all the steps I needed to follow from various sources.

Running the latest Debian Stretch Lite

First step is to install the Waveshare drivers:

wget http://www.waveshare.com/w/upload/9/9d/LCD-show-151020.tar.gz
tar xzvf LCD-show-151020.tar.gz
cd LCD-show
sudo ./LCD35-show

Raspberry Pi will then reboot.

Create udev rules:
sudo nano /etc/udev/rules.d/95-ads7846.rules


SUBSYSTEM==”input”, KERNEL==”event[0-9]*”, ATTRS{name}==”ADS7846*”, SYMLINK+=”input/touchscreen”

Reboot the Pi again.

Install dependencies for pygame

sudo apt-get install python-pip git libsdl-dev libsdl-image1.2-dev \
libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libportmidi-dev \
libavformat-dev libswscale-dev libjpeg-dev libfreetype6-dev \
evtest tslib libts-bin

The latest sdl libraries caused all sorts of issues with the touchscreen on Debian jessie/stretch. It works but the x/y values from the touchscreen were very intermittent.

Downgrading to sdl 1.2.15-5 fixed the issue. (More info here)

#enable wheezy package sources
echo "deb http://archive.raspbian.org/raspbian wheezy main
" > /etc/apt/sources.list.d/wheezy.list
#set stable as default package source (currently jessie)
echo "APT::Default-release \"stable\";
" > /etc/apt/apt.conf.d/10defaultRelease
#set the priority for libsdl from wheezy higher then the jessie package
echo "Package: libsdl1.2debian
Pin: release n=jessie
Pin-Priority: -10
Package: libsdl1.2debian
Pin: release n=wheezy
Pin-Priority: 900
" > /etc/apt/preferences.d/libsdl
apt-get update
apt-get -y --force-yes install libsdl1.2debian/wheezy

Once the library has been downgraded then it’s time to calibrate the touchscreen:
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 TSLIB_CALIBFILE=/etc/pointercal ts_calibrate

Follow the onscreen instructions to calibrate the TFT Screen.

Install pygame library required for python:
sudo pip install pygame

I then used the following code as an example to build a python driven menu for the Pi:

Temperature sensors using WeMos

After trying for a few months to get mysensors working on a Arduino mini pro with a NRF24L01+ I eventually gave up as the radio was too unstable. Works fine one day and next it loses communication. I tried all the tips and tricks to get these devices stable but had no luck. I now have a drawer full of them gathering dust.

There are loads of posts on various forums with various issues on the NRF24L01+

Next I tried a WeMOS D1 Mini Pro  which has a built in ESP8266 wifi module. This works great. I’ve now got 6 temperature sensors running and have they have been stable for 2 months so far.


The WeMOS is dirty cheap. You can find them all over eBay for $3-$4 with free shipping. They are stable, coding on them is really easy and there are plenty of examples of code on GitHub.

Description: The D1 mini is a mini wifi board based on ESP-8266EX.


  • 11 digital input/output pins, all pins have interrupt/pwm/I2C/one-wire supported(except D0)
  • 1 analog input(3.2V max input)
  • a Micro USB connection

The great thing is you can use the ArduinoIDE to program the WeMOS which makes it really simple.

I had a DS18B20 temperature sensor connected and up and running in no time.

To log the data I’ve setup Domotitz on a spare Raspberry Pi and the WeMOS sens the temperate to Domoticz via HTTP calls.


See my code on Github for my water sensor which words on the same principle as the temperature sensors.


ESP8266 + DS18B20 LUA code completed

This LUA code on the ESP works like a bomb – really simple and really stable.

The temperature sensors are connected directly to the ESP’s GPIO0 pin. This eliminates the need for an Arduino as all the work is done by the ESP.