Mind to Mind

Ramblings from an official greybeard.

Working with Hugo

Hugo I decided to start working on my personal website again, and as an exercise I decided I’d create my own theme etc. as a way to learn Hugo. I am purposefully limiting the styling and use of JavaScript to create a very minimalist look and feel. Despite it’s popularity, the documentation for Hugo, even though there is a lot of it, isn’t all that great. You actually have to learn the templating language, as well as get a handle on the variables etc.

The Power of Pullups

Hacking away on the PIC16F88 trying to get it to talk to the NeXT host machine, and I kept getting very long rise or fall times for the signal when twiddling the TRIS bits. I also saw some very unusual signals on the clock line. It finally occurred to me that as an open collector bus, with no keyboard attached, the lines would float without the addition of pullups. I added two 10k resistors, and lo and behold, deterministic timings!

NeXT Timing Dilemna

After getting most things working on the PIC16F88 I started looking at the timing. On the NeXT side, data needs to be transmitted after the channel select signal on the clock line, and there is only a few hundred microseconds on either side to do anything. On the PS/2 keyboard/mouse side, given the relatively slow transmission speeds, reading the data takes on the order of a millisecond. Basically, unless I want to run the PIC16F88 at a high clock rate and continuously sampling pins to detect bits, and then feeding detected bits into concurrent hierarchical state machines, we’re stuck.

PIC Assembly

I started programming the PS/2 to NeXT adapter in C, which was fine. I managed to get most of the important parts prototyped, including being able to handle the PS/2 mouse and keyboard, and also sending data to the NeXT. I switched to assembly language the other day, partly to save space, and partly to make sure I have complete control over timing etc. I must say it’s refreshing… most of the programming I do is in Java, C#, PHP etc.