Character Keyboard for the WDTV / WDlxTV - Media Player >>UNDER DEVELOPMENT<<

 

Perhaps you know the WDTV HD media player manufactured by Western Digital?
See the official WDTV Media Player homepage for more information!

(For this player there is a great alternative firmware available, supporting networking and multiple file formats: B-RADs WDlxTV alternative firmware page)

But there was one great disadvantage with this player: When using the built-in youtube client and searching for a video, you have to select every character with the "up-down-left-right" keys on the remote control which takes a lot of time which is crap. On the other side there seems to be no support for USB keyboards yet. So I decided to program a little PIC micro controller which can be connected to a PS/2 compatible keyboard, receives the pressed keys and moves the cursor over the on-screen virtual keyboard selecting the correct characters by transmitting the corresponding infrared commands.


Picture of the on-screen keyboard

 

Step I: Getting the IR codes and transfer protocol

For building my own remote I had to get the IR commands and the functionality of the physical transfer layer.
When capturing a command with my digital storage oscilloscope, I realized that the WDTV uses the same protocol as the Olympus Remote Control I've built for my DSLR, the Extended NEC Protocol.


"Power" - button pressed, complete data packet

A data packet consists of a 16 bit address, 8 bit data and 8 bit data inverted.
The address used by the WDTV is 0x7984, data commands are listed in the table below.


Buttons <-> commands

 

Step II: "Cursor control"

The most extensive task was the control of the cursor. The software within the microcontroller has to keep track with the actual position of the cursor to determine how many steps in horizontal and vertical direction are required to select the required character. This gets more complex as the virtual keyboard isn't a true rectangle but has gaps as below the character "a" and "n", so you can't just go up and down to select a character cause you have to avoid to cross one of these gaps. To select capital letters and special characters you can switch the on-screen keyboard by pressing "ABC" and "@#&".

The maximum command receive rate is about 4 commands per second, more will result in lost commands. The time you have to wait when the keyboard was switched (capital letters, special characters) before it accepts any movement commands is about 280ms. So the required time for the transmission of a string mainly depends on the number of steps required to reach each char.

 

PS/2 Keyboard Interfacing

The PS/2 driver is an interrupt-controlled receiving routine for the keyboard scancodes. These scancodes are converted to ASCII-characters which are stored in a FIFO-buffer so you can type in a complete string and don't have to wait until the transmission of each char has finished before entering the next.

 

 

(c) Thomas Gulden, 04 / 2010