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

📄 main.lss

📁 atmega32对ch375的读写程序
💻 LSS
📖 第 1 页 / 共 5 页
字号:
     556:	82 b3       	in	r24, 0x12	; 18
     558:	8f 71       	andi	r24, 0x1F	; 31
     55a:	82 bb       	out	0x12, r24	; 18
     55c:	9a bb       	out	0x1a, r25	; 26
     55e:	82 b3       	in	r24, 0x12	; 18
     560:	80 67       	ori	r24, 0x70	; 112
     562:	82 bb       	out	0x12, r24	; 18
     564:	1a ba       	out	0x1a, r1	; 26
     566:	08 95       	ret

00000568 <mDelaymS1>:


void	mDelaymS1( UINT8 ms )
{
	UINT16	i;
	while ( ms -- ) for ( i = 2600; i != 0; i -- );
     568:	81 50       	subi	r24, 0x01	; 1
     56a:	8f 3f       	cpi	r24, 0xFF	; 255
     56c:	31 f0       	breq	.+12     	; 0x57a <mDelaymS1+0x12>
     56e:	28 e2       	ldi	r18, 0x28	; 40
     570:	3a e0       	ldi	r19, 0x0A	; 10
     572:	22 53       	subi	r18, 0x32	; 50
     574:	30 40       	sbci	r19, 0x00	; 0
     576:	e9 f7       	brne	.-6      	; 0x572 <mDelaymS1+0xa>
     578:	f7 cf       	rjmp	.-18     	; 0x568 <mDelaymS1>
     57a:	08 95       	ret

0000057c <mStopIfError>:
}

/* 检查操作状态,如果错误则显示错误代码并停机 */
void	mStopIfError( UINT8 iError )
{
	if ( iError == ERR_SUCCESS ) return;  
     57c:	81 11       	cpse	r24, r1
	
	while ( 1 ) {
     57e:	ff cf       	rjmp	.-2      	; 0x57e <mStopIfError+0x2>
     580:	08 95       	ret

00000582 <delay50us>:

	}
}


//**********************短延时程序50us**************************// 
void delay50us(uint t) 
{ 
    uint j;       
    for(;t>0;t--)          
     582:	00 97       	sbiw	r24, 0x00	; 0
     584:	41 f0       	breq	.+16     	; 0x596 <delay50us+0x14>
     586:	25 e4       	ldi	r18, 0x45	; 69
     588:	30 e0       	ldi	r19, 0x00	; 0
        for(j=0;j<70;j++) ;   
     58a:	23 52       	subi	r18, 0x23	; 35
     58c:	30 40       	sbci	r19, 0x00	; 0
     58e:	37 ff       	sbrs	r19, 7
     590:	fc cf       	rjmp	.-8      	; 0x58a <delay50us+0x8>
     592:	01 97       	sbiw	r24, 0x01	; 1
     594:	f6 cf       	rjmp	.-20     	; 0x582 <delay50us>
     596:	08 95       	ret

00000598 <delay5us>:
             
} 
//**********************短延时程序5us**************************// 
void delay5us(uint t) 
{ 
    uint j;       
    for(;t>0;t--)          
     598:	00 97       	sbiw	r24, 0x00	; 0
     59a:	11 f0       	breq	.+4      	; 0x5a0 <delay5us+0x8>
     59c:	01 97       	sbiw	r24, 0x01	; 1
     59e:	fc cf       	rjmp	.-8      	; 0x598 <delay5us>
     5a0:	08 95       	ret

000005a2 <delay_1ms12>:
        for(j=0;j<7;j++)    
            ; 
} 

void LCD_portinit(void);
void initial_GLCD(void);
void command_GLCD(uchar ord);
void chkbusy_GLCD(void);
void write_GLCD(uchar dat);
void delay12(uint);





void	delay_1ms12( uint ms )
{
	uint	i;
	while ( ms -- ) for ( i = 10; i != 0; i -- );
     5a2:	01 97       	sbiw	r24, 0x01	; 1
     5a4:	2f ef       	ldi	r18, 0xFF	; 255
     5a6:	8f 3f       	cpi	r24, 0xFF	; 255
     5a8:	92 07       	cpc	r25, r18
     5aa:	d9 f7       	brne	.-10     	; 0x5a2 <delay_1ms12>
     5ac:	08 95       	ret

000005ae <delay12>:
//	while ( ms -- ); 
//	 mDelay1uS( );
}

void	delay12( uint ms )
{
//	uint	i;
//	while ( ms -- ) for ( i = 100; i != 0; i -- );
		while ( ms -- ); 
     5ae:	01 97       	sbiw	r24, 0x01	; 1
     5b0:	2f ef       	ldi	r18, 0xFF	; 255
     5b2:	8f 3f       	cpi	r24, 0xFF	; 255
     5b4:	92 07       	cpc	r25, r18
     5b6:	d9 f7       	brne	.-10     	; 0x5ae <delay12>
     5b8:	08 95       	ret

000005ba <command_GLCD>:
}















void lcd(uchar tempa1[],uchar tempa2[],uchar tempa3[],uchar  tempa4[])
{
uchar i=0;
  	uchar j;
	
    initial_GLCD();        //初始化LCD
	
   //---------------------------------------------------------

  //temp=0x00;                      //line 1
  // command_GLCD(0x80|temp);
command_GLCD(0x80);

		   for(j=0;j<8;j++)
		   { 
		   write_GLCD(tempa1[i]);
		   i++;
		   write_GLCD(tempa1[i]);
		  i++;
		 //  
		
		  // write_GLCD(0x30+j);
		  // i++;
		   }
	  i=0;

   //---------------------------------------------------------
 //   temp=0x10;                      //line2
 //  command_GLCD(temp|0x80);
//command_GLCD(0x88);
		   for(j=0;j<8;j++)
		   {
		   write_GLCD(tempa3[i]);
		   
		   i++;
		
		   write_GLCD(tempa3[i]);
		   i++;
		   }
		   i=0;
   //---------------------------------------------------------
 // temp=0x08;                       //line3
 //  command_GLCD(temp|0x80);
//command_GLCD(0x90);
		   for(j=0;j<8;j++)
		   {
		   write_GLCD(tempa2[i]);
		  
		  i++;
		
		   write_GLCD(tempa2[i]);
		   i++;
		   }
		 i=0;
   //---------------------------------------------------------
//   temp=0x18;                      //line4
 //  command_GLCD(temp|0x80);
//command_GLCD(0x98);
		   for(j=0;j<8;j++)
		   {
		   write_GLCD(tempa4[i]);
		   
		   i++;
		
		   write_GLCD(tempa4[i]);
		   i++;
		   }
		   i=0;
		   
  }
















void dis_str(char *pstr1,char *pstr2,char *pstr3,char *pstr4)
{
	uchar j;
    initial_GLCD();        //初始化LCD	
	
	command_GLCD(0x80);
	for(j=0;j<12;j++)
	{ 
		   write_GLCD(*(pstr1+j));
  	  
	}
	for(j=0;j<4;j++)
	{ 
		   write_GLCD(0x20);
  	  
	}
	
	
	
	//command_GLCD(0x90);
	for(j=0;j<12;j++)
	{ 
		   write_GLCD(*(pstr2+j));	  
	}
		for(j=0;j<4;j++)
	{ 
		   write_GLCD(0x20);
  	  
	}
	
	//command_GLCD(0x88);
	for(j=0;j<12;j++)
	{ 
		   write_GLCD(*(pstr3+j));	  
	}
		for(j=0;j<4;j++)
	{ 
		   write_GLCD(0x20);
  	  
	}
	
	//command_GLCD(0x98);
	for(j=0;j<12;j++)
	{ 
		   write_GLCD(*(pstr4+j));	  
	}
		for(j=0;j<4;j++)
	{ 
		   write_GLCD(0x20);
  	  
	}
	
	
}

void initial_GLCD()
{ 
command_GLCD(0x30);
delay_1ms12(2000);
command_GLCD(0x30);
delay_1ms12(2000);
command_GLCD(0x30);
delay_1ms12(2000);
//command_GLCD(0x06);    //显示器控制:游标不显示;
delay_1ms12(2000);
command_GLCD(0x01);    //清屏幕
delay_1ms12(3000);
delay_1ms12(3000);
delay_1ms12(3000);
delay_1ms12(3000);
command_GLCD(0x0c);    
delay_1ms12(2000);//进入模式设定
command_GLCD(0x02);    //清屏幕
delay_1ms12(3000);
delay_1ms12(3000);
delay_1ms12(3000);
delay_1ms12(3000);
delay_1ms12(3000);	
}

//--------------------------------------
//写命令到GLCD
//--------------------------------------
void command_GLCD(uchar ord)
{
     5ba:	1f 93       	push	r17
     5bc:	18 2f       	mov	r17, r24
 	 delay12(2000);
     5be:	80 ed       	ldi	r24, 0xD0	; 208
     5c0:	97 e0       	ldi	r25, 0x07	; 7
     5c2:	0e 94 d7 02 	call	0x5ae <delay12>
 	 EN_H; 
     5c6:	ae 9a       	sbi	0x15, 6	; 21
	 EN_L;
     5c8:	9f eb       	ldi	r25, 0xBF	; 191
     5ca:	85 b3       	in	r24, 0x15	; 21
     5cc:	89 23       	and	r24, r25
     5ce:	85 bb       	out	0x15, r24	; 21
	 RS_L;//RS_L;
     5d0:	af 98       	cbi	0x15, 7	; 21
	 RW_L;
     5d2:	ae 9a       	sbi	0x15, 6	; 21
	 EN_H; 
     5d4:	ae 9a       	sbi	0x15, 6	; 21
	 PORTB = ord;
     5d6:	18 bb       	out	0x18, r17	; 24
	 EN_L;	
     5d8:	85 b3       	in	r24, 0x15	; 21
     5da:	89 23       	and	r24, r25
     5dc:	85 bb       	out	0x15, r24	; 21
     5de:	1f 91       	pop	r17
     5e0:	08 95       	ret

000005e2 <initial_GLCD>:
     5e2:	80 e3       	ldi	r24, 0x30	; 48
     5e4:	0e 94 dd 02 	call	0x5ba <command_GLCD>
     5e8:	80 ed       	ldi	r24, 0xD0	; 208
     5ea:	97 e0       	ldi	r25, 0x07	; 7
     5ec:	0e 94 d1 02 	call	0x5a2 <delay_1ms12>
     5f0:	80 e3       	ldi	r24, 0x30	; 48
     5f2:	0e 94 dd 02 	call	0x5ba <command_GLCD>
     5f6:	80 e

⌨️ 快捷键说明

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