16 16点阵显示汉字原理及显示程序 #include "config.h" #define DOTLED_LINE_PORT PORTB #define DOTLED_LINE_DDR DDRB #define DOTLED_LINE_PIN PINB #define DOTLED_LINE_SCKT PB1 #define DOTLED_LINE_SCKH PB5 #define DOTLED_LINE_SDA PB3 #define DOTLED_ROW_PORT PORTC #define DOTLED_ROW_DDR DDRC #define DOTLED_ROW_PIN PINC #define DOTLED_ROW_A0 PC0 #define DOTLED_ROW_A1 PC1 #define DOTLED_ROW_A2 PC2 #define DOTLED_ROW_A3 PC3 #define DOTLED_ROW_E PC4 uint8 font[] = { /*-- 调入了一幅图像:这是您新建的图像 --*/ /*-- 宽度x高度=16x16 --*/ 0x00,0x00,0x00,0x00,0x08,0x38,0x18,0x44,0x08,0x44,0x08,0x04,0x08,0x08,0x08,0x10, 0x08,0x20,0x08,0x40,0x08,0x40,0x08,0x40,0x3E,0x7C,0x00,0x00,0x00,0x00,0x00,0x00 }; static void TransmitByte(uint8 byte); static void SelectRow(uint8 row); static void FlipLatchLine(void); static void TransmitByte(uint8 byte) { uint8 i; for(i = 0 ; i < 8 ; i ++) { if(byte & (1 << i)) { DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA); } else { DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SDA); } //__delay_cycles(100); DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKH); //__delay_cycles(100); DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKH); //__delay_cycles(100); } } static void SelectRow(uint8 row) { //row -= 1; row |= DOTLED_ROW_PIN & 0xe0; DOTLED_ROW_PORT = row; } static void FlipLatchLine(void) { DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SCKT); DOTLED_LINE_PORT &= ~_BV(DOTLED_LINE_SCKT); } void InitDotLedPort(void) { DOTLED_LINE_PORT &= ~(_BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH)); DOTLED_LINE_PORT |= _BV(DOTLED_LINE_SDA); DOTLED_LINE_DDR |= _BV(DOTLED_LINE_SCKT) | _BV(DOTLED_LINE_SCKH) | _BV(DOTLED_LINE_SDA); DOTLED_ROW_PORT |= 0x1f; DOTLED_ROW_PORT &= 0xf0; DOTLED_ROW_DDR |= 0x1f; } void EnableRow(boolean IsEnable) { if(IsEnable) { DOTLED_ROW_PORT &= ~_BV(DOTLED_ROW_E); } else { DOTLED_ROW_PORT |= _BV(DOTLED_ROW_E); } } void PrintDotLed(uint8 * buffer) { uint8 i , tmp; for(i = 0 ; i < 16 ; i ++) { tmp = *buffer ++; TransmitByte(~tmp); tmp = *buffer ++; TransmitByte(~tmp); SelectRow(i); FlipLatchLine(); } } void main(void) { InitDotLedPort(); EnableRow(TRUE); while(1) { PrintDotLed(font); __delay_cycles(5000); } } //---------------------------------------------------- config.h文件 #ifndef _CONFIG_H #define _CONFIG_H //#define GCCAVR #define CPU_CYCLES 7372800L #ifndef GCCAVR #define _BV(bit) (1 << (bit)) #endif #define MSB 0x80 #define LSB 0x01 #define FALSE 0 #define TRUE 1 typedef unsigned char uint8; typedef unsigned int uint16; typedef unsigned long uint32; typedef unsigned char boolean; #include <ioavr.h> #include <inavr.h> #include "dotled.h" #endif //-----
上传时间: 2013-11-18
上传用户:mnacyf
一款处理汉字点阵字库的软件,处理后的点阵字库可用于点阵液晶、LED汉显等领域。 支持 1024x1024以内的任意点阵汉字支持 所有Windows字体支持 汉字大小调整支持 汉字位置调整支持 单个汉字字模生成支持 海量汉字批量字模生成支持 按汉语拼音排序支持 横扫纵扫两种扫描方式生成数据支持 8bit(字节)"ZN"扫描方式支持 4-32bit多种数据长度分组选择支持 字模数据取反支持 字节按位倒置支持 汉语拼音自动命名C语言数组格式支持 汉语拼音自动命名汇编语言DB表格式支持 自动编号数组命名及自动编号汇编DB表命名方式支持 图片Logo点阵数据生成支持 二进制数据字库DAT和BIN文件的生成支持 二进制字库文件索引(两个字节索引)支持 GB2312 字符集选择导入及字库生成支持 GBK字符集选择导入及字库生成(仅供参考)支持 繁简字体自由转换支持 单字节字符支持RS232串口通讯、可把字模数据发送到移动存储设备,集成汉字自动识别功能,清除非汉字字符,提取汉字功能,汉字字模点阵数据批量生成工具可用作开发辅助工具,得到精减汉字库,节约有限的ROM空间资源。也可用作带点阵LCD显示系统的汉化工具或其它需要汉字点阵数据的地方。
上传时间: 2014-01-24
上传用户:menggesimida
该电路适合初学者使用,8乘8的LED点阵引脚示意图及运用。
上传时间: 2014-12-28
上传用户:lxm
如何利用SOPC制作点阵显示
上传时间: 2013-10-12
上传用户:jx_wwq
螺旋天线仿真
上传时间: 2013-10-10
上传用户:jx_wwq
点阵设计
上传时间: 2014-01-09
上传用户:Pzj
LCD点阵提取工具zimo221
上传时间: 2014-01-10
上传用户:chendawei
LCD点阵提取工具zimo221
上传时间: 2013-10-13
上传用户:范缜东苑
如何利用SOPC制作点阵显示
上传时间: 2015-01-01
上传用户:王小奇
绘制16*16点阵的电路图
上传时间: 2015-01-01
上传用户:zjwangyichao