嵌入式课程设?- 基于LCD的电子时钟实?- 百度文库 ر

һ ϵͳ

һ Ŀ꼰巽

һҪ

ѧϰLCDARMLCDĿĽӿԭLCDдRTCƷڿԷĻʵ¹ܣ

1дʵֵʱӹܣͨʵϵͳLCDʱʾ 2ͼ1LCDʾƵʱӽ棻

ͼ1 LCDʾʱӽ

3̬ʾǰʱ䣬ꡢ¡աʱ֡룬ʱ룬롢Ϊ̬ʵʱָʾǰʱ䡣

Ʒ

S3C44B0XĵǶʽϵͳӲϵṹͼͼ2ʾͨS3C44B0XѧϰڲRTCԪLCDLCDģ顢()ԴʵֵʵʱʱӵĹܡҪʵַΪͨԴ;֤ʱԴͨ趨RTCԪĹģʽʵʵʱʱӵĹܣȻҪʾͼЧд趨LCDӦĴRTCԪLCDЧؽLCDģӦʵʱʱӵʾܡ

ƵӢַʾЧǶʽϵͳROM洢صĴ洢ΪۣʵLCDϵַʾ˷ʾеһ֣ʵֺ֡ӢĵĻʾӶعõ˻档۵Ӳƽ̨S3C44BOXҺʾĻϴģʵS3C44BOXLCDģӺӦãһIJοֵ

- 4 -

Դ λ LCDʾ Flash BIOS ARM Ƕʽ΢ SDRAM ϵͳڴ S3C44B0X

USBӿ RS-232ӿ JTAGӿ ADC DAC ͼ2 S3C44B0XĵǶʽϵͳӲϵṹ

ڶ ԭͼ

ݿҪʵֵĹܣS3C44B0XĵԪṹͼ3ʾԭͼ

ͼ3 ԭͼ

оƬijʼ LCDijʼ

U16 LCD_Init(U8 Lcd_Bpp) {

switch(Lcd_Bpp) {

Case 8:

rLCDCON1=(0)|(2<<5)|(MVAL_USED<<7)|(0x1<<8)|(0x1<<10)|(CLKVAL_COLOR<<12);

- 5 -

оƬijʼ

rLCDCON2=(LINEVAL)|(HOZVAL_COLOR<<10)|(10<<21); rLCDSADDR1= (0x3<<27) | ( ((U32)Video_StartBuffer>>22)<<21 M5D((U32)Video_StartBuffer>>1);

rLCDSADDR2=M5D((((U32)Video_StartBuffer +(SCR_XSIZE*LCD_YSIZE))>>1)) (MVAL<<21)|1<<29;

rLCDSADDR3= (LCD_XSIZE/2) | ( ((SCR_XSIZE-LCD_XSIZE)/2)<<9 ); rREDLUT =0xfdb96420; rGREENLUT=0xfdb96420; rBLUELUT =0xfb40; rDITHMODE=0x0;

rDP1_2 =0xa5a5; rDP4_7 =0xba5da65; rDP3_5 =0xa5a5f; rDP2_3 =0xd6b; rDP5_7 =0xeb7b5ed; rDP3_4 =0x7dbe; rDP4_5 =0x7ebdf; rDP6_7 =0x7fdfbfe; rDITHMODE=0x12210;

rLCDCON1=(1)|(2<<5)|(MVAL_USED<<7)|(0x3<<8)|(0x3<<10)|(CLKVAL_COLOR<<12); break; default: return 1; }

return 0; }

)| |

жijʼ

void KeyINT_Init(void) {

if ((rINTPND & BIT_EINT4567)) {

SPC = BIT_EINT4567; }

rINTMSK = ~(BIT_GLOBAL|BIT_EINT4567);

}

RTCijʼ

void Rtc_Tick_Init(void) {

if ((rINTPND & BIT_TICK)) {

rI_ISPC = BIT_TICK;

}

rINTMSK &= ~(BIT_GLOBAL | BIT_TICK);

rRTCCON = 0x0;

- 6 -

rTICINT = 1 | (1<<7) }

void Rtc_Tick_Init0(void) {

if ((rINTPND & BIT_TICK)) {

rI_ISPC = BIT_TICK; }

rINTMSK &= ~(BIT_GLOBAL | BIT_TICK); rRTCCON = 0x0; rTICINT = 1 | (1<<6); }

Ľ ģ

LCDʾʱӽֹԲһֱ߶ʱָ롣 ҪҪĺʵֻԲͻֱߡ Բ

㷨ͨX1 οYԼҵĺ㶨ĵ㣬rs=45X0145ԭ㣬ڵһҵһ㣬ͨ۵Գҵ޵㣬ͨ㺯ٻ45Ⱦͺˡ

- 7 -