ATmega16 nokia7110 LCD 屏幕实验
char col_addr;
nokia_write_command(0xB0 + lcd_row); // page address set. pg 8-48 in the datasheet.
col_addr = 0x12+(lcd_col*6); // each FONT has five columns + 1 blank column. xaddr: 0 - 95 on noki
//a 7110. no offset.
//lcd_1st_col=0x12: the first column of display starts here. Weird! the datasheet didnt mention it.
nokia_write_command(0x10 | (col_addr>>4)); // column address 4 most bit set
nokia_write_command(0x0f & col_addr); // column address 4 least bit set
}
/**********************************************************
Convert bitmap to charractor Function
**********************************************************/
void lcd_chr(uchar charsel)
{
if (charsel < 0x20) return;
if (charsel > 0x7f) return;
for (char_row = 0; char_row < 5; char_row++) // 5 bytes
{
if (charsel<0x50)
{
charpos=(((charsel&0xff)-0x20)*5);
chardata=TABLE5[(charpos+char_row)];
}
if (charsel>0x4f)
{
charpos=(((charsel&0xff)-0x50)*5);
chardata=TABLE6[(charpos+char_row)];
}
nokia_write_data(chardata); // send FONT data to lcd
}
nokia_write_data(0x00); // blank underline pixels for each FONT
}
/**********************************************************
Write a string at current screen position
**********************************************************/
void lcd_str(uchar *str)
{
while (*str)
lcd_chr(*str++);
}
void main()
{
DDRD=0XFF;
SPI_init();
nokia_init();
nokia_gotoxy(0,0);
lcd_str("12345678abcdefg");
nokia_gotoxy(1,0);
lcd_str("abcdefg12345678");
//while(1);
}
ATmega16nokia7110LC 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)