DemUino - Home Computer/Controller

Introduction: DemUino - Home Computer/Controller

An Arduino Inspired Computer by DemeterArt

Make the most of your old PS2 keyboard. Hack it into a customized personal computer to control stuff! I ‘ve always wanted to build my own home computer, kind of retro-style, nothing fancy but with particular capabilities tailored to my preferences. So, I got to it with the atmega328 MCU and the Arduino development kit.

Let me state that this project would have taken considerably longer with dubious end results if it were not for the gifted fans out there who selfishlessly supply the freeware libraries for everyone to use. Thank you all :-)

visit my site to read the whole story and download all relevant files

Step 1: Features

  • Based on the ATMEGA328 with 32KB flash, 2KB SRAM and 1KB EEPROM.
  • support for interactive and batch modes
  • line editor and list-while-edit mode
  • 8 custom characters for user graphics
  • 60 program steps numbered 00,...,99
  • ‘If’ conditional, ‘while’ and ‘for’ loops plus ‘goto’ and ‘sub’ statements for branching
  • Basic arithmetic and mathematical expressions plus boolean tests
  • system variables allow for timed events, average, rms, min and max values from analog pins, etc
  • 26 user variables to interact with system variables and commands
  • 104 bytes of a user addressable array or 52 short integers
  • ability to read/write program data as well as code on-the-fly (p variable)
  • mini oscilloscope app with customized characters for pseudo graphics
  • save and load programs and data to/from EEPROM
  • load/save programs and variables from/to PC
  • autoexec into loading and running a program from EEPROM after each reset
  • 9 GPIO pins (SPI included) available on external DB15 connector
  • BUZZER for sound effects

Step 2: Stuff You Will Need

An old ps/2 keyboard thick enough to house the pcb
LCD character display (the popular parallel format)
MAX232 chip for RS232 port
atmel atmega328PU
Arduino development kit with IDE 1.0.1
LM7805 regulator
5V buzzer
bridge rectifier , capacitors, a reset push button, connectors etc

Step 3: Burning the Bootloader

So, after having bought an ‘empty’ atmega328PU chip there is a decision to be made. Do i use a special programmer either external or ISP or do I burn the Arduino bootloader into the beast and render the unit programmable via its UART port? I chose the latter to make my life easier! The new bootloader occupies only half a kilobyte of flash memory leaving a little more than 31KB of user program and static data available. TheArduino site covers the case of burning the bootloader on a new chip, when it came to using avrdude to actually burn the target chip the process failed with an error indicating the wrong id for the particular MCU. So after some searching I found this guy who got it right and I followed his procedure. The only difference was 2 configuration files, avrdude.conf and boards.txt needed by avrdude and arduino IDE 1.0.1 to make it possible. After copying the 2 files to their proper locations (backup the old ones first) the option ‘arduino328’ from tools->Board was available and avrdude proceeded with burning the fuses and the bootloader. Now the chip is ready to be programmed from within the new machine!

Step 4: Building the Unit

A perforated board with copper strips was used as a fast assembly solution with DIP sockets for the chips, you know, just in case! Then the holes and cuts for the connectors, the reset button and the LCD display were opened through the extremely sturdy and thick plastic of the keyboard. Yeah, that was built 25 years ago! There followed the mess of wires emanating from the pcb towards the various peripherals. A rudimentary continuity check and then the supply was connected with no chips populated just to check the sockets for proper voltages. Then came in the 2 ICs and the keyboard case was firmly closed via its plastic snaps at the bottom. The unit was ready to burn sketches in the controller!

I suggest one uses nonpolar 1uF/16V capacitors for the MAX232 charge pumps. Locate the 100nF decoupling capacitors for the two chips as close as possible to the respective VCC and GND pins. Use a star connection for the power and ground referenced to the LM7805 regulator. Switch 2 could be a jumper depending on impementation but it is good to have if only to avoid unwanted MCU resets from the host PC in certain cases. At any rate, the switch must be closed to allow for the Arduino IDE to burn the sketch via resetting the target MCU (pin DTR of RS232). In my case the connection is permanent (always closed). Use a series resistor for the buzzer to isolate the several nFs of capacitance from the driving gate ... you never know.. Locate the XTAL and the loading 18-22pF capacitors as close as possible to the respective pins of the controller.

Due to the rectifier bridge the unit may be powered by both AC and DC power adapters. In case of DC, there is a 1.5 V voltage drop between the adapter and the input to the regulator. In case of AC the input of the regulator is about 1.4 times the RMS output of the adapter or less due to loading. If the difference between the input of the regulator and its output (+5V) is large, say 7 volts, then the power consumed by the regulator approaches 0.5 watts and it is better to use a small heatsink upon which to mount the chip (provided there is space for it) for long hours of operation in hot weather.

The AC input fuse may be selected depending on your external loads (via the DB15 connector). Other factors that influence the fuse choice are the current limiting resistor for the LED backlight of the LCD, the bridge capacitor for the charging current and the current capacity of the supplying transformer.



This is the sketch that makes it all happen... and 32KB is NOT enough! You can either use it unmodified, in which case I would appreciate a reference to my name, or change it at will and forget about me ;-)

This is the detailed documentation about the machine.

Summary of Commands & Expressions

“ : a nonprintable comment line

ai : attach interrupt 0 (pin D2)

ar : analog read

aw : ‘analog write’ per arduino or more properly pwm

ca : analog capture in an array

cl : clears the display cno: return *Prgm[] index of line number

di : wait for a series of pulses and measure duration and timing

dl : delay

do : in conjunction with ‘wh’

dr : digital read any pin

dw : digital write any pin

ed : editor mode / load program from PC / renumber lines

el : EEPROM access function

end : the END statement of a program

ensb: ends subroutine

es : EEPROM access function

fl : simple moving average filter

fr : for-next loop (fr-nx)

go : jump to program step

gosb: continue execution to subroutine

gt : waits for user input

if : test condition and jump to step

io : GPIO 1-9 bits

ld : load/merge program from EEPROM

lp: : keyboard controlled loop in interactive mode

ls : list mode / send program to PC a line at a time

ml : get time

mm : display free memory

nos : converts number to string

nx : in conjunction with ‘fr’

pl : plot array cxx

pm : set pins for in or output

pr : prints a message or value or custom character

rgc : range copy command for arrays

rgs : range set command for arrays

rn : run the program in RAM

rs : soft reset

rx : receive a character via RS232

si : synchronous serial input with clock and data pins

sm : mini oscilloscope app sno : converts string to number

so : synchronous serial output with clock and data pins

sub : declares subroutine

sv : save program to EEPROM

tn : beep a tone

tx : transmit a number via RS232

wh: a do-while loop used in conjunction with ‘do’

Step 7: Videoclip of Mini App 'sm' Running

visit my site to read the whole story and download all relevant files

Arduino Contest

Participated in the
Arduino Contest

Be the First to Share


    • Space Contest

      Space Contest
    • Micro:bit Contest

      Micro:bit Contest
    • Back to School: Student Design Challenge

      Back to School: Student Design Challenge