마이컴 & 프로테우스 VSM/ATmega128

- [Codevision] 그래픽 LCD ("KS0108" 128 x 64)

메가아재 2016. 4. 4. 01:06
반응형

- 시뮬레이터 -> 프로테우스 8.1 VSM

- 컴파일러 -> 코드비전 2.05



 

"Download" Proteus File - [Proteus] GLCD_8Bit.zip

"Download" Source Code - [Codevision] GLCD_8Bit.zip



<Proteus Circuit>







<Source Code>

#include <mega128.h>
#include <delay.h>  

// 해더파일은 소스코드를 다운받으면 있다.
#include "glcd_128.h"

void main(void)
{
	unsigned char Count;
	
	MCU_Init();  
	GLCD_Init(); 
	
	while(1)
	{    
		Write_String_8x16(0, 0, "Good Morning");
		Write_String_8x16(0, 1, "I'm a Boy~!");
		Write_String_8x16(0, 2, "You are a girl?");
		Write_String_8x16(0, 3, "I like Music");
		delay_ms(2000); lcd_clear();
		
		GLCD_Print_Picture(1); delay_ms(500); lcd_clear();
		GLCD_Print_Picture(2); delay_ms(500); lcd_clear();
		GLCD_Print_Picture(3); delay_ms(500); lcd_clear();
		GLCD_Print_Picture(4); delay_ms(500); lcd_clear();
		GLCD_Print_Picture(5); delay_ms(500); lcd_clear();
		
		Write_Dec_6x8(17, 4, Count);
		Write_String_6x8(0, 0, "01234567890123456789");
		Write_String_6x8(0, 1, "********************");
		Write_String_6x8(7, 2, "--- System ---");   
		Write_String_6x8(0, 4, "Loading");               delay_ms(200); 
		Write_String_6x8(0, 4, "Loading.");              delay_ms(200); 
		Write_String_6x8(0, 4, "Loading..");             delay_ms(200); 
		Write_String_6x8(0, 4, "Loading...");            delay_ms(200); 
		Write_String_6x8(0, 4, "Loading....");           delay_ms(200); 
		Write_String_6x8(0, 4, "Loading.....");          delay_ms(200); 
		Write_String_6x8(0, 4, "Loading.....OK!");       delay_ms(500);  
		
		while(Count <= 30) 
		{
			Write_Dec_6x8(17, 4, Count); Count++;
			delay_ms(50);
		} Count = 0;
		
		Write_String_6x8(0, 6, "      Complete!     ");  delay_ms(1000);
		
		lcd_clear();  // LCD_Clear
		GLCD_Intro(); // Intro 
		
		delay_ms(1000); lcd_clear();   
		
		Write_String_6x8(0, 0, "  ** Graphic LCD ** ");	
		Write_String_6x8(0, 1, "      128 x 64      ");
		Write_String_6x8(0, 2, "                    ");
		Write_String_6x8(0, 3, "     Hello World!   ");
		Write_String_6x8(0, 4, "                    ");
		Write_String_6x8(0, 5, "     Welcome to     ");
		Write_String_6x8(0, 6, "   Firmware World   ");
		Write_String_6x8(0, 7, "                    ");
		delay_ms(2000); lcd_clear();
		
		Write_String_6x8(0, 0, "     HAPPY HAPPY    ");	delay_ms(200);
		Write_String_6x8(0, 1, "        KOREA       ");	delay_ms(200);
		Write_String_6x8(0, 5, "       SAMSUNG      ");	delay_ms(200);
		Write_String_6x8(0, 6, "         LG         ");	delay_ms(200);
		delay_ms(1000); lcd_clear(); delay_ms(100);
	}
}       


반응형