BURNING AT89C52 & AT90S8515 on ALL03 (BETA3) -------------------------------------------- I found a short description of the devices on the universal programmer ALL03 by HiLo at http://matthieu.benoit.free.fr/all03/source.htm. The programmer is very old and not supported by HiLo. I wrote a program to burn AT89C51/2 from Atmel (I test only AT89C52) and a second program to burm AT90S8515 from Atmel. The program must be run from MS-DOS because timing is implemented using software loops. You can run from WIN98 but as the only program running. Atmel data sheets use 100us delay for flash programming of the AT89C52. My experience is that not all bytes are programmed so I use a 10ms programming pulse and all woks fine. The program was compiled using WATCOM 11 (http://www.openwatcom.org/) and DJGPP (http://www.delorie.com/djgpp/). 90s8515w.exe and 89c52w.exe are compiled using WATCOM (wmake -f watcom.mak). 90s8515d.exe and 89c52d.exe are compiled using DJGPP (make -f djgpp.mak). The program uses ANSI terminal so you must add "device=c:\windows\command\ansi.sys /X" in your config.sys. The program reads only binary files, so you must convert hex files to binary running hexbin.exe. ts89c52.bin is a simple program for at89c52 which flashes a LED+1kOhm to Vcc from pin 1. t90s8515.bin is a simple program for at90s8515 which flashes a LEDS+1kOhm to Vcc from pin 1. ee00.bin, ee55.bin, eeaa.bin and eeff.bin are binary files to test 90S8515 eeprom programming. Bugs! ----- The last byte of the eeprom of the 90s8515 remains always at 0xff?! In 90S8515 program lock bits (I) dont works! For programming the AT89C52 you must build a simple adapter, which breaks the connection of pin 18. I build it using a wire wrap turned pin DIL socket (40 pin) soldred on a low profile turned pin DIL socket (40 pin). I cut pin 18 and solder on it a jumper. During the programmation remove the jumper. For programming the AT90S8515 no adapters are needed. ------------------------------------------- | AT89C51/2 | ------------------------------------------- | | | | | | | | | | | | | | | | | | | | ------------------------------------------- |wire wrap turned pin DIL socket 40 pin | | 1 20| ------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o | | jumper | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------- |low profile turned pin DIL socket 40 pin | | | ------------------------------------------- | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------- | ALL03 ZIF SOCKET | | | ******** 05.08.2002 ********* How to write a new module ************************* The best method is to take 90S8515.c or 89C52.c and modify it to meet the new chip. Writing this program I broke the code in 3 levels. 0. level ALL03.C ------- Gives all functions/procedures to program a chip without dealing about ALL03 registers/devices. /* very low level */ void all03_wr_id(unsigned char id); /* writes id of reg */ void all03_wr_data(unsigned char data); /* writes data to selected reg*/ unsigned char all03_rd_data(void); /* reads data from selected reg */ void all03_wr(unsigned char id, unsigned char data); /* writes data to reg id */ unsigned char all03_rd(unsigned char id); /* reads data from reg id */ unsigned char all03_rd_ttl_buf(int i); /* read/write all03 registers buffers */ void all03_wr_ttl_buf(int i, unsigned char b); unsigned char all03_rd_vop_en_buf(int i); void all03_wr_vop_en_buf(int i, unsigned char b); unsigned char all03_rd_vhh_en_buf(int i); void all03_wr_vhh_en_buf(int i, unsigned char b); unsigned char all03_rd_vcc_en_buf(int i); void all03_wr_vcc_en_buf(int i, unsigned char b); unsigned char all03_rd_vhh_en_c_buf(int i); void all03_wr_vhh_en_c_buf(int i, unsigned char b); unsigned char all03_rd_vhh_buf(void); void all03_wr_vhh_buf(unsigned char b); unsigned char all03_rd_vcc_buf(void); void all03_wr_vcc_buf(unsigned char b); unsigned char all03_rd_vop_buf(void); void all03_wr_vop_buf(unsigned char b); unsigned char all03_rd_other_en_buf(void); void all03_wr_other_en_buf(unsigned char b); unsigned char all03_rd_id_f7_buf(void); void all03_wr_id_f7_buf(unsigned char b); int all03_is_vcc_pin(int pin); /* test if a pin may be connected to the voltage source */ int all03_is_vhh_pin(int pin); int all03_is_vop_pin(int pin); int all03_is_vhh_c_pin(int pin); /* level 0 */ void all03_set_vop(float v); /* sets Vop */ void all03_set_vhh(float v); /* sets Vhh */ void all03_set_vcc(float v); /* sets Vcc */ void all03_init_h(void); /* puts all pins of ALL03 to 0V */ void all03_wr_pin(int pin, int state); /* writes state(0-1) to pin(1-40) */ int all03_rd_pin(int pin); /* reads pin(1-40) */ void all03_wr_vcc_pin(int pin, int state); /* connects/disconnects pin to/from Vcc */ void all03_wr_vhh_pin(int pin, int state); /* connects/disconnects pin to/from Vop */ void all03_wr_vop_pin(int pin, int state); /* connects/disconnects pin to/from Vhh */ void all03_wr_vhh_c_pin(int pin, int state); /* connects/disconnects pin to/from Vhh_c */ void all03_set_gnd_20(void); /* connects pin 20 to gnd but disconnects pins 11, 30*/ void all03_set_gnd_11_30(void); /* connects pin 11 and 30 to gnd but disconnects pin 20*/ void all03_set_vcc_pin(int pin, int state); /* connects pin to the voltage source */ void all03_set_vhh_pin(int pin, int state); /* writes 1 to pin and disconnets all */ void all03_set_vhh_c_pin(int pin, int state); /* other voltage sourcses */ void all03_set_vop_pin(int pin, int state); #define all03_clear_busy_led() all03_set_vcc(0.0) /* clears busy led */ #define all03_set_vop24_7(x) all03_wr_vop24_7(x) /* connects/disconnects Vop-2.4V to/from pin 7 */ #define all03_set_vop24_25(x) all03_wr_vop24_25(x) /* connects/disconnects Vop-2.4V to/from pin 25 */ #define all03_set_osc_2_3(x) all03_wr_osc_2_3(x) /* connects/disconnects fosc to/from pins 2, 3 */ #define all03_set_osc_18_19(x) all03_wr_osc_18_19(x) /* connects/disconnects fosc to/from pins 18, 19 */ void all03_select_f_osc(int val); /* selcts fosc 0=2.2MHz 1=4.4Mhz */ char all03_dec_to_hex(int dec); int all03_hex_to_dec(char h); unsigned char all03_reverse_bits(unsigned char by); void all03_edit_base(void); /* edit/change base address of all03 */ void all03_dump(void); /* dumps all03 regs */ void all03_wr_led_good(int state); /* switches led good on/off */ int all03_test_base_address(void); /* test if base address valid */ unsigned short int all03_get_base_address(void); /* returns base address */ void all03_set_base_address(unsigned short int ba); /* sets base address */ all03ft.c --------- void test(void); /* test timing 30000ms */ int get_file_name(char *input_string, char *file_name); /* inputs file name */ void read_file_to_buf( /* reads file to buf */ char *input_string, char *file_name, unsigned char *buf, unsigned int buf_len, unsigned char fill); void write_buf_to_file( /* writes file to buf */ char *input_string, char *file_name, unsigned char *buf, unsigned int buf_len); void flush_out(void); void enable_ctrl_c_break(void); void disable_ctrl_c_break(void); int test_if_timer(void); /* returns 1 if timing not ok */ sleep.c ------- #define wait(x) fdelay_ms(x) long get_timer_ticks(void); /* reads pc timer ticks */ unsigned long get_one_ms(void); /* returns 0 if timing not ok */ int test_timer(void); /* test precessor speed returns 1 if not ok */ void delay_ms(int n); /* delay routine in ms int */ void fdelay_ms(float f); /* delay routine in ms float */ keys.c - uses ANSI.SYS ---------------------- #define K_LA 0x014b /* left arrow */ #define K_RA 0x014d /* right arrow */ #define K_HOME 0x0147 /* home */ #define K_END 0x014f /* end */ #define K_BS 0x0008 /* back space */ #define K_DELETE 0x0153 /* delete */ #define K_CR 0x000d /* return */ #define K_ENTER 0x000d /* return */ #define K_ESC 0x001b /* esc */ void set_xy_pos(int x, int y); /* sets x (0..79) and y (0..24) for printing */ /* reads/edits string */ int inputstr(int x1, int y1, char *title, char *st, int ml, int mw); int key_get(void); /* reads keyboard */ void wait_esc(void); /* waits escape */ void wait_enter(void); /* waits enter */ void clear_screen(void); 1. level 89C52 first part and 90S8515 first part 2. level 89C52 second part and 90S8515 second part If you want to access directly ALL03 registers for writing using wr you must first read the buffer of the corresponding register, set or reset bits in this buffer and then write this buffers to ALL03 register (all registers except ttlid are write only). To set pin 1, 2, 3 and 4: a) int i, temp; i=0; temp=all03_rd_ttl_buf(i); temp|=0x0f; all03_wr_ttl_buf(i, temp); all03_wr(ALL03_TTL_ID+i,all03_rd_ttl_buf(i)); b) all03_wr_pin(1,1); all03_wr_pin(2,1); all03_wr_pin(3,1); all03_wr_pin(4,1); ******** 06.08.2002 ********* Module 90slv[w|d].exe ********************* Burns AT90S8515, AT90S/LS2323/2343 in low voltage serial mode (use adaper A40OSC). For AT90S8515 are not avalible commands to read lock and fuse bits and comand to burn fuse bits. For AT90S/LS2323/2343 (use adapter A8T14VCC) you cant burn FSTRT fuse bit. Tested on AT90S8515 and works fine! Adapters ******** A40OSC ------ Converts from 40 (uC) to 40 (ALL03) pin socket 1-1, 2-2, 3-3, 4-4, 5-5, 6-6, 7-7, 8-8, 9-9, 10-10, 11-11, 12-12, 13-13, 14-14, 15-15, 16-16, 17-17, 19-19, 20-20, 21-21, 22-22, 23-23, 24-24, 25-25, 26-26, 27-27, 28-28, 29-29, 30-30, 31-31, 32-32, 33-33, 34-34, 35-35, 36-36, 37-37, 38-38, 39-39, 40-40 Connection from pin 18 to pin 18 is broken! A8T14VCC -------- Coverts from 8 (uC) to 14 (ALL03) pin socket 8_PIN_SOCKET(1) to 14_PIN_SOCKET(4) 8_PIN_SOCKET(2) to 14_PIN_SOCKET(5) 8_PIN_SOCKET(3) to 14_PIN_SOCKET(6) 8_PIN_SOCKET(4) to 14_PIN_SOCKET(7) 8_PIN_SOCKET(5) to 14_PIN_SOCKET(8) 8_PIN_SOCKET(6) to 14_PIN_SOCKET(9) 8_PIN_SOCKET(7) to 14_PIN_SOCKET(10) 8_PIN_SOCKET(8) to 14_PIN_SOCKET(14) <---- 19.03.2003 ---------- The structure of the program is changed moving various files in a directory structure. common=common functions doc=documents lib=common library include=common include files sch=schematics directory for every device-module (New) Modules: 89c5x: working ok (89c52 in parallel mode) 89s5x: work in progress (89s52 in isp mode) pic16x8y: working ok (pic16c84, pic16f84) 89cx051: working ok (at89c1051, at89c2051 and at89c4051) 90s8515: minor problems (at90s8515 in parallel mode) 90slv: working ok (at90s8515 in isp mode) ********************************************* **** by FaSt - (fabio.sturman@tiscali.it) *** *********************************************