You are on page 1of 6

BlowIT 2051

AT89C2051 Programmer

12V

5V
R2
GND
2.7k

13
25
R1 12
10k 24
Q1 11
BC547 23
10
22
IC1 9
1 20 21
RST VCC
2 19 8
P3.0 P1.7
3 18 20
P3.1 P1.6
4 17 7
XL2 P1.5
R4 5 16 19
XL1 P1.4
10k 6 15 6
P3.2 P1.3
7 14 18
P3.3 P1.2
C1 8 13 5
P3.4 P1.1
1nF 9 12 17
P3.5 P1.0
10 11 4
GND P3.7
16
AT89C2051 3
15
R3 10k 2
14
Q2 1
BC547 R5 1k
DB25M to PC LPT

Copyright © 1996 Silicon Studio Ltd. 1 DS0301


BlowIT 2051

Description Direct LED drive


12 or 24 MHz max clock
BlowIT 2051 is simplest possible burner for UART
AT89C2051 Flash Microcontroller. It is “as simple Analog Comparator
as possible” only designed for fast and dirty jobs,
where you need to get going and fast. Only very Those are the main features.
few components are required. Functionality is mini- What is unbelivable is the price: below 2USD
mal, only erase and program are implemented.
Software Tools for AT89C2051
Power Supply
Any 51 Software can be used
Basically +5 and +12 are available inside the PC There are many free assemblers. The best are
on the floppy/HD power cable as example. Well Metalink and Intel ones. BAS051 Basic compiler
use them at your own risk. A simple power supply from W. Washington is not useable, as it places
can be buildt using 7812 and 7805. vars in extrernal memory. BASCO from Silicon Stu-
dio is a AT89C2051 comaptible Basic Compiler.
Using BlowIT Software
Additional Information
Current release only supports binary files, use
HEXBIN.EXE to convert from hex to binary. LPT1 Datasheets for AT89C2051 can be downloaded
to LPT3 can be used, LPT1 being the default. Pro- from Atmel’s WWW site
gram is been tested to run in Windows 95 DOS http://www.atmel.com
Box.
Updates and Bugfixes
Correct Cable
BlowIT executable can be downloaded from
Get a good DB25 extension cable and not too long Silicon Studio’s WWW site:
one. All pins must be connected 1:1. I used a 5m http://sistudio.com
long modem extension cable and it worked fine.
When using a shorter cable then R5 and C1 may We are interested to hear if there are any prob-
be obsolete, with a real long cable they where nec- lems using this hardware. Send us mail to:
essary to get reliable results. comments@sistudio.com

About AT89C2051 Disclaimer

AT89C2051 is a Intel’51 compatible Microcon- This hardware and program are tested on one single
troller from Atmel. computer (486-DX66). It most likely works on most
PC computers but we take no responsibility which
Package DIP20 or SO20 or whatever. Use at your own risk.
Program Memory 2k Bytes (Flash)
RAM 128 Bytes

Copyright © 1996 Silicon Studio Ltd. 2 DS0301


BlowIT 2051

Program listing

This is the first working version. It is not “cleaned


up” or fully commented. The VTD unit is a respon-
sible for time delays.
Program BlowIt2051;
{$D Copyright (C) 1996 Silicon Studio}
Uses VTD;
var
base: Word;
i, j, k, l: Integer;
mem: Array[0..2047] of byte;
f: file;
Const
inc_bit = $01;
vpp_bit = $02;
prog_bit = $04; { not inverse! }
erase_bit = $08;
prog_mode = $0F;
erase_mode = $07;
idle = $09; { Idle, RST = 0 }
label
err_exit;
begin
Writeln;
Writeln(‘————— BlowIT (tm) 2051 ver 1.0 beta —————’);
Writeln(‘http://sistudio.com for schematics and latest release’);
Writeln;

if ParamCount<1 then begin


Writeln(‘usage: BI2051 filename.bin [n]’);
Writeln(‘usage: n=1,2,3 LPT number to use’);
Writeln;
halt(1);
end;
base := memw[$40:8];
if ParamStr(2) = ‘2’ then begin
base := memw[$40:10];
end;
if ParamStr(2) = ‘3’ then begin
base := memw[$40:12];

Copyright © 1996 Silicon Studio Ltd. 3 DS0301


BlowIT 2051

end;
If base = 0 then begin
Writeln(‘Parallel port does not exist!’);
Halt(2);
end;
for i:=0 to 2047 do mem[i] := $FF;
assign(f, ParamStr(1));
reset(f,1);
blockread(f, mem, 2048,i);
close(f);
If IOResult <> 0 then begin
Writeln(‘File not found!’);
halt(2); { File error }
end;

port[base] := $FF;
{ Erase }
port[base+2] := $01;
nms(10);
port[base+2] := $03; { RST = 12 }
nms(1);
port[base+2] := erase_mode; { RST = 12, PROG = H }
nms(1);
port[base+2] := erase_mode xor prog_bit; { P3.2 = 0 }
nms(12); { This is ERASE PULSE!}
port[base+2] := erase_mode; { P3.2 = 1 }
nms(12);
port[base+2] := erase_mode xor vpp_bit; { RST = 0 }
nms(20);

{ Program ROM }
port[base+2] := idle;
nms(10);
port[base+2] := idle or vpp_bit;
nms(10);
port[base+2] := prog_mode; { RST = 12, PROG = H }
nms(1);
Write(‘Blowing’);
k := 0; l := 0;
for j := 0 to 2047 do
begin
port[base] := mem[j];

Copyright © 1996 Silicon Studio Ltd. 4 DS0301


BlowIT 2051

if mem[j] <> $FF then begin

delay_mks(2);
{ PROG Pulse}
EnterCriticalSection;
port[base+2] := prog_mode xor prog_bit; { P3.2 = 0 }
delay_mks(5);
port[base+2] := prog_mode; { P3.2 = 1 }
delay_mks(2);
i := 0;
while (port[base+1] and 64) = 0 do
begin
delay_mks(10);
if i>200 then begin
Writeln;
Writeln(‘Error, never ready?’);
goto err_exit;
end;
if i > k then k := i;
inc(i);
end;
LeaveCriticalSection;
if l > 30 then begin
Writeln;
Writeln(‘Error, no device?’);
goto err_exit;
end;
if i = 0 then inc(l);
delay_mks(2);
end;
port[base+2] := prog_mode xor inc_bit; { XT1 = 1 }
delay_mks(5);
port[base+2] := prog_mode; { XT1 = 1 }
delay_mks(2);

if (j mod 64) = 0 then Write(‘.’);


end;
port[base] := $FF; nms(1);
port[base+2] := prog_mode xor vpp_bit; { P3.2 = 0!! }
nms(1);
port[base+2] := idle;
port[base] := $00;

Copyright © 1996 Silicon Studio Ltd. 5 DS0301


BlowIT 2051

Writeln;
Writeln(‘We are finished.’);
Halt(0);

err_exit:
LeaveCriticalSection;
Halt(1);
end.

Copyright © 1996 Silicon Studio Ltd. 6 DS0301

You might also like