Close

More hardware and code modifications

A project log for 8042 clock

Using a keyboard controller MCU from old PCs

ken-yapKen Yap 10/18/2018 at 04:050 Comments

I decided to put in a brightness button connected to a port 2 bit, to cycle the brightness levels. When I powered up the breadboard the LED blinked at the correct rate but didn't turn off completely; looked like some extra bit changes were happening.  Were the port bit AND and OR instructions in the set doing the right thing? Seems so, bit banging is exactly their purpose and other people used them with no problems. So I added a conditional section to my code, which is a standalone Blink program, made another EEPROM and tested it. Turned off the LED cleanly. I looked at my code again, and saw that I was reading  port 2 at one point to get the state of the brightness button. Long story short, the read didn't return high for the other bits as I thought. I removed the read and the LED blinked cleanly. But how will I get a brightness button now?

So I decided I would overload the hour and minute buttons so that pressing both simultaneously would cycle the brightness level. Simultaneous means both buttons down within the debounce periond (100 ms) of each other so it won't affect single button functions. Tested this in the simulator and got it to work after some iterations. So now there is no need to read port 2 and I've saved a button.

Added a discharge diode for the reset capacitor so that it will be ready for the next power on quickly.

Now to wait for the serial line LED displays to arrive.

Discussions