I just got an Ericsson Chatboard from a friend the other day. He notified me of the fact that the processor was aome 8051 clone, which have the same pinout as an AVR 8515 (and also mega8515, mega162).
Well, that was just too tempting 😉

The chatboard is a small 100*50*12 mm keyboard with 49 keys. It can easily be found on eBay or similar for about US$3.
It has all alphanumeric keys, left and right arrows, a shift and backspace key and 7 special keys. In it’s original form, it sends sequences of digits to imitate the use or a numeric keyboard to enter text on a cell phone. Possible to decode but rather messy. And, it DID have a processor that could easily be replaced by an AVR, remember ?

If you’re too lazy or not adventurous enough to add a new CPU, you can decode the original message mess. You can find some documentation on that here : http://www.ipsec.info/~www/agenda/index.php
Now, to business….

I opened up the small enclosure and removed the old 8051 cpu, and added a mega162 instead. The reason for the mega162 is just that I have plenty of them, you can use a mega8515 or 8515 instead.
There is a 11.059 MHz crystal or resonator on the PCB. We’re overclocking it a bit, but it will normally work fine.

Chatboard PCB

PCB closeup

The RESET pin on the 8051 had a decoupling cap to VCC. This needed to be connected to GND instead for the AVR. This was easy, as the cap could just be rotated 90 degrees and soldered onto the ground plane.

I pondered a while over how I could add another connector instead of the standard Ericsson phone connector. Also, the electrical interface had to be determined. Both questions more or less solved themselves.

I reverse engineered the schematic and found that the previous interface used the UART of the processor, and that some buffering was already in place on the PCB. As the UART pins are the same on the mega162, which I choose to use, that was settled.

New processor

New wiring

I had decided to add a bootloader to the processor, so it could easily be updated with new or modified software. So I added a standard IDC 10 pin header on a few wires so I could reprogram the mega162. While doing this, I found that the IDC connector would fit perfectly instead of the original connector.

While I really didn’t need all 10 pins when the chatboard was finished, it did mean that I could keep the regular SPI programming interface of the CPU, while adding the new serial communication line. That would in some way remove the need for a bootloader, but well, I already had that down and working.

View of connector

Back of chatboard

To set it all up, program the fuses on the mega162 like this : Brownout at 2.7V (BODLEVEL = 101) Boot section size 1024 words (BOOTSZ = 00) Enable Boot (BOOTRST = 0) External Crystal (CLOCKSEL = 1110, SUT = 11) Then program the STK500 compatible bootloader. You need to recompile if using a different CPU than the mega162.

You can now program the application code by using the internal bootloader.
Connect the chatboard to the PC using some RS232 level converter, through the STK-500 board or similar. Hold down the Yes key while powering on the chatboard. That causes the bootloader to activate. Now start your regular STK-500/AVRISP programmer in AVR-Studio. It should recognize the chatboard and you can program the application code as usual.
After programming, power cycle the chatboard and start up a terminal program. You should now be able to write text with the chatboard.
Click image to see a larger schematic.

The software for the chatboard is written in C-code, as speed is not an issue. It has autorepeating keys, just as a regular PC keyboard.
As there’s no Enter key, I’ve used the left and right arrows as CR and LR respectively.
The shift key works as a toggle key between upper and lower case letters.
The keyboard is organized as a 7×7 matrix with rows and columns connected to the B and C port of the AVR.

Download Chatboard code

Download STK-500 compatible bootlader