-
Kit and/or assembled OKOS computer
01/03/2019 at 01:15 • 0 commentsI'm thinking of making this a gadget or kit. Same cpu, same okos, same oled display. Might use the ps2 variant so you can plug in a real keyboard, and would probably be cheaper. Could be pretty small, maybe battery powered.
Any interest? What would you like to see?
-
OKOS Capacitive Touch Keyboard
12/20/2016 at 03:01 • 4 commentsOooooh, shiny!
After wrangling Eagle a bit to let me make a regular sized qwerty keyboard, I ended up just using it to draw things and trace an outline and moving the actual electronics to a separate board.
The controller is made by overlaying a bunch of the circuits before printing the tone transfer sheet.
The code for the daisy-chained keyboard works, though I had to add 1 more instruction. I've got a "clever" hack, whereby I reuse a portion of the ISR as a subroutine and keep the
retfie
to both return and re-enable global interrupts. The only problem is that it also corrupts PCLATH with garbage because it isn't an interrupt. You see, normally the interrupt saves a bunch of things in shadow registers before it hits the ISR, andretfie
restores all this for you, but in my case the first call is made form main code, and the shadow registers are not yet initialized. Interesting things happen whenPCLATH
is loaded with garbage right before you try to make a call...So 61 total instructions, or 106.75 bytes. That should still leave plenty for receiving.
-
Daisy-chained touch controller in 105 bytes
12/19/2016 at 07:31 • 0 commentsSo it looks like having a PS2 keyboard, while making it easier for anyone to jump in and try this, would potentially disqualify OKOS from the 1k challenge. I can't find any documentation on the controller in my particular keyboard, but there's likely some disqualifying mask-rom microcontroller in it.
I could just write my own controller for the PS2 keyboard, figuring out how its wired, scan, translate, etc., but I don't really have any code space left to decode AND scan. Plus this wouldn't be nearly as fun or interesting as making something new.
I've looked at implementing a matrix scan, but don't really care for that. Plus I'd need a pile of mechanical switches. In the end I'd have a keyboard I wouldn't really enjoy typing on without a substantial investment of time. One of the key design drivers for OKOS was a minimal but usable computer, the keyboard has to be usable. For example, I love the idea of the Pocket CHIP, but the bubble-style keyboard is atrocious to use.
I could do some kind of resistive thing, few parts, simple, but those don't work very well.
Yes, capacitive touch is what this calls for. I think it will make for a nice, low parts count keyboard.
Rather than find some chip with 44 touch channels, I can use some chips I already have (PIC16f1574), and take advantage of the 1k rules that allow duplicate code execution.
So I'm making a daisy-chained touch controller. Each controller handles 8 channels, and you could run up to 32 controllers for 256 channels. OKOS only needs 45 keys, or 6 controllers. The code is only 60 instructions, at 14 bits, thats 105 bytes. Each controller is completely identical and requires no identification configuration, its place in the chain determines it's ID.
With a bit of wiring, I can make the key and controller placement align naturally with the OKOS charset.
After removing all of the existing keyboard support, and counting the new keyboard controller code, I'll have 22 bytes left to receive the keyboard data. I think I'll need to borrow the RX uart, which is currently hooked up to the IR receiver on the badge. Putting some tape over it should prevent it from firing spontaneously. It should work!
Then OKOS will qualify for the 1k challenge! Maybe I'll enter the keyboard controller on it's own :)
-
Working on a test program
12/07/2016 at 05:10 • 0 commentsI've tested the various components, but it would be cool to have something interesting happen with the whole thing together. So I'm writing a little test program that drives the 74hc138 and sct2024 in the SuperCon badge, enough to blink an LED.
With a compile flag, it will push some test files to the chip. One is source code, the other is a program assembled by MPLABX of the same program. Then when you boot up the chip, you can start assembling a program without having to type everything in the functional but minimal editor.
I was able to assemble the source code, get a hex dump of program flash, and verify that the MPLAB compiled code matches the on-chip assembly!
The LED blinking part isn't working, but hey, everyone has seen blinking LEDs before.
Here's a quick demo of the editor