No.35215 作者:guest 邮件:guest@guest.com ID:6 登陆:16560次 文章数:7648篇 最后登陆IP:219.68.9.43 最后登陆:2005/5/20 1:37:44 注册:2003/3/10 16:21:00 财富:35062 发帖时间:2003/6/20 15:56:59 发贴者IP:211.161.62.209 标题:guest:[求助]哪位大虾用过UPD6453,请帮小弟看一下程序! 摘要:No.35215[求助]哪位大虾用过UPD6453,请帮小弟看一下程序! 哪位大虾用过UPD6453,请帮小弟看一下程序! 小弟按如下程序运行时,在UPD6453的输出端得不到任何的信号。 /* AddLetters.c Author:RanGuanghong Date:2003.6.2 Vervion:1.0 Function: Ocsillor:12.00Mhz. CPU:w78e51 OSD device:uPD6453CY-001 OSD ocsillor:7.2Mhz,33pf. */ #include <reg51.h> #ifndef uchar #define uchar unsigned char #endif #ifndef uint #define uint unsigned int #endif #define ReloadTh1 0xf4 #define ReloadTl1 0xf4 /* I/O port. */ sbit Load=P1^0; sbit Sclk=P1^1; sbit BackGround=P1^2; sbit Busy=P1^3; sbit Clk=P1^4; sbit Cs=P1^5; sbit DataLine=P1^6; sbit Led=P1^7; /* Parramenters. */ uchar bdata Flags=0; sbit AddLetterFlag=Flags^0; uchar data ReloadTh0=0xff; uchar data ReloadTl0=0xbf; uchar data ColumCounter=0; uint data LedDelayTimer=65000; uchar data ByteCounter=0; uchar data DisplayControl=0; uchar data BackgroundControl=0; uchar data ProgressiveScanControl=0; uint data DisplayPositionControl=0; uint data CharacterWriteAddessControl=0; /* void Int1(void) */ void Int0(void) interrupt 0 { EX0=0; ET0=1; while(1); } /* void T0(void) */ void Timer0(void) interrupt 1 { TR0=0; ET0=0; while(1); } /* void Int0(void) */ void Int1(void) interrupt 2 { EX1=0; while(1); } /* void Timer1(void) */ void Timer1(void) interrupt 3 { TH1=ReloadTh1; TL1=ReloadTl1; while(1); } /* void SerialPort(void) */ void SerialPort(void) interrupt 4 { if(RI) { RI=0; } if(TI) { TI=0; } while(1); } /* void WriteByte(uchar x) */ void WriteByte(uchar x) { uchar i,j; j=x; while(Busy); for(i=0;i <8;i++) { Clk=0; j < <=1; DataLine=CY; Clk=1; } } /* void WriteOneByte(uchar x) */ void WriteOneByte(uchar x) { uchar i; i=x; Cs=0; WriteByte(i); while(Busy); Cs=1; } /* void WriteTwoByte(uint x) */ void WriteTwoByte(uint x) { uchar i; i=x/256; Cs=0; WriteByte(i); i=x%256; WriteByte(i); while(Busy); Cs=1; } /* void WriteSecondByte(uint x) */ void WriteSecondByte(uint x) { uchar i; ......
>>返回讨论的主题
|