About the article

Swiss Army Knife

Tiny BASIC, 8051 assembler, RS232 and USB all in one project

Swiss Army Knife
In a fix? Need to get a microcontroller project off the ground FAST? This article proves that an ultra-versatile microcontroller board can be built and programmed even by relative newcomers.The main circuit is based on the Atmel 89C8252 which has an 8052 architecture. Included is some very special (free) software that enables even the most code shy among you to make the controller do something. There are two alternatives to communicating with the circuit: USB 2.0 or RS232.The original intention of the project was to produce a controller with built in BASIC that could retain the program after switch off, automatically start at switch on and not consist of too many chips. It should also be very easy to use and not require any special software on the PC. This has been achieved with more or less a single chip. This is possible because the 89C8252 has 2 kB of data EEPROM that can be programmed with high level instructions. The AT89C8252 micro was first used in the Elektor ’51 Flash Micro Board published in December 2001 and now a ‘classic’ with PCB sales in the ‘k’ range.
Downloading of this magazine article is reserved for Elektor Members only.
Already a member? click here to log in.
Extra info, Update
There is a new version of TCB (TB-2-K), which enhances the existing TCB as follows:
New comment symbol, allows source code to be commented without being stored.
Better error handling, indication line number where error occurred.

Hex - handling of hex numbers improved, numbers can now be either decimal or hex without changing the operating mode. Example, a=&FE.

LOADB - massive time saving feature, LOADB will now load a TCB program with or without line numbers.

I2C - Full support for I2C devices using software, no special processor needed, new I2C commands: CPOKE, CPEEK, CPUT, CGET, CREAD & CWRITE.

24LC256 - EEPROM support (LOAD & SAVE), enables programs to be saved and loaded thus eliminating the need for a battery backed RAM.

RUN - extended to allow running programs in RAM space, when called from ROM space

There is also a version that will work on the Elektor Electronics ‘Flash Microcontroller Starter Kit’ — the same as above but with automatic RAM detection switched off.

The updated files are incorporated in file download no. 030448-11.zip
MCU board
R1-R4 = 1kOhm
R5 = 10kOhm
C1,C2 = 22pF
C3 = 10µF 16V radial
C4,C5 = 100nF
D1,D2,D3 = LED, low current, colours to personal taste
IC1 = AT89S8252-24PC, Dip40 case, programmed, order code 030448-41
IC2 = 74HC240
K1 = 40-way boxheader (two pin rows)
K2 = 14-way socket, angled pins, two receptacle rows
S1 = pushbutton, 1 make contact, miniature
X1 = 22.1184MHz quartz crystal

USB interface
All parts SMD, case shape 1206
R1 =10kOhm
R2 = 2kOhm 2
R3,R4 = 27Ohm
R5 = 1kOhm 5
R6 = 470Ohm
R7= 1kOhm
C1,C3,C5,C6 = 100nF
C2 = 10nF
C4 =47nF
C7 = 10µF 6.3V SMD
T1 = IRLML6402
IC1 = FT232BM (FTDI, www.ftdichip.com)
IC2 = do not fit (93C46B SO8)
K1 = USB connector, type ‘B’, PCB mount
K2 = 14-way socket, angled pins, two receptacle rows
X1 = 6MHz ceramic resonator, 3 pins

RS232 board
R1,R2 = 2kOhm 7
C1-C5 = 10µF 16V radial
C6 = 1000µF 25V radial
C7 = 100µF 16V radial
C8 = 100nF
B1=B80C1500, round case (80V piv, 1.5A)
D1 = 4.7V zener diode, 500mW
IC1 = MAX232 (Dip16 case)
IC2 = 7805
K3 = mains adapter socket, PCB mount, angled pins
K1 = 9-way sub-D socket (female), angled pins, PCB mount
K2 = 14-way angled pinheader, two pin rows
Loading comments...