电路设计,软件开发,专业项目团队承接电子产品开发!


ISPRO下载型编程器
火爆销售中

RS232/TTL转换器
全IC串口窃电

RS232/TTL转换线
全IC串口窃电

ByteBlasterMV Cable
CPLD/FPGA并口下载线

ByteBlaster II Cable ISPRO下载型编程器
支持S51/AVR/PIC
超级51开发板套件
前卫实用超值

PC/MCU/CPLD
三合一学习套件

全新万年历方案
AVR单片机开发板
 

Min51单片机仿真机
迷你型

ARM7开发板
仅售260元!
 

RS-232/RS-485双向接口电平转换器  

51单片机升级STM32
火爆销售中
MPLAB-ICD2
火爆销售中
LED51开发板
玩具又名图文显示棒

面板模块/开发板
经济危机明智决择

       

GSM MODEM GSM猫

SMS短信模块 工业级/全自动
火爆销售中

大功率数传电台

高速数传电台

您当前位置:电子技术资料 -> 外围驱动 -> LCD液晶显示 ->

祝您阅读愉快!

ISPRO下载型编程器

RS232 TO TTL转换器
↑↑本文相关产品介绍↑↑

SED1335控制器汉字显示C程序


类别:技术文章
来源:未知
作者:未知
关键字:SED1335
加入日期:2010-8-4

关于SED1335控制器汉字显示C程序
//对液晶控制器SED1330的读写
//中国电子网 www.EC66.com
#include <W77C32.H>
#include "sch.h"
#define SYSTEM_SET 0X40
#define SLEEP_IN 0X53
#define DISP_ON 0X59
#define DISP_OFF 0X58
#define SCROLL 0X44
#define CSRFORM 0X5D
#define CGRAM_ADR 0X5C
#define CSRDIR_UP 0X4E
#define CSRDIR_DOWN 0X4F
#define CSRDIR_LEFT 0X4D
#define CSRDIR_RIGHT 0X4C
#define HDOT_SCR 0X5A
#define OVLAY 0X5B
#define CSRW 0X46
#define CSRR 0X47
#define MWRITE 0X42
#define MREAD 0X43

#define SAD1 0
#define SAD2 0x2580
#define SAD3 0x4B00
#define AP 40
#define Turn_OFF 0
#define Turn_ON 1
#define Twinkle_in_slow 2
#define Twinkle_in_fast 3
unsigned char code Cursor[4]={0,1,2,3};
unsigned char code First_area[4]={0,0x4,0x8,0xC};
unsigned char code Sec_Fourth_area[4]={0,0x10,0x20,0x30};
unsigned char code Third_area[4]={0,0x40,0x80,0xC0};
unsigned char code system_set_code[8]
={0x30,0x87,0x07,39,60,239,40,0};
// ={0x30,0x87,0x07,39,66,240,48,0};
unsigned char code scroll_set_code[10]
={0x0,0x0,240,0x80,0x25,240,0x00,0x4B,0x80,0x70};
// ={0x0,0x0,240,0x80,0x25,240,0x00,0x4B,0x80,0x70};
// ={0x0,0x0,240,0x00,0x10,240,0x00,0x01,0x00,0x18};

void SED1330_system_set(void)
{
unsigned char temp;
SED1330_set_instruction = SYSTEM_SET;
for(temp = 0; temp <8; temp++)
{
SED1330_set_data = system_set_code[temp];
}
}

void SED1330_scroll_set(void)
{
unsigned char temp;
SED1330_set_instruction = SCROLL;
for(temp = 0; temp <10; temp++)
{
SED1330_set_data = scroll_set_code[temp];
}
}

void SED1330_set_display_memory(unsigned char * temp_display_memory,unsigned
int length)
{
unsigned int temp;
SED1330_set_instruction = MWRITE;
for(temp = 0; temp <length; temp++)
{
SED1330_set_data = *(temp_display_memory + temp);
}
}

void SED1330_get_display_memory(unsigned char * temp_display_memory,unsigned
int length)
{
unsigned int temp;
SED1330_set_instruction = MREAD;
for(temp = 0; temp <length; temp++)
{
*(temp_display_memory + temp) = SED1330_read_data;
}
}

/*
void SED1330_set_CGRAM_address(unsigned int SAG)
{
SED1330_set_instruction = CGRAM_ADR;
SED1330_set_data = SAG % 256;
SED1330_set_data = SAG / 256;
}

unsigned int SED1330_get_cursor_address(void)
{
unsigned int temp;
SED1330_set_instruction = CSRR;
temp = SED1330_read_data;
temp <<=8;
temp += SED1330_read_data;
return(temp);
}

void SED1330_sleep_IN(void)
{
SED1330_set_instruction = SLEEP_IN;
ENBL = 1;
}
*/

void SED1330_set_cursor_address(unsigned int cursor_address)
{
SED1330_set_instruction = CSRW;
SED1330_set_data = cursor_address % 256;
SED1330_set_data = cursor_address / 256;
}

void SED1330_display_switch(unsigned char on_off,unsigned char P1)
{
SED1330_set_instruction = on_off;
SED1330_set_data = P1;
}

void SED1330_csrdir(unsigned char dir)
{
SED1330_set_instruction = dir;
}

void SED1330_set_overlay(unsigned char overlay_mode)
{
SED1330_set_instruction = OVLAY;
SED1330_set_data = overlay_mode;
}

void SED1330_set_cursor_mode(unsigned char x, unsigned char y)
{
SED1330_set_instruction = CSRFORM;
SED1330_set_data = x;
SED1330_set_data = y;
}

void SED1330_set_horizontal_scroll(unsigned char P1)
{
SED1330_set_instruction = HDOT_SCR;
SED1330_set_data = P1;
}

您可能还会关注的相关技术资料:
暂无

中国电子网
www.EC66.com
QQ:34740080 EMAIL:iloveaoe@163.com
最佳浏览:1024*768
Copyright (C) 2001-2010 EC66.COM All Rights Reserved
Aoe/帝国 制作维护
粤ICP备18061901号