RC2024 – Part 11 – Building And Testing The Updated PCB

The Rotary Encoder module for the RC2014.

The new version of my Rotary Encoder Module PCB arrived yesterday. I couldn’t wait to solder it up.

There were only a few small changes to the first PCB. I covered these when I wrote about building and testing the first PCB.

The Rotary Encoder Module for the RC2014.

The biggest change I wanted to make was to introduce a sensible spoke size to the ground plane. Imagine my disappointment when I still struggled to solder to ground. I went back and looked at my design. The ground plane spoke sizes looked sensible at 0.25mm. Then I realised what I had done. I had placed a ground plane on both the front and back of the PCB. I never changed the spoke sizes on the back. This meant as I was soldering the heat was being wicked away in the large copper ground plane.

I did eventually complete the PCB, and this time I used blue switches for the address port select and for the LEDs. This helps me tell the two different versions of the boards apart.

Plugging it in and running my tests, I was happy to see everything still worked.

Ports

Reading Shelia Dixon’s update on her RetroChallenge for the RC2014, I saw she was using the same port as me.

She mentioned she had spoken to Spencer Owen about the best port to use. I have followed her example and reached out to Spencer. He has kindly reserved port D7 for rotary encoders on the RC2014. There is also A7 as a reserve port in case of clashes. This port can be used by other rotary encoder modules in the future, not just mine.

One thing Spencer mentioned was about making it simpler to set an address port on the board. Rather than having 8 switches that allow any 8 bit port address to be used, a simple jumper to allow either D7 or A7 could be used.

I have taken this on board and decided to design two more versions of the PCB.

The first is essentially the same as my existing board, but with a single ground plane to the rear of the PCB. This also has smaller spoke sizes for ground so should be easier to solder.

The second is a version without the full 8 bit port select switch. Instead I now have a single jumper to allow either D7 or A7 to be selected.

This is what the binary forms of D7 and A7 look like. They are the same apart from bits A4, A5, and A6.

D7 1101 0111
A7 1010 0111

To allow the switching bits A6, A5, and A4 must be inverted when the jumper is swapped. I can just connect the jumper to either GND or +5V, that will allow A6 and A4 to swap, but A5 must always be the inverse of them. This will need to use an inverter.

Rather than adding an extra chip to invert a single value, I decided I could swap the 74HCT32 OR chip to a 74HCT02 NOR gate. I was only using one of the existing OR gates, so swapping that over to a NOR, then running that through another joined NOR gate will give me the same result. I can also use one of the spare gates as an inverter for A5.

When no rotary encoder is connected

At present, when no rotary encoder to port 1 or 2, the output for the Schmitt Trigger is high. When a rotary encoder is present it is low. This could cause a false reading as I check for high in my code.

To solve this, I have added a pull up resistor array between the rotary encoder pins and the Schmitt Trigger. This is 100k resistor connected to +5v.

To test this works I added a 100k resistor array to a breadboard and connected it between the PCB and Rotary Encoder. When the encoder was present it worked as expected. When I removed the encoder, it also worked.

I have added this array to both of the new PCBs.

The final change was to remove the ground hook from the top right of the board. This was only for testing and ground is available on the debug port anyway.

Will the new PCBs arrive in time

There are only 9 days left before the official end of the 2024 RetroChallenge. I have ordered the new PCBs from JLCPCB, but I don’t know if they will arrive in time. I have also had to order some NOR gates from AliExpress, so that will also be over a week to arrive.

Will they arrive before the end of the challenge? I hope so!

The existing PCBs work, I just know they could be better.