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

📄 cepark-avr

📁 CEPARK-AVR单片机教程LCD12232液晶显示实验
💻
📖 第 1 页 / 共 3 页
字号:
		}
	}
	else if(SEL_E2==0)             //
	{
		WriteCommand(0x02,0xba);    //
 396:	6a eb       	ldi	r22, 0xBA	; 186
 398:	82 e0       	ldi	r24, 0x02	; 2
 39a:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
		WriteCommand(0x02,Add2);        //
 39e:	60 91 ab 03 	lds	r22, 0x03AB
 3a2:	82 e0       	ldi	r24, 0x02	; 2
 3a4:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
 3a8:	e7 01       	movw	r28, r14
 3aa:	10 e1       	ldi	r17, 0x10	; 16
		for(a=16;a<32;a++)         //
		{
			WriteData(0x02,*(pt+a));  //
 3ac:	68 89       	ldd	r22, Y+16	; 0x10
 3ae:	82 e0       	ldi	r24, 0x02	; 2
 3b0:	0e 94 c2 00 	call	0x184	; 0x184 <WriteData>
 3b4:	1f 5f       	subi	r17, 0xFF	; 255
 3b6:	21 96       	adiw	r28, 0x01	; 1
 3b8:	10 32       	cpi	r17, 0x20	; 32
 3ba:	c1 f7       	brne	.-16     	; 0x3ac <WriteCharacter+0x7c>
		}
  
		WriteCommand(0x02,0xbb);       //
 3bc:	6b eb       	ldi	r22, 0xBB	; 187
 3be:	82 e0       	ldi	r24, 0x02	; 2
 3c0:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
		WriteCommand(0x02,Add2);       //
 3c4:	60 91 ab 03 	lds	r22, 0x03AB
 3c8:	82 e0       	ldi	r24, 0x02	; 2
 3ca:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
 3ce:	e7 01       	movw	r28, r14
 3d0:	87 01       	movw	r16, r14
 3d2:	00 5f       	subi	r16, 0xF0	; 240
 3d4:	1f 4f       	sbci	r17, 0xFF	; 255
		for(b=0;b<16;b++)           //
		{
			WriteData(0x02,*(pt+b));  //
 3d6:	69 91       	ld	r22, Y+
 3d8:	82 e0       	ldi	r24, 0x02	; 2
 3da:	0e 94 c2 00 	call	0x184	; 0x184 <WriteData>
 3de:	c0 17       	cp	r28, r16
 3e0:	d1 07       	cpc	r29, r17
 3e2:	c9 f7       	brne	.-14     	; 0x3d6 <WriteCharacter+0xa6>
		}
  
	}
	if((Add2+16)<61)  
 3e4:	20 91 ab 03 	lds	r18, 0x03AB
 3e8:	82 2f       	mov	r24, r18
 3ea:	99 27       	eor	r25, r25
 3ec:	8d 97       	sbiw	r24, 0x2d	; 45
 3ee:	24 f4       	brge	.+8      	; 0x3f8 <WriteCharacter+0xc8>
	Add2+=16;                  //
 3f0:	20 5f       	subi	r18, 0xF0	; 240
 3f2:	20 93 ab 03 	sts	0x03AB, r18
 3f6:	2f c0       	rjmp	.+94     	; 0x456 <WriteCharacter+0x126>
	else 
	{ 
		Add2=0;                       //
 3f8:	10 92 ab 03 	sts	0x03AB, r1
		WriteCommand(0x02,0xba);       //
 3fc:	6a eb       	ldi	r22, 0xBA	; 186
 3fe:	82 e0       	ldi	r24, 0x02	; 2
 400:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
		WriteCommand(0x02,Add2);        //
 404:	60 91 ab 03 	lds	r22, 0x03AB
 408:	82 e0       	ldi	r24, 0x02	; 2
 40a:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
 40e:	e7 01       	movw	r28, r14
 410:	1d e1       	ldi	r17, 0x1D	; 29
		for(a=29;a<32;a++)
		WriteData(0x02,*(pt+a));       //一个汉字16列,写完61列之后还要写3列
 412:	6d 8d       	ldd	r22, Y+29	; 0x1d
 414:	82 e0       	ldi	r24, 0x02	; 2
 416:	0e 94 c2 00 	call	0x184	; 0x184 <WriteData>
 41a:	1f 5f       	subi	r17, 0xFF	; 255
 41c:	21 96       	adiw	r28, 0x01	; 1
 41e:	10 32       	cpi	r17, 0x20	; 32
 420:	c1 f7       	brne	.-16     	; 0x412 <WriteCharacter+0xe2>
		WriteCommand(0x02,0xbb);           //
 422:	6b eb       	ldi	r22, 0xBB	; 187
 424:	82 e0       	ldi	r24, 0x02	; 2
 426:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
		WriteCommand(0x02,Add2);      //
 42a:	60 91 ab 03 	lds	r22, 0x03AB
 42e:	82 e0       	ldi	r24, 0x02	; 2
 430:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
 434:	e7 01       	movw	r28, r14
 436:	1d e0       	ldi	r17, 0x0D	; 13
		for(b=13;b<16;b++)
		WriteData(0x02,*(pt+b));         //
 438:	6d 85       	ldd	r22, Y+13	; 0x0d
 43a:	82 e0       	ldi	r24, 0x02	; 2
 43c:	0e 94 c2 00 	call	0x184	; 0x184 <WriteData>
 440:	1f 5f       	subi	r17, 0xFF	; 255
 442:	21 96       	adiw	r28, 0x01	; 1
 444:	10 31       	cpi	r17, 0x10	; 16
 446:	c1 f7       	brne	.-16     	; 0x438 <WriteCharacter+0x108>
		Add2+=3;                       //
 448:	80 91 ab 03 	lds	r24, 0x03AB
 44c:	8d 5f       	subi	r24, 0xFD	; 253
 44e:	80 93 ab 03 	sts	0x03AB, r24
   
		SEL_E2=0;                     //
 452:	10 92 a9 03 	sts	0x03A9, r1
 456:	df 91       	pop	r29
 458:	cf 91       	pop	r28
 45a:	1f 91       	pop	r17
 45c:	0f 91       	pop	r16
 45e:	ff 90       	pop	r15
 460:	ef 90       	pop	r14
 462:	08 95       	ret

00000464 <Drawing_Map>:
	}
}

 //绘图
void Drawing_Map(unsigned char *pt)
{
 464:	df 92       	push	r13
 466:	ef 92       	push	r14
 468:	ff 92       	push	r15
 46a:	0f 93       	push	r16
 46c:	1f 93       	push	r17
 46e:	cf 93       	push	r28
 470:	df 93       	push	r29
 472:	ec 01       	movw	r28, r24
 474:	21 e0       	ldi	r18, 0x01	; 1
 476:	d2 2e       	mov	r13, r18
 478:	98 eb       	ldi	r25, 0xB8	; 184
 47a:	e9 2e       	mov	r14, r25
 47c:	2a c0       	rjmp	.+84     	; 0x4d2 <Drawing_Map+0x6e>
	unsigned char half,seg,page;
	unsigned char flag = 1;
	
	for(page = 0xb8;page < 0xbc;page++)
	{
		for(half = 0;half < 2;half++)
		{
			flag = !flag;
 47e:	ff 24       	eor	r15, r15
 480:	dd 20       	and	r13, r13
 482:	11 f4       	brne	.+4      	; 0x488 <Drawing_Map+0x24>
 484:	81 e0       	ldi	r24, 0x01	; 1
 486:	f8 2e       	mov	r15, r24
 488:	df 2c       	mov	r13, r15
			if(flag)
 48a:	ff 20       	and	r15, r15
 48c:	39 f0       	breq	.+14     	; 0x49c <Drawing_Map+0x38>
			{
				WriteCommand(0x02,page);
 48e:	6e 2d       	mov	r22, r14
 490:	82 e0       	ldi	r24, 0x02	; 2
 492:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
				WriteCommand(0x02,0x00);
 496:	60 e0       	ldi	r22, 0x00	; 0
 498:	82 e0       	ldi	r24, 0x02	; 2
 49a:	06 c0       	rjmp	.+12     	; 0x4a8 <Drawing_Map+0x44>
			}
			else
			{
				WriteCommand(0x01,page);
 49c:	6e 2d       	mov	r22, r14
 49e:	81 e0       	ldi	r24, 0x01	; 1
 4a0:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
				WriteCommand(0x01,0x00);
 4a4:	60 e0       	ldi	r22, 0x00	; 0
 4a6:	81 e0       	ldi	r24, 0x01	; 1
 4a8:	0e 94 92 00 	call	0x124	; 0x124 <WriteCommand>
 4ac:	10 e0       	ldi	r17, 0x00	; 0
 4ae:	69 91       	ld	r22, Y+
			}
			for(seg = 0;seg < 61;seg++)
			{
				if(flag)
 4b0:	ff 20       	and	r15, r15
 4b2:	11 f0       	breq	.+4      	; 0x4b8 <Drawing_Map+0x54>
				{
					WriteData(0x02,*pt++);				
 4b4:	82 e0       	ldi	r24, 0x02	; 2
 4b6:	01 c0       	rjmp	.+2      	; 0x4ba <Drawing_Map+0x56>
				}
				else
				{
					WriteData(0x01,*pt++);				
 4b8:	81 e0       	ldi	r24, 0x01	; 1
 4ba:	0e 94 c2 00 	call	0x184	; 0x184 <WriteData>
 4be:	1f 5f       	subi	r17, 0xFF	; 255
 4c0:	1d 33       	cpi	r17, 0x3D	; 61
 4c2:	a9 f7       	brne	.-22     	; 0x4ae <Drawing_Map+0x4a>
 4c4:	0f 5f       	subi	r16, 0xFF	; 255
 4c6:	02 30       	cpi	r16, 0x02	; 2
 4c8:	d1 f6       	brne	.-76     	; 0x47e <Drawing_Map+0x1a>
 4ca:	e3 94       	inc	r14
 4cc:	8c eb       	ldi	r24, 0xBC	; 188
 4ce:	e8 16       	cp	r14, r24
 4d0:	11 f0       	breq	.+4      	; 0x4d6 <Drawing_Map+0x72>
				}
			}
		}
	}
}         
 4d2:	00 e0       	ldi	r16, 0x00	; 0
 4d4:	d4 cf       	rjmp	.-88     	; 0x47e <Drawing_Map+0x1a>
 4d6:	df 91       	pop	r29
 4d8:	cf 91       	pop	r28
 4da:	1f 91       	pop	r17
 4dc:	0f 91       	pop	r16
 4de:	ff 90       	pop	r15
 4e0:	ef 90       	pop	r14
 4e2:	df 90       	pop	r13
 4e4:	08 95       	ret

000004e6 <Delayus>:


//us级别的延时函数
void Delayus(unsigned int lus)
{
 4e6:	9c 01       	movw	r18, r24
 4e8:	e3 e0       	ldi	r30, 0x03	; 3
 4ea:	f0 e0       	ldi	r31, 0x00	; 0
 4ec:	03 c0       	rjmp	.+6      	; 0x4f4 <Delayus+0xe>
 */
void
_delay_loop_2(uint16_t __count)
{
	__asm__ volatile (
 4ee:	cf 01       	movw	r24, r30
 4f0:	01 97       	sbiw	r24, 0x01	; 1
 4f2:	f1 f7       	brne	.-4      	; 0x4f0 <Delayus+0xa>
	while(lus--)
 4f4:	21 50       	subi	r18, 0x01	; 1
 4f6:	30 40       	sbci	r19, 0x00	; 0
 4f8:	8f ef       	ldi	r24, 0xFF	; 255
 4fa:	2f 3f       	cpi	r18, 0xFF	; 255
 4fc:	38 07       	cpc	r19, r24
 4fe:	b9 f7       	brne	.-18     	; 0x4ee <Delayus+0x8>
 500:	08 95       	ret

00000502 <Delayms>:
	{
		_delay_loop_2(3);      //_delay_loop_2(1)是延时4个时钟周期,参数为3则延时12
		           //个时钟周期,本实验用12M晶体,则12个时钟周期为12/12=1us
    }
}

//ms级别的延时函数
void Delayms(unsigned int lms)
{
 502:	9c 01       	movw	r18, r24
 504:	e8 eb       	ldi	r30, 0xB8	; 184
 506:	fb e0       	ldi	r31, 0x0B	; 11
 508:	03 c0       	rjmp	.+6      	; 0x510 <Delayms+0xe>
 */
void
_delay_loop_2(uint16_t __count)
{
	__asm__ volatile (
 50a:	cf 01       	movw	r24, r30
 50c:	01 97       	sbiw	r24, 0x01	; 1
 50e:	f1 f7       	brne	.-4      	; 0x50c <Delayms+0xa>
	while(lms--)
 510:	21 50       	subi	r18, 0x01	; 1
 512:	30 40       	sbci	r19, 0x00	; 0
 514:	8f ef       	ldi	r24, 0xFF	; 255
 516:	2f 3f       	cpi	r18, 0xFF	; 255
 518:	38 07       	cpc	r19, r24
 51a:	b9 f7       	brne	.-18     	; 0x50a <Delayms+0x8>
 51c:	08 95       	ret

0000051e <LCDPort_Init>:
 51e:	8f ef       	ldi	r24, 0xFF	; 255
 520:	88 bb       	out	0x18, r24	; 24
 522:	87 bb       	out	0x17, r24	; 23
 524:	d9 9a       	sbi	0x1b, 1	; 27
 526:	dc 9a       	sbi	0x1b, 4	; 27
 528:	dd 9a       	sbi	0x1b, 5	; 27
 52a:	de 9a       	sbi	0x1b, 6	; 27
 52c:	df 9a       	sbi	0x1b, 7	; 27
 52e:	8a bb       	out	0x1a, r24	; 26
 530:	2e e0       	ldi	r18, 0x0E	; 14
 532:	30 e0       	ldi	r19, 0x00	; 0
 534:	e8 eb       	ldi	r30, 0xB8	; 184
 536:	fb e0       	ldi	r31, 0x0B	; 11
 */
void
_delay_loop_2(uint16_t __count)
{
	__asm__ volatile (
 538:	cf 01       	movw	r24, r30
 53a:	01 97       	sbiw	r24, 0x01	; 1
 53c:	f1 f7       	brne	.-4      	; 0x53a <LCDPort_Init+0x1c>
 53e:	21 50       	subi	r18, 0x01	; 1
 540:	30 40       	sbci	r19, 0x00	; 0
 542:	8f ef       	ldi	r24, 0xFF	; 255
 544:	2f 3f       	cpi	r18, 0xFF	; 255
 546:	38 07       	cpc	r19, r24
 548:	b9 f7       	brne	.-18     	; 0x538 <LCDPort_Init+0x1a>
 54a:	08 95       	ret

⌨️ 快捷键说明

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