@Danjovic: thanks for the feedback! I really appreciate it. Do you have any tips for a humble student of these arts to improve on this design?
Hi. My USB keyboard interface for Philips without the enclosure could also work on the NMS8235 with some rewiring. See github.com/jeroentaverne. Let me know if interested.
I'm always interested ;-). The device looks neat! I have an NMS-8255, so it should work. The only obstacle may be that I really need something with a PS/2 interface, so that I can hook it up to my KVM switch.
As for my own design, feedback is still welcome. My purpose for it right now is mainly to learn, as I am trying to teach myself electronic design.
The challenge for a keyboard emulator is to keep the latency below 3.77us which is the budget you have between an "out" instruction to select a row and the subsequent "in" instruction to read the column data.
Please take at look at the EXPS/2 article.
You should keep all the output pins on the same port, which is port D for the ATMega328 used in Arduino, in order to write to the output using as few instructions as possible.
As for the input the encoder younhave used is ok but it is possible to split them between ports B and C like in Caro design, as the ls148 inside the MSX will only drop one line at a time to scan the keyboard, and replicate the interrupt code for the other pin change interrupt service routine (atmega328 provides 3 ISRs for pin change)
Ok. Thanks for the advice!
You should keep all the output pins on the same port, which is port D for the ATMega328 used in Arduino, in order to write to the output using as few instructions as possible.
As for the input the encoder younhave used is ok but it is possible to split them between ports B and C like in Caro design, as the ls148 inside the MSX will only drop one line at a time to scan the keyboard, and replicate the interrupt code for the other pin change interrupt service routine (atmega328 provides 3 ISRs for pin change)
In my original design I had all the pins for the output to the MSX (X0..X7) on port D. However, the Arduino documentation states that on an Arduino Uno only pins 2 and 3 are available as interrupt pins and as far as I know pins 2 and 3 are both on port D (PD0 and PD1) of the ATMega328. Is that incorrect?
The ATMega328 provides other sources of interrupt than the supported by arduino standard libraries. The Pin Change Interrupts, for instance, come in handy for a keyboard emulator.
Nevertheless it is necessary to write your own interrupt vector code because the context saving provided by standard C interrupt library waste too many cycles. Take a look at the source code of my keyboard emulator (link).