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

📄 cyan_base_driver.asm

📁 使用CYAN单片机的ECOG1开发板连接SIM300C的GSM模块开发的短信收发程序.供UART和AT指令编程者参考
💻 ASM
📖 第 1 页 / 共 5 页
字号:
;{
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?84.1:
;	// Wait for the UART to be ready to transmit
;	while (sim300C_CTS_Sts == 1)
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?86.1:
	add	Y,#-3
Lstab?17a:
?L5F5:
; ^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?86.1:
	ld	AL,@$fd+H'118
	asr	#6
	and	AL,#1
	cmp	AL,#1
	bne	?L6F5
	bra	?L5F5
?L6F5:
;    while (0 == fd.duart.b_sts.tx_rdy)
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?88.1:
?L9F5:
; ^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?88.1:
	ld	AL,@$fd+H'd
	and	AL,#1
	bne	?L10F5
	bra	?L9F5
?L10F5:
;
;    rg.duart.b_tx8 = c;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?91.1:
	ld	AH,@H'ffe5	; %r2 (c)
	st	AH,@$rg+H'12
;    return (c);
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?92.1:
	ld	AL,@H'ffe5	; %r2 (c)
?L14F5:
	add	Y,#3
	ld	XH,@(-3,Y)
	bra	@(-2,Y)
Lstab?18c:
;
;}
;int getchar_a(void)
;
$getchar_a:
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?94.1:
	st	XH,@(-2,Y)
	st	X,@(-1,Y)
Lstab?19c:
;{
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?95.1:
Lstab?20c:
;	int c;
;	while (fd.duart.a_sts.rx_act == 0)
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?97.1:
	add	Y,#-2
Lstab?21a:
?L5F6:
; ^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?97.1:
	ld	AL,@$fd+H'4
	asr	#13
	and	AL,#1
	bne	?L6F6
	bra	?L5F6
?L6F6:
;	c = rg.duart.a_rx;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?99.1:
	ld	AL,@$rg+H'a
;	return(c);
	st	AL,@H'ffe5	; %r2 (c)
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?100.1:
	ld	AL,@H'ffe5	; %r2 (c)
?L10F6:
	add	Y,#2
	ld	XH,@(-2,Y)
	bra	@(-1,Y)
Lstab?22c:
;
;}
;/******************************************************************************
;NAME
;    uart_initialization
;
;SYNOPSIS
;    void uart_initialization(void)
;
;FUNCTION
;    initialization uarta
;    
;NOTE
;    Duart clk ---> HIGH_PLL by8
;    
;	Baud 	Duart.a_baud	Reality baud	Tolerance
;	1200		650			1200.1			0.01%
;	2400		324			2403.8			0.2%
;	3600		216			3600.2			0.01%
;	4800		162			4792.9			0.2%
;	7200		107			7233			0.5%
;	9600		80			9645.1			0.5%
;	19200		40			19054.9			0.8%
;	38400		19			39062.5			1.7%
;	57600		13			55803.6			3.1%
;	115200		6			111607.1		3.1%
;    
;RETURNS
;    Nothing
;******************************************************************************/
;void uart_initialization(void)
;
$uart_initialization:
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?130.1:
	st	XH,@(-2,Y)
	st	X,@(-1,Y)
Lstab?23c:
;{
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?131.1:
;	fd.duart.ctrl.a_rx_en = 1;				//enable UARTA receiver.
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?132.1:
	ld	AL,@$fd
	or	AL,#4
	st	AL,@$fd
;	//fd.duart.ctrl.a_tx_en = 1;
;	//fd.duart.ctrl.b_rx_en = 1;
;	fd.duart.ctrl.b_tx_en = 1;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?135.1:
	ld	AL,@$fd
	or	AL,#64
	st	AL,@$fd
;	
;	fd.duart.a_int_en.rx_1b_rdy = 1;		// Enable duart A receive interrupt
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?137.1:
	ld	AL,@$fd+H'5
	or	AL,#8
	st	AL,@$fd+H'5
;	//fd.duart.a_int_dis.rx_1b_rdy = 1;		// Disable duart B receive interrupt
;	//fd.duart.b_int_en.tx_rdy = 1;			// Enable duart B tx interrupt
;	fd.duart.b_int_dis.tx_rdy = 1;		// Disable duart B tx interrupt
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?140.1:
	ld	AL,@$fd+H'f
	or	AL,#1
	st	AL,@$fd+H'f
;	
;	//fd.duart.b_tmr_cfg.guard = 63;			// Tx interval timer = 63 clock cycle
;	
;	rg.duart.a_baud = 162;					//baud = 4800;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?144.1:
	ld	AL,#162
	st	AL,@$rg+H'3
;	rg.duart.b_baud = 80;					//baud = 9600;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?145.1:
	ld	AL,#80
	st	AL,@$rg+H'c
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?147.1:
	ld	XH,@(-2,Y)
	bra	@(-1,Y)
Lstab?24c:
;
;	
;}
;/******************************************************************************
;** init Timer2
;******************************************************************************/
;void timer_initialization(void)
;
$timer_initialization:
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?151.1:
	st	XH,@(-2,Y)
	st	X,@(-1,Y)
Lstab?25c:
;{
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?152.1:
;	//------------------------------------------------------------------------
;	//timer 1
;	//------------------------------------------------------------------------
;	fd.tim.ctrl_en.cnt1_cnt = 1;//TIM_CTRL_EN_CNT1_CNT_MASK;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?156.1:
	ld	AL,@$fd+H'7e
	or	AL,#512
	st	AL,@$fd+H'7e
;    fd.tim.int_dis1.cnt1_exp = 1;//TIM_INT_EN1_CNT1_EXP_MASK;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?157.1:
	ld	AL,@$fd+H'9d
	or	AL,#4
	st	AL,@$fd+H'9d
;	
;	
;	//------------------------------------------------------------------------
;	//timer 2
;	//------------------------------------------------------------------------
;	fd.tim.ctrl_en.cnt2_cnt = 1;
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?163.1:
	ld	AL,@$fd+H'7e
	or	AL,#1024
	st	AL,@$fd+H'7e
;	//fd.ssm.rst_clr.cnt2 = 1;			//clr timer2 reset.
;	//fd.ssm.div_sel.cnt2 = 0;			//reference(high freq) clock,not PLL.
;	
;	//fd.ssm.clk_dis.cnt2 = 1;			//disable timer2 clock.
;	//fd.ssm.tap_sel2.cnt2 = 0;			//timer2 Clock is divided by 4.
;	//fd.ssm.clk_en.cnt2 = 1;				//enable timer2 clock.
;	
;	//fd.tim.int_en1.cnt2_exp = 1;		//enable timer2 interrupt.
;	fd.tim.int_dis1.cnt2_exp = 1;		//disable timer2 interrupt.
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?172.1:
	ld	AL,@$fd+H'9d
	or	AL,#16
	st	AL,@$fd+H'9d
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?179.1:
	ld	XH,@(-2,Y)
	bra	@(-1,Y)
Lstab?26c:
;
;	
;	//fd.tim.ctrl_dis.cnt2_cnt = 1;		//disable Timer2.
;	//fd.tim.ctrl_dis.cnt2_auto_re_ld = 1;//disable timer2 auto reload.
;	//rg.tim.cnt2_ld = T2_LOAD_VALUE;		//timer2 load value.
;	//fd.tim.cmd.cnt2_ld = 1;				//loading value to timer2.
;	//fd.tim.int_clr1.cnt2_exp = 1;		// Clear Timer2 interrupt flag	
;}
;/******************************************************************************
;float point change to string.
;******************************************************************************/
;char *_fcvt_(char *str_save,double float_data)
;
$_fcvt_:
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?183.1:
	add	Y,#-22
Lstab?27a:
	st	AL,@(21,Y)
	st	AH,@(20,Y)
	st	XH,@(18,Y)
	st	X,@(19,Y)
	st	AL,@(1,Y)	; %r16 (str_save)
	st	AH,@(0,Y)	; %r16 (str_save)
Lstab?28c:
;{
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?184.1:
Lstab?29c:
^cyan_base_driver___cyan_base_driver.'D:\simcom\software\SIM300C\cyan_base_driver.c'.?185.1:
	add	Y,#-32
Lstab?30a:
	st	Y,@H'fffe
	ld	X,@H'fffe
	add	Y,#5	; str_temp+1

⌨️ 快捷键说明

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