?? 單片機坐標240x128液晶t6963控制器驅動程序(c51).htm
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0038)http://www.mcuzb.com/XXLR1.ASP?ID=5263 -->
<!--顯示文章具體內容時加在最前面--><HTML><HEAD><TITLE>單片機坐標240x128液晶T6963控制器驅動程序(C51)</TITLE>
<META
content=本站用,卓越網站快車,建設,www.zydn.net/*-------------------------------------------
name=keywords>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2800.1476" name=GENERATOR>
<META content=FrontPage.Editor.Document name=ProgId><LINK
href="單片機坐標240x128液晶T6963控制器驅動程序(C51).files/index1.css" type=text/css
rel=STYLESHEET>
<SCRIPT language=javascript>
function newie()
{
var newWindow;
newWindow=window.open('','content','toolbar=no,location=no,directories=NO,status=NO,menubar=NO,scrollbars=yes,resizable=yes,top=10,left=10,width=770,height=450');
newWindow.focus();
}
</SCRIPT>
</HEAD>
<BODY vLink=#000000 link=#000000 bgColor=#ffffff leftMargin=0 topMargin=0
rightMargin=100 gcolor="#FFFFFF">
<DIV align=center>
<CENTER>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD style="BACKGROUND-POSITION: right top; BACKGROUND-REPEAT: repeat-y"
width="50%" background=單片機坐標240x128液晶T6963控制器驅動程序(C51).files/bg_1.jpg></TD>
<TD align=middle><!---以上的是邊框--->
<TABLE id=table1 cellSpacing=0 cellPadding=0 width=766 border=0>
<TBODY>
<TR>
<TD width=70><IMG height=60
src="單片機坐標240x128液晶T6963控制器驅動程序(C51).files/logo2.gif" width=180
border=0></TD>
<TD align=middle><IMG height=87
src="單片機坐標240x128液晶T6963控制器驅動程序(C51).files/bit.gif" width=514
border=0></TD>
<TD width=95><MAP name=FPMap0><AREA shape=RECT coords=9,20,60,31
href="http://www.mcuzb.com/system/user/userlist1.asp"><AREA
shape=RECT coords=9,46,61,58
href="http://www.mcuzb.com/system/user/myly.asp"><AREA shape=RECT
coords=12,72,60,84 href="http://www.mcuzb.com/dh.asp"></MAP><IMG
height=96 src="單片機坐標240x128液晶T6963控制器驅動程序(C51).files/mb_4.jpg"
width=70 useMap=#FPMap0 border=0></TD></TR></TBODY></TABLE>
<TABLE id=table2 cellSpacing=0 cellPadding=0 width=766 border=0>
<TBODY>
<TR>
<TD background=單片機坐標240x128液晶T6963控制器驅動程序(C51).files/dh.jpg
height=28><TABLE height=56 cellSpacing=0 cellPadding=0
width="100%"><TBODY>
<TR>
<TD vAlign=bottom align=middle height=27><FONT
style="FONT-SIZE: 9pt" color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/INDEX.ASP"><FONT
style="FONT-SIZE: 9pt">首頁</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle height=27><FONT
style="FONT-SIZE: 9pt" color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=358"><FONT
style="FONT-WEIGHT: 700; FONT-SIZE: 9pt"><FONT
color=#ff00ff>單</FONT><FONT color=#808000>片</FONT><FONT
color=#00ff00>機</FONT><FONT color=#ff0000>論</FONT><FONT
color=#008000>壇</FONT></FONT></A><FONT style="FONT-SIZE: 9pt"
color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle height=27><FONT
style="FONT-SIZE: 9pt" color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=356"><FONT
style="FONT-SIZE: 9pt">C51源代碼(本站原創)</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle height=27><FONT
style="FONT-SIZE: 9pt" color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=363"><FONT
style="FONT-SIZE: 9pt">單片機源代碼與算法</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle height=27><FONT
style="FONT-SIZE: 9pt" color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=357"><FONT
style="FONT-SIZE: 9pt">哈工大實驗</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle height=27> </TD>
<TD vAlign=bottom align=middle height=27> </TD></TR>
<TR>
<TD vAlign=bottom align=middle> </TD>
<TD vAlign=bottom align=middle> </TD>
<TD vAlign=bottom align=middle><FONT style="FONT-SIZE: 9pt"
color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=366"><FONT
style="FONT-SIZE: 9pt">單片機畢業設計論文</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle><FONT style="FONT-SIZE: 9pt"
color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=365"><FONT
style="FONT-SIZE: 9pt">CPLD專區</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle><FONT style="FONT-SIZE: 9pt"
color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=367"><FONT
style="FONT-SIZE: 9pt">單片機簡單實例</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle><FONT style="FONT-SIZE: 9pt"
color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=359"><FONT
style="FONT-SIZE: 9pt">AVR單片機專欄</FONT></A><FONT
style="FONT-SIZE: 9pt" color=#ff0000>←</FONT></TD>
<TD vAlign=bottom align=middle><FONT style="FONT-SIZE: 9pt"
color=#ff0000>→</FONT><A
href="http://www.mcuzb.com/flmen.asp?menuid=361"><FONT
style="FONT-SIZE: 9pt">電子電路設計</FONT></A><FONT
style="FONT-SIZE: 9pt"
color=#ff0000>←</FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE id=table3 cellSpacing=0 cellPadding=0 width=766 border=0>
<TBODY>
<TR>
<TD background=單片機坐標240x128液晶T6963控制器驅動程序(C51).files/images_7-1.jpg
height=21>
<MARQUEE
scrollDelay=150><!--顯示欄目的公告--></MARQUEE></TD></TR></TBODY></TABLE><!--以上是頭部, 下面開始是文章內容-->
<TABLE id=AutoNumber6 style="BORDER-COLLAPSE: collapse"
borderColor=#c0c0c0 cellSpacing=0 cellPadding=0 width=766 bgColor=#f9f9f9
border=1>
<TBODY>
<TR>
<TD vAlign=top borderColor=#c0c0c0 align=middle>
<TABLE cellSpacing=0 cellPadding=0 width=748 border=0>
<TBODY>
<TR>
<TD>當前欄目:<A
href="http://www.mcuzb.com/FLMEN.ASP?MENULB=029C51源代碼(本站原創)&MENUJB=2">C51源代碼(本站原創)</A>></TD>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD></TD>
<TD align=right><FONT color=#888888>2004年11月30日 來自:<A
href="單片機坐標240x128液晶T6963控制器驅動程序(C51).files/mcuzb.htm"
target=_blank>單片機坐標</A> 作者:鞠春陽 [<A
href="http://www.mcuzb.com/xxlr.asp?menulb=029C51源代碼(本站原創)&menujb=2">返回</A>]
</FONT></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111
cellSpacing=0 cellPadding=0 width=748 border=0>
<TBODY>
<TR>
<TD width=247></TD>
<TD
style="BORDER-TOP: 0px solid; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"
width=766></TD></TR></TBODY></TABLE>
<TABLE height=400 cellSpacing=0 cellPadding=0 width="98%"
bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD vAlign=top
background=單片機坐標240x128液晶T6963控制器驅動程序(C51).files/mcuzb.htm>
<TABLE height=24 cellSpacing=0 cellPadding=0 width="100%"
background="">
<TBODY>
<TR>
<TD align=middle><FONT style="FONT-SIZE: 11pt"
color=#000000>240x128液晶T6963控制器驅動程序(C51)</FONT></TD></TR></TBODY></TABLE><BR>/*------------------------------------------------------------------------------------------<BR>[文件名]
t6963.c<BR>[功能] 240X128液晶<BR>[版本] 3.0<BR>[作者] 鞠春陽<BR>[最后修改時間]
2003年5月12日<BR>[版權所有] www.mcuzb.com<BR>[資料]
請到www.mcuzb.com下載<BR>===========================================================================================*/
<P></P>
<P>#include "absacc.h"<BR>#include "math.h"</P>
<P><BR>#include "ASCII816.h" //標準ASCII庫<BR>#include
"HZTable.h" //漢字點陣庫(自做)<BR>#include
"menu.h" //菜單庫(自做)</P>
<P>#define ComPort 0xB101<BR>#define DataPort
0xB000<BR>#define GraphAddr 0x0000 //head of graph</P>
<P>//以8*8字符計算,顯示屏橫向、縱向可以顯示的字符個數<BR>//以240*128為例:<BR>#define
LineChar 30 //一行16個字符(8*8)<BR>#define ColumnChar 16
//總共16列</P>
<P><BR>//指令,數據 讀寫狀態檢查<BR>#define RWCheck() { unsigned char
sta; do{ sta=XBYTE[ComPort] & 0x03; } while(sta!=0x03);
}<BR>//數據自動讀 狀態檢查<BR>#define AutoRCheck() { unsigned char sta;
do{ sta=XBYTE[ComPort] & 0x04; } while(sta!=0x04);
}<BR>//數據自動寫 狀態檢查<BR>#define AutoWCheck() { unsigned char sta;
do{ sta=XBYTE[ComPort] & 0x08; } while(sta!=0x08); }</P>
<P>/*------輸入/出函數,與T6963通訊------------------------------------------------*/<BR>/*------------------------------------------------------------------------*/</P>
<P>// 向數據口發Data<BR>#define OutPortData(dat ) { RWCheck();
XBYTE[DataPort]=dat; }</P>
<P>//寫有 1 個參數命令<BR>#define OutPortCom1(command) { RWCheck();
XBYTE[ComPort]= command; }</P>
<P>//寫有 2 個參數命令<BR>#define OutPortCom2(dat, command) {
OutPortData(dat); OutPortCom1(command); }</P>
<P>//寫有 3 個參數命令<BR>#define OutPortCom3(data1, data2, command)
{ OutPortData(data1); OutPortData(data2);
OutPortCom1(command);}</P>
<P><BR>unsigned char InPortData() { RWCheck();
return(XBYTE[DataPort]); }</P>
<P>/*-----------------------------------------------------------------------------------*/<BR>//顯示8*16字符<BR>//lin:行(0-7),
column: 列(0-15)<BR>//ch:字符代碼(標準ASCII碼)<BR>void
ShowChar(unsigned char lin,unsigned char column,unsigned char
ch)<BR>{<BR>unsigned char i;<BR>unsigned char dat;<BR>unsigned
int StartAddr;</P>
<P>StartAddr=lin*LineChar +column; //定位起始行</P>
<P>for(i=0;i<16;i++)<BR>{<BR>dat=ASCII816[ ch-0x20
][i];<BR>OutPortCom3( (unsigned char)(StartAddr), (unsigned
char)(StartAddr>>8), 0x24); //set
address<BR>OutPortCom2( dat, 0xc4);</P>
<P>StartAddr=StartAddr + LineChar;<BR>}<BR>}</P>
<P>/*----------------------------------------------------------------------------------------------*/<BR>//顯示一個漢字(16*16點陣)<BR>//lin:行(0-7),
column: 列(0-7)<BR>//hzcode: 漢字代碼(自定義的)<BR>void ShowHZ(unsigned
char lin,unsigned char column,unsigned int
hzcode)<BR>{<BR>unsigned char i;<BR>unsigned int
StartAddr;</P>
<P>StartAddr=lin*LineChar + column; //定位起始行</P>
<P>for(i=0;i<16;i++)<BR>{<BR>OutPortCom3( (unsigned
char)(StartAddr), (unsigned char)(StartAddr>>8),
0x24);<BR>OutPortCom2( HZTable[hzcode][i*2], 0xc0); //左半部
地址加一<BR>OutPortCom2( HZTable[hzcode][i*2+1], 0xc4); //右半部
字模地址加一</P>
<P>StartAddr=StartAddr +
LineChar;<BR>}<BR>}<BR>/////////////////////////////////////////////////////////////////////////////////////////////<BR>//顯示一個漢字(16*16點陣)<BR>//lin:行(0-7),
column: 列(0-7)<BR>//hzcode: 漢字代碼(自定義的)<BR>void
ShowHZD(unsigned char lin,unsigned char column,unsigned int
hzcode)<BR>{<BR>unsigned char i,j;<BR>unsigned int
StartAddr;</P>
<P>StartAddr=lin*LineChar*16 +column; //定位起始行</P>
<P>for(i=0;i<35;i++)<BR>{<BR>OutPortCom3( (unsigned
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -