(****************************************************************************) (* Atmel-to-file utility zum Lesegerät für Microcontroller *) (* ------------------------------------------------------------------- *) (* copyright (c) 1999 by Hubersoft Corp. All rights reserved. *) (****************************************************************************) uses crt,dos; var counter, result: word; puffer: array[0..1999] of byte; f: file; dir: string; procedure readchip; begin port[$37A]:=port[$37A] and not 8; {einschalten} delay(100); {auf Vcc warten} port[$37A]:=port[$37A] or 32; {EPP read mode} port[$37A]:=port[$37A] and not 4; {reset low} port[$37A]:=port[$37A] or 4; {reset high} port[$37A]:=port[$37A] or 1; {clock low} for counter:=0 to 1999 do begin port[$37A]:=port[$37A] and not 1; {clock high} puffer[counter]:=port[$378]; port[$37A]:=port[$37A] or 1; {clock low} end; port[$37A]:=port[$37A] or 8; {ausschalten} port[$37A]:=port[$37A] and not 32; {EPP write mode} end; begin writeln('The Hubersoft AT2file Utility (v1.0) - copyright (c) 1999 by Hubersoft Corp.'); if paramstr(1)='' then begin writeln('Usage: at2file [imagefile]'); halt; end; getdir(0, dir); if dir[0]>#3 then dir:=dir+'\'; assign(f,dir+paramstr(1)); {$I-} rewrite(f, 1); {$I+} if ioresult<>0 then begin writeln('Error creating file!'); halt; end; write('Reading...'); readchip; writeln(' OK'); counter:=2000; blockwrite(f, puffer, counter, result); close(f); writeln('Done.') end.