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

📄 ze015_1.s

📁 一款完整的家用电器程序,具有控制商用机的功能,应用广泛,有一定的参考价值
💻 S
📖 第 1 页 / 共 5 页
字号:
; 	 *point_txd=0;		//数据19 预留高1位电流A +电流B +电流C
L154:
	.dbline 483
L150:
	.dbline 440
	subi R20,255  ; offset = 1
	sbci R21,255
L152:
	.dbline 440
	cpi R20,208
	ldi R30,7
	cpc R21,R30
	brsh X6
	xjmp L149
X6:
L151:
	.dbline -2
L148:
	adiw R28,4
	xcall pop_gset5
	.dbline 0 ; func end
	ret
	.dbsym r temp_crc 22 c
	.dbsym r rh_l 10 c
	.dbsym r rh_h 12 c
	.dbsym r i 20 i
	.dbsym r crc8_cal 14 c
	.dbend
	.dbfunc e calc_sth15_t _calc_sth15_t fD
;              t -> y+0
;           temp -> R20,R21
;        temp_l1 -> R20
;        temp_h1 -> R22
	.even
_calc_sth15_t::
	xcall push_gset2
	mov R20,R18
	mov R22,R16
	sbiw R28,4
	.dbline -1
	.dbline 488
; 	 temp_checksum ^=*point_txd++;	//异或校验
; 	 *point_txd=defrost_TH;	//数据20 预留管温值温度带负数
; 	 temp_checksum ^=*point_txd++;	//异或校验
; 	 	temp_stepnum = (unsigned int) (stepnum);
; 	 *point_txd=(unsigned char)(temp_stepnum>>8);//0;	//数据21 预留
; 	 temp_checksum ^=*point_txd++;	//异或校验
	.dbline 492
; 	 temp_stepnum = (unsigned int) (stepnum);
; 	 *point_txd=(unsigned char) ((stepnum<<8)>>8);	//数据22 预留
; 	 temp_checksum ^=*point_txd++;	//异或校验
; 	 *point_txd=temp_checksum;	//校验码
	mov R21,R22
	.dbline 493
; 	 txd_len0_ask=32;  //ask len
	ldi R16,<L162
	ldi R17,>L162
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	ldi R16,<L163
	ldi R17,>L163
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	movw R16,R20
	lsr R17
	ror R16
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall empy32fs
	movw R16,R20
	andi R16,1
	andi R17,0
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall add32fs
	xcall empy32fs
	ldi R16,<L164
	ldi R17,>L164
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall sub32f
	movw R30,R28
	std z+0,R16
	std z+1,R17
	std z+2,R18
	std z+3,R19
	.dbline 494
; 	 txd_rxd_delaytime0=0;		//clear 
	movw R30,R28
	ldd R16,z+0
	ldd R17,z+1
	ldd R18,z+2
	ldd R19,z+3
	.dbline -2
L161:
	adiw R28,4
	xcall pop_gset2
	.dbline 0 ; func end
	ret
	.dbsym l t 0 D
	.dbsym r temp 20 i
	.dbsym r temp_l1 20 c
	.dbsym r temp_h1 22 c
	.dbend
	.dbfunc e calc_sth15_rh _calc_sth15_rh fc
;           temp -> <dead>
;         rh_lin -> y+24
;             T2 -> y+20
;             T1 -> y+16
;             C3 -> y+12
;             C2 -> y+8
;             C1 -> y+4
;         rh_cal -> y+0
;             rh -> R10,R11
;              t -> y+40
;          rh_l1 -> R12
;          rh_h1 -> R10
	.even
_calc_sth15_rh::
	xcall push_gset4
	mov R12,R18
	mov R10,R16
	sbiw R28,32
	.dbline -1
	.dbline 499
; 	 txd_state0 |=rxd_txdstart0;	//rxd_txdstart0=1
;    }
; 
; 
; #pragma interrupt_handler uart0_tx_isr:21
	.dbline 500
; void uart0_tx_isr(void)
	ldi R16,<L166
	ldi R17,>L166
	xcall lpm32
	movw R30,R28
	std z+4,R16
	std z+5,R17
	std z+6,R18
	std z+7,R19
	.dbline 501
; {
	ldi R16,<L167
	ldi R17,>L167
	xcall lpm32
	movw R30,R28
	std z+8,R16
	std z+9,R17
	std z+10,R18
	std z+11,R19
	.dbline 502
;  //character has been transmitted
	ldi R16,<L168
	ldi R17,>L168
	xcall lpm32
	movw R30,R28
	std z+12,R16
	std z+13,R17
	std z+14,R18
	std z+15,R19
	.dbline 503
;  if (txd_len0 >=txd_len0_ask)	//txd finished
	ldi R16,<L169
	ldi R17,>L169
	xcall lpm32
	movw R30,R28
	std z+16,R16
	std z+17,R17
	std z+18,R18
	std z+19,R19
	.dbline 504
;  	{
	ldi R16,<L170
	ldi R17,>L170
	xcall lpm32
	movw R30,R28
	std z+20,R16
	std z+21,R17
	std z+22,R18
	std z+23,R19
	.dbline 508
;  		txd_len0 =0;
;  		PORTE &= ~b_con4850;	//pe2为uart0 485控制端=0接收
; 	   rxd_state0=0;
; 	   UCSR0B = 0x90;	// uart0_rxd_on允许接收完成中断及接收
	mov R11,R10
	mov R10,R12
	.dbline 509
; 	   PORTE |=0x02;	//发送完成后置发送端PE1 TXD=1	
	ldi R16,<L163
	ldi R17,>L163
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	movw R16,R10
	lsr R17
	ror R16
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall empy32fs
	movw R16,R10
	andi R16,1
	andi R17,0
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall add32f
	movw R30,R28
	std z+28,R16
	std z+29,R17
	std z+30,R18
	std z+31,R19
	movw R30,R28
	ldd R2,z+12
	ldd R3,z+13
	ldd R4,z+14
	ldd R5,z+15
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	movw R30,R28
 ; stack offset 4
	ldd R2,z+32
	ldd R3,z+33
	ldd R4,z+34
	ldd R5,z+35
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall empy32fs
	movw R30,R28
 ; stack offset 4
	ldd R2,z+32
	ldd R3,z+33
	ldd R4,z+34
	ldd R5,z+35
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall empy32fs
	movw R30,R28
 ; stack offset 4
	ldd R2,z+12
	ldd R3,z+13
	ldd R4,z+14
	ldd R5,z+15
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	movw R30,R28
 ; stack offset 8
	ldd R2,z+36
	ldd R3,z+37
	ldd R4,z+38
	ldd R5,z+39
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall empy32fs
	xcall add32fs
	movw R30,R28
 ; stack offset 4
	ldd R2,z+8
	ldd R3,z+9
	ldd R4,z+10
	ldd R5,z+11
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall add32f
	movw R30,R28
	std z+24,R16
	std z+25,R17
	std z+26,R18
	std z+27,R19
	.dbline 510
;  	}
	movw R30,R28
	ldd R2,z+40
	ldd R3,z+41
	ldd R4,z+42
	ldd R5,z+43
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	ldi R16,<L171
	ldi R17,>L171
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall sub32fs
	movw R30,R28
 ; stack offset 4
	ldd R2,z+20
	ldd R3,z+21
	ldd R4,z+22
	ldd R5,z+23
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	movw R30,R28
 ; stack offset 8
	ldd R2,z+28
	ldd R3,z+29
	ldd R4,z+30
	ldd R5,z+31
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	ldi R16,<L163
	ldi R17,>L163
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	movw R16,R10
	lsr R17
	ror R16
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall empy32fs
	movw R16,R10
	andi R16,1
	andi R17,0
	xcall int2fp
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	xcall add32fs
	xcall empy32fs
	xcall add32fs
	xcall empy32fs
	movw R30,R28
 ; stack offset 4
	ldd R2,z+28
	ldd R3,z+29
	ldd R4,z+30
	ldd R5,z+31
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall add32f
	movw R30,R28
	std z+0,R16
	std z+1,R17
	std z+2,R18
	std z+3,R19
	.dbline 511
; else
	ldi R16,<L174
	ldi R17,>L174
	xcall lpm32
	st -y,R19
	st -y,R18
	st -y,R17
	st -y,R16
	movw R30,R28
 ; stack offset 4
	ldd R2,z+4
	ldd R3,z+5
	ldd R4,z+6
	ldd R5,z+7
	st -y,R5
	st -y,R4
	st -y,R3
	st -y,R2
	xcall cmp32f
	brge L172
	.dbline 511
	ldi R16,<L174
	ldi R17,>L174
	xcall lpm32
	movw R30,R28
	std z+0,R16
	std z+1,R17
	std z+2,R18
	std z+3,R19
L172:
	.dbline 512
; 	{UDR0=txd_data0[txd_len0];	//
	movw R30,R28
	ldd R16,z+0
	ldd R17,z+1
	ldd R18,z+2
	ldd R19,z+3
	xcall fp2int
	.dbline -2
L165:
	adiw R28,32
	xcall pop_gset4
	.dbline 0 ; func end
	ret
	.dbsym l temp 1 c
	.dbsym l rh_lin 24 D
	.dbsym l T2 20 D
	.dbsym l T1 16 D
	.dbsym l C3 12 D
	.dbsym l C2 8 D
	.dbsym l C1 4 D
	.dbsym l rh_cal 0 D
	.dbsym r rh 10 i
	.dbsym l t 40 D
	.dbsym r rh_l1 12 c
	.dbsym r rh_h1 10 c
	.dbend
	.dbfunc e delay_tt _delay_tt fV
;              i -> R20,R21
;             tt -> R16,R17
	.even
_delay_tt::
	xcall push_gset1
	.dbline -1
	.dbline 516
;  	txd_len0++;}	
; }
; 
; 
	.dbline 518
; //UART1 initialize禁止UART1
; // desired baud rate:9600
	clr R20
	clr R21
	xjmp L179
L176:
	.dbline 519
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 520
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 521
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 522
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 523
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 524
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 525
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 526
	nop
	.dbline 527
	nop
	.dbline 527
	nop
	.dbline 527
	nop
	.dbline 527
	nop
	.dbline 528
L177:
	.dbline 518
	subi R20,255  ; offset = 1
	sbci R21,255
L179:
	.dbline 518
	cp R16,R20
	cpc R17,R21
	brlo X7
	xjmp L176
X7:
	.dbline -2
L175:
	xcall pop_gset1
	.dbline 0 ; func end
	ret
	.dbsym r i 20 i
	.dbsym r tt 16 i
	.dbend
	.dbfunc e delay_20us _delay_20us fV
	.even
_delay_20us::
	.dbline -1
	.dbline 532
; // actual baud rate:9615 (0.2%)
; void uart1_init(void)
; {
;  UCSR1B = 0x00; //disable while setting baud rate
;  UCSR1A = 0x00;
;  UCSR1C = 0x06;
;  UBRR1L = 0x19; //set baud rate lo
;  UBRR1H = 0x00; //set baud rate hi
; }
; 
; //ADC initialize
; // Conversion time: 26uS
; void adc_init(void)
; {
	.dbline 533
;  ADCSRA = 0x00; //disable adc
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 533
	nop
	.dbline 534
;  ADMUX = 0x00; //select adc input 0
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 534
	nop
	.dbline 535
;  ACSR  = 0x80; //模拟比较器禁止
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 535
	nop
	.dbline 536
;  ADCSRB = 0x00; //触发选择无用
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 536
	nop
	.dbline 537
;  ADCSRA = 0x85;	//使能AD,但不启动AD转换,32分频
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 537
	nop
	.dbline 538
; }
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 538
	nop
	.dbline 539
; 
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 539
	nop
	.dbline 540
; //call this routine to initialize all peripherals
	nop
	.dbline 540
	nop
	.dbline 540
	nop
	.dbline 540
	nop
	.dbline -2
L180:
	.dbline 0 ; func end
	ret
	.dbend
	.dbfunc e fun_measure_temp_start _fun_measure_temp_start fV
	.even
_fun_measure_temp_start::
	.dbline -1
	.dbline 544
; void init_devices(void)
; {
;  //stop errant interrupts until set up
;  CLI(); //disable all interrupts
	.dbline 545
;  XDIV  = 0x00; //xtal divider
	xcall _s_transstart
	.dbline 546
;  XMCRA = 0x00; //external memory
	ldi

⌨️ 快捷键说明

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