---
layout: post
title: "Building a COSMAC/RCA CDP1802 learning computer"
date: 2024-05-01 13:00:00 +0200
comments: true
categories:
---

# PCB making

## Printing the transfer

I tried several methods to prepare the toner transfer intermediate:
* baking parchment paper with double sided tape
* glossy magazine with scotch tape
* glossy magazine with glue

What seemed to work best is the glossy magazine glued to a sheet of paper strong enough to not have irregularities.
:warning: Don't forget to mirror the image before printing :facepalm:

## Preparing the board

Grain #500 sandpaper -> steel wool -> acetone

## Transferring the toner

* **1st attempt** (glossy paper taped to carrying paper, max heat, 1.5 min): **failure** the paper sticks to the PCB, no transfer
* **2nd attempt** (parchment paper glued to carrying paper outside of printing zone, max heat, 3 min moving across surface, let cool): much better, good enough for silkscreen but probably not for etching
* **3rd attempt** (glossy paper glued, pre-scrubbed with isopropanol):
  * very good print, almost no defects
  * transfer with acteone/alcool (3:8): total failure, did not stick to copper at all.
* parchment paper, taped to carrying paper on all sides (outside of printing zone), pre-cleaned with isoprop
  * iron 2 min on each part of the surface, temp setting 2, lots and lots of pressure
  * let cool completely
  * transfer failed :-(

Looking for a laminator...

Laminator (Pavo Vancouver A4) / parchment paper : utter failure, almost no transfer at all

:white_check_mark: **Great** result with stickers backing sheet + cloth iron (max temp) + lots of pressure
* press for 2 minutes without moving iron much
* shift weight to distribute pressure
* high pressure finish over details (iron side/tip)

Reference: [Youtube](https://www.youtube.com/watch?v=haqP8xhsYas&t=600s)

Fix broken traces with Lumicolor permanent marker

:warning: Missed a broken trace

## Etching

Etchant solution:
* 50 mL 23% hydrochloric acid
* 50 mL 12% hydrogen peroxide

Etches in a few minutes. **Reaction is exothermic.**
*Don't take it out too early.* The protection by toner and marker both work well.

# Soldering

Checking regularly for continuity, expected resistance values, and absence of shorts was key to success.

# Debugging

System worked on first try except for LOAD mode flip-flop.
The 4027 from AliExpress behaves in a weird way, as though J and K were reversed.

The expectation is:
* ~DMA-IN~ is cabled to ~Q~ (i.e. the active low DMA IN signal is inactive when Q=0 ~Q~=1)
* at startup Q=0 ~Q~=1
* upon a raising edge of CLOCK, the flip flop transitions to Q=1 / ~Q~=0 / DMA IN is active
* upon a positive signal on RESET, the flip flop transitions to Q=0 / ~Q~=1 / DMA IN is inactive

According to both the truth table and the circuit design, this is the behaviour that should be observed with J=1 K=0.
In practice this is the behaviour observed with J=0 K=1.

If I set J=1 K=0 and set Q=1 by presenting a positive signal on SET, then on a raising edge of CLOCK I see the flip flop going to Q=0 ~Q~=1.