⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 isojtag_avr910_3.8.s

📁 GCC source code for do it yoursel a avr programer and jtagice debuger.
💻 S
📖 第 1 页 / 共 4 页
字号:
	cpi	u_data,'E'		// 'E' xit	brne	w15	rjmp w141				// exit command for AVR Prog	//====== 'e' - Chip Erase ===================================================w15:		cpi	u_data,'e'     		// 'e' Chip erase	brne	w16	ldi	s_data,0xac	rcall	wrser			// wrser(0xac) SPI write (byte 1)	tst	device	brmi	w151			// S89 device	ldi	s_data,0x80	rcall	wrser			// wrser(0x80) SPI write (byte 2)w151:	ldi	s_data,0x04	rcall	wrser			// wrser(0x04) SPI write (byte 3)	ldi	s_data,0x00	rcall	wrser			// wrser(0x00) SPI write (byte 4)	ldi	temp1,40			// delay 40mS	rcall	delay	rjmp	put_ret//====== 'l' - Write Lockbits ==============================================// writes Lockbits in SPI Byte 2 for old "classic" AVR Chips, and in addition// writes Lockbits in SPI byte 4 for new Mega and Tiny Devices. // One Type does not care about the other Byte...// Some more different Adresses for other devices?w16:		cpi	u_data,'l'		// 'l' Write Lockbits	brne	w161	rcall	getc			// get data	ldi	s_data,0xac	rcall	wrser			// wrser(0xac)   SPI write (byte 1)	tst	device	brmi	w163			// S89 device	mov	s_data,u_data 	ori	s_data,0xe0	rcall	wrser			// wrser(u_data) SPI write (byte 2)	rjmp 	w162//====== 'f' - Write Fusebits ==============================================w161:	cpi	u_data,'f'		// 'f' Write Fusebits	brne	w17	rcall	getc			// get data	ldi	s_data,0xac	rcall	wrser			// wrser(0xac)   SPI write (byte 1)	ldi	s_data,0xa0	rcall	wrser			// wrser(0xa0)   SPI write (byte 2)w162:	clr s_data	rcall	wrser			// wrser(0x00)   SPI write (byte 3)	mov	s_data,u_data 	rcall	wrser			// wrser(u_data) SPI write (byte 4)	rjmp	w164w163:	mov	s_data,u_data 	andi	s_data,0xe0		// S89 device	ori	s_data,0x07	rcall	wrser			// SPI write (byte3)	ldi	s_data,0x00	rcall	wrser			// wrser(0x00)   SPI write (byte 4)w164:	ldi	temp1,10			// delay 10mS	rcall	delay	rjmp	put_ret//====== 's' - Read Signature Bytes =========================================w17:		cpi	u_data,'s'		// 's' Read signature bytes	brne	w18	tst		device	brmi	w171			// S89 device	ldi 	temp3,0x30	mov 	cmd1,temp3	clr 	cmd2	ldi 	temp3,0x02	mov 	cmd3,temp3	rcall 	w123r4	dec 	cmd3	rcall 	w123r4	clr 	cmd3	rcall 	w123r4	rjmp 	waitcmdw171:	rjmp	put_err//====== 'm' - Write Program Memory Page ====================================w18:		cpi	u_data,'m'		// 'm' Write Program Memory Page	brne	w19	ldi	s_data,0x4c		rcall	wrser			// wrser(0x4c)  SPI write (byte 1)//	mov	s_data,addrh		// original, reload address	mov	s_data,pol_ah		// for speeding up transfer	rcall	wrser			// wrser(addrh) SPI write (byte 2)//	mov	s_data,addrl		// original, reload address	mov	s_data,pol_al		// for speeding up transfer	rcall	wrser			// wrser(addrl) SPI write (byte 3)	ldi	s_data,0x00	rcall	wrser			// wrser(0x00)  SPI write (byte 4)	rjmp	wait_M			// write FLASH delay//====== ':' - Universal Command ============================================w19:		cpi	u_data,':'		// ':' Universal Command	brne	w20	rcall	getc			// get data1	mov	cmd1,u_data		// cmd1 = data1	rcall	getc			// get data2	mov	cmd2,u_data		// cmd2 = data2	rcall	getc			// get data3	mov	cmd3,u_data		// cmd3 = data3	rcall w123r4	ldi	temp1,50			// delay 50mS	rcall	delay	rjmp	put_ret//====== '.' - New Universal Command ========================================w20:		cpi	u_data,'.'		// '.' New Universal Command	brne	w21	rcall	getc			// get data1	mov	cmd1,u_data			// cmd1 = data1	rcall	getc			// get data2	mov	cmd2,u_data			// cmd2 = data2	rcall	getc			// get data3	mov	cmd3,u_data			// cmd3 = data3	rcall	getc			// get data4	rcall w1234	mov	u_data,rd_s_data	rcall	putc			// send data	ldi	temp1,50			// delay 50mS	rcall	delay	rjmp	put_ret	//====== 'r' - Read Lock Bits ==============================================w21:		cpi	u_data,'r'		// 'r' Read Lockbits	brne	w22	ldi	s_data,0x58			// SPI load (byte 1)	rjmp	w22a//====== 'F' - Read Fusebits (lfuse) =========================================w22:	cpi	u_data,'F'		// 'F' Read Fusebits	brne	w23	ldi	s_data,0x50			// SPI load (byte 1)w22a:	rcall	wrser			// wrser(0x5n)   SPI write (byte 1)	clr s_data				// SPI load (byte 2)	rjmp w26//====== 'N' - Read high Fusebits ==========================================w23:	cpi	u_data,'N'		// 'N' Read high Fusebits	brne	w24	ldi	s_data,0x58	rcall	wrser			// wrser(0x58)   SPI write (byte 1)	rjmp	w25//====== 'Q' - Read extendet Fusebits ==============================================w24:	cpi	u_data,'Q'		// 'Q' Read extendet Fusebits	brne	w30	ldi	s_data,0x50			// SPI load (byte 1)	rcall	wrser			// wrser(0x50)   SPI write (byte 1)w25:	ldi	s_data,0x08			// SPI load (byte 2)w26:	rcall	wrser			// wrser(0x00)   SPI write (byte 2)	clr s_data	rcall	wrser			// wrser(0x00)   SPI write (byte 3)	rcall	rdser			//               SPI read  (byte 4)	mov	u_data,s_data	rcall	putc			// send data	rjmp waitcmd//====== Unknown Command ====================================================w30:	rjmp	put_err//====== Wait for FLASH write in avr910 mode ==================================wait_S:	//table	Dev_M		ldi	ZL,lo8(pm(Dev_M))		// low	ldi	ZH,hi8(pm(Dev_M))		// high	lsl ZL
	rol ZH
	rcall	bel_table	brcs	ws_pol			// No Page Mode, poll last Byte	rjmp	put_ret			// in Byte Mode time is long enougt to get next Byte...Bws_pol:				// entry adress for Block mode delay	ldi temp3,1	mov B_Flag,temp3		// set Flag that ws_poll comes back with ret ...ws_pol:	tst	PollcodeF		// if polling not applicable, standart delay	breq	ws_del			// polling not usedws_def:	cp 	p_data,PollcodeF	// if (data == PollcodeF)	breq 	ws_del			// wait default delay	andi	pol_cmd,0x0f		// write command: 0x48, 0x40	ori	pol_cmd,0x20		// read  command: 0x28, 0x20	clr	temp3				// clear polling counterws_cy:	tst	device	brmi	ws_89			// S89 device	mov	s_data,pol_cmd		rcall	wrser			// wrser(pol_cmd) SPI write (byte 1)	mov	s_data,pol_ah	rjmp	ws_90ws_89:	mov	s_data,pol_ah		// s_data = (pol_ah << 3) | 0x01//	rcall	shift_s_data3	ori	s_data,0x01ws_90:	rcall	wrser			// wrser(pol_ah) SPI write (byte 2) (S89=byte1)	mov	s_data,pol_al		rcall	wrser			// wrser(pol_al) SPI write (byte 3) (S89=byte2)	rcall	rdser			//               SPI read  (byte 4) (S89=byte3)	tst	device	brpl	ws_cb	andi	s_data,0x80		// compare only MSB for S89 device	andi	p_data,0x80ws_cb:						cp	s_data,p_data	breq	ws_ok			// s_data = p_data	dec	temp3	brne	ws_cy			// loopws_del:						// 256 polling cycles are over, give additional standart Time	ldi	temp1,10			// delay 10mS	rcall	delayws_ok:	tst B_Flag	breq put_ret	clr B_Flag				// Reset B_Flag for normal operation 	ret//====== Wait for FLASH write in page mode ==================================wait_M:	cpi	device,0x41	breq	wm_del			// polling inapplicable for m103	cpi	device,0x23	breq	poll_t2313		// polling different for t2313	cpi	p_data, 0xFF		// if last Byte was 0xFF give standart delay	breq	wm_del	andi	pol_cmd,0x0f		// write command: 0x48, 0x40	ori	pol_cmd,0x20		// read  command: 0x28, 0x20	clr	temp3				// clear polling counterwm_cy:	mov	s_data,pol_cmd		rcall	wrser			// wrser(pol_cmd) SPI write (byte 1)	mov	s_data,pol_ah	rcall	wrser			// wrser(pol_ah) SPI write (byte 2)	mov	s_data,pol_al		rcall	wrser			// wrser(pol_al) SPI write (byte 3)	rcall	rdser			//               SPI read  (byte 4)	cp	s_data,p_data	breq	wm_ok			// s_data = p_data	dec	temp3	breq	wm_del			// 256 polling cycles are over, give another 50ms delay...	rjmp	wm_cy			// loopwm_del:	ldi	temp1,50			// delay 50mS	rcall	delaywm_ok:	tst B_Mode	breq wm_end	tst Bcnt2	breq wm_end	rjmp w95wm_end:	clr B_Mode				// Reset Block Mode Flag	rjmp put_retpoll_t2313:					// Polling ATTiny2313 is different	ldi	pol_cmd,0xf0		// Byte1= 0xF0	clr	temp3				// clear polling counter	mov	pol_ah,temp3		// Byte2= 0x00p2313_1:	mov	s_data,pol_cmd		rcall	wrser			// wrser(pol_cmd) SPI write (byte 1)	mov	s_data,pol_ah	rcall	wrser			// wrser(pol_ah) SPI write (byte 2)	mov	s_data,pol_al		rcall	wrser			// wrser(pol_al) SPI write (byte 3)	rcall	rdser			//               SPI read  (byte 4)	andi	s_data,0x01		// last Bit tells if polling OK	breq	wm_ok			// s_data = p_data	dec	temp3	breq	wm_del			// 256 polling cycles are over, give another 50ms delay...	rjmp	p2313_1			// loop//====== Command Error ======================================================put_debug:					// shows u_data on serial for debug reason					rcall putcput_err:	ldi	u_data,'?'			// putc('?')	rcall	putc			// send '?'	rjmp	waitcmd			//====== Reply Command ======================================================put_ret:	ldi	u_data,0x0d			// putc(0x0D)	rcall	putc			// send CR	rjmp	waitcmd	//**************************************************************************//// TABLE//	device codes//// DESCRIPTION//	The following device codes must be used by the host computer. Note//	that the device codes are arbitrary selected, they do not have any//	thing in common with the signature bytes stored in the device.// 	This are the device Codes recognized by the AVRprog Software. Some//	Devices may require special hardware or a different, not yet //	implemented Protocol! Use at your own risk.////**************************************************************************Dev_S:	// byte write//      avr910-devcode   ,Code during polling Flash. 0x00: no polling supported, program default time//	.byte	0x10	,0x00	//AT90S1200A No support for this type//	.byte	0x11	,0x00	//AT90S1200B No support for this type//	.byte	0x12	,0x00	//AT90S1200C No support for this type	.byte	0x13	,0x00	//AT90S1200	.byte	0x20	,0x7F	//AT90S2313A	.byte	0x28	,0x7F	//AT90S4414A	.byte	0x30	,0xFF	//AT90S4433A	.byte	0x34	,0xFF	//AT90S2333A	.byte	0x38	,0x7F	//AT90S8515A	.byte	0x48	,0xFF	//AT90S2323A	.byte	0x4c	,0xFF	//AT90S2343A	.byte	0x51	,0xFF	//tn10	.byte	0x55	,0xFF	//tn12	.byte	0x56	,0xFF	//tn15	.byte	0x68	,0xFF	//AT90S8535	.byte	0x6c	,0xFF	//AT90S4434	.byte	0x86	,0xFF	//AT89S8252  bug in avrprog in Block write Mode!(See Note 18 for Workaround)	.byte	0x87	,0xFF	//AT89S53    bug in avrprog	.word	0		//End of table	Dev_M:	// Devices which support Page Programming. Dont forget the Page Size 		// of different Devices.		// Maximum ist 0x40 due to limitated RAM in 2313 Chip. 		// (Pages with bigger Pages are programmed multiple times)// unofficial Device Codes. Match avrdude.conf with tis "avr910-devcode"// avr910-devcode ,Pagesite in Words	.byte 0x01	,0x40	//m640 	avr910-Devicecode not official!//	.byte 0x02	,0x40	//m644 	avr910-Devicecode not official!//	.byte 0x03	,0x40	//m645 	avr910-Devicecode not official!	.byte 0x04	,0x40	//m649 	avr910-Devicecode not official!	.byte 0x05	,0x40	//m6490 	avr910-Devicecode not official!	.byte 0x06	,0x40	//90PWM2	avr910-Devicecode not official!	.byte 0x07	,0x40	//90PWM3	avr910-Devicecode not official!	.byte 0x08	,0x40	//m1280 	avr910-Devicecode not official!	.byte 0x09	,0x40	//m1281	avr910-Devicecode not official!//	.byte 0x0a	,0x40	//m2560 	avr910-Devicecode not official!//	.byte 0x0b	,0x40	//m2561	avr910-Devicecode not official!//	.byte 0x0c	,0x40	//m3250 	avr910-Devicecode not official!//	.byte 0x0d	,0x40	//m6450	avr910-Devicecode not official!	.byte 0x0e	,0x10	//tn24 	avr910-Devicecode not official!	.byte 0x1a	,0x10	//tn25 	avr910-Devicecode not official!	.byte 0x0f	,0x20	//tn44	avr910-Devicecode not official!	.byte 0x1b	,0x20	//tn45	avr910-Devicecode not official!	.byte 0x14	,0x20	//tn84	avr910-Devicecode not official!	.byte 0x1c	,0x20	//tn85	avr910-Devicecode not official!	.byte 0x1d	,0x40	//CAN128	avr910-Devicecode not official!	.byte 0x23	,0x10	//tn2313 avr910-Devicecode not official! (STK500 Code used)	.byte 0x31	,0x20	//m48	avr910-Devicecode not official!	.byte 0x33	,0x20	//m88 	avr910-Devicecode not official!	.byte 0x35	,0x40	//m168 	avr910-Devicecode not official!//	.byte 0x36	,0x40	//m165 	avr910-Devicecode not official!	.byte 0x37	,0x40	//m164 	avr910-Devicecode not official!	.byte 0x39	,0x40	//m324 	avr910-Devicecode not official!//	.byte 0x3c	,0x40	//m325 	avr910-Devicecode not official!	.byte 0x3d	,0x40	//m329 	avr910-Devicecode not official!	.byte 0x3e	,0x40	//m3290 	avr910-Devicecode not official!	.byte 0x57	,0x10	//tn13 	avr910-Devicecode not official! //Appearance of this Devicecodes does not mean this Devices are or will be fully supported !// official Devicecodes as matched in AVRProg V1.40	.byte 0x3a	,0x20	//m8515, Pagesize 32 words (0x20)	.byte 0x3b	,0x20	//m8515boot  Bootloader Mode untested!	.byte	0x41	,0x40	//m103		.byte	0x43	,0x40	//m128	.byte	0x44	,0x40	//m128boot  Bootloader Mode untested!	.byte	0x45	,0x40	//m64	.byte	0x46	,0x40	//m64boot   Bootloader Mode untested!	.byte	0x5e	,0x10	//tn26	.byte	0x60	,0x40	//m161	.byte	0x61	,0x40	//m161boot  Bootloader Mode untested!	.byte	0x62	,0x40	//m162	.byte	0x63	,0x40	//m162boot  Bootloader Mode untested!	.byte	0x64	,0x40	//m163	.byte	0x66	,0x40	//m163boot  Bootloader Mode untested!	.byte 0x69	,0x20	//m8535	.byte 0x6a	,0x20	//m8535boot Bootloader Mode untested!	.byte	0x72	,0x40	//m32	.byte	0x73	,0x40	//m32boot   Bootloader Mode untested!	.byte	0x74	,0x40	//m16	.byte	0x75	,0x40	//m16boot   Bootloader Mode untested!	.byte	0x76	,0x20	//m8	.byte	0x77	,0x20	//m8boot    Bootloader Mode untested!	.byte	0x78	,0x40	//m169	.byte	0x79	,0x40	//m169boot  Bootloader Mode untested!	.word 	0		//End of Table// Devices with known avr910 Devicecodes, but not supported with this Programmer//	.byte	0x42	,0x40	//m603	obsolete//	.byte	0x50			//tn11 Needs additional High Voltage Hardware and uses different Protocoll! No Support!//	.byte	0x58			//tn19 Obsolete//	.byte	0x5c			//tn28 Only supported in parallel Programming Mode!//	.byte	0x65	,0x20	//m83	obsolete //	.byte	0x67	,0x20	//m83boot  obsolete//	.byte	0x70			//AT90C8534  unknown Hardware, untested!//	.byte	0x71			//AT90C8544  unknown Hardware, untested!//	.byte	0x80			//AT89C1051  unknown Hardware, untested!//	.byte	0x81			//AT89C2051  unknown Hardware, untested!//**************************************************************************//// TABLE//	revision codes////**************************************************************************SW_Ver:	.byte '3','8',0,0HW_Ver:	.byte '2,'2',0,0//**************************************************************************//// TABLE//	ID string "AVR ISP"////**************************************************************************ID_Str:	.asciz "AVR ISP"//**************************************************************************//// TABLE//	Chip ID string to identify the Firmware////**************************************************************************ChipID:	.ascii "Ver.3.8b (AVR109 Mode, Part of IsoJtagISP"	.asciz "www.floppyspongeonline.com & www.mikrocontroller-projekte.de"//*** End of File ****

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -