為什么CH454D不能自已動(dòng)態(tài)顯示? 而要單片機(jī)不斷的發(fā)顯示數(shù)據(jù)給CH454D?
void main( void )//主程序 { UINT8 a,b; UINT8 vL[4],vH[4];
delayms(40);
#ifdef USE_CH454_KEY init();//初始化 ch454_write(0x443);//開(kāi)顯示鍵盤(pán) #else ch454_write(0x441);//開(kāi)顯示 #endif
ch454_write(CH454_NO_BCD);//直接譯碼方式 while(1) { //發(fā)送顯示命令 ch454_write( CH454_DIG0_LO | mBCD[0] ); ch454_write( CH454_DIG1_LO | mBCD[1] ); ch454_write( CH454_DIG2_LO | mBCD[2] ); ch454_write( CH454_DIG3_LO | mBCD[3] ); ch454_write( CH454_DIG4_LO | mBCD[4] ); ch454_write( CH454_DIG5_LO | mBCD[5] ); ch454_write( CH454_DIG6_LO | mBCD[6] ); ch454_write( CH454_DIG7_LO | mBCD[7] ); ch454_write( CH454_DIG0_HI | mBCD[8] ); ch454_write( CH454_DIG1_HI | mBCD[9] ); ch454_write( CH454_DIG2_HI | mBCD[10] ); ch454_write( CH454_DIG3_HI | mBCD[11] ); ch454_write( CH454_DIG4_HI | mBCD[12] ); ch454_write( CH454_DIG5_HI | mBCD[13] ); ch454_write( CH454_DIG6_HI | mBCD[14] ); ch454_write( CH454_DIG7_HI | mBCD[15] ); ch454_write(0x441);//開(kāi)顯示 } }
單片機(jī)主程序要這樣一直給CH454發(fā)數(shù)據(jù),發(fā)顯示命令。CH454才會(huì)顯示。 CH454D不能自已動(dòng)態(tài)顯示?
樓主,這個(gè)程序只是簡(jiǎn)單的應(yīng)用,CH454本身是可以自動(dòng)動(dòng)態(tài)顯示的,不需要單片機(jī)一直不停的發(fā)顯示數(shù)據(jù).
ch454_write( CH454_DIG0_LO | mBCD[0] ); ch454_write( CH454_DIG1_LO | mBCD[1] ); ch454_write( CH454_DIG2_LO | mBCD[2] ); ch454_write( CH454_DIG3_LO | mBCD[3] ); ch454_write( CH454_DIG4_LO | mBCD[4] ); ch454_write( CH454_DIG5_LO | mBCD[5] ); ch454_write( CH454_DIG6_LO | mBCD[6] ); ch454_write( CH454_DIG7_LO | mBCD[7] ); ch454_write( CH454_DIG0_HI | mBCD[8] ); ch454_write( CH454_DIG1_HI | mBCD[9] ); ch454_write( CH454_DIG2_HI | mBCD[10] ); ch454_write( CH454_DIG3_HI | mBCD[11] ); ch454_write( CH454_DIG4_HI | mBCD[12] ); ch454_write( CH454_DIG5_HI | mBCD[13] ); ch454_write( CH454_DIG6_HI | mBCD[14] ); ch454_write( CH454_DIG7_HI | mBCD[15] ); 這個(gè)只是給每一個(gè)位的寄存器一個(gè)顯示的值,之后你要是不發(fā)數(shù)據(jù),它就會(huì)動(dòng)態(tài)掃描來(lái)顯示這些數(shù)據(jù),當(dāng)你要更新要顯示的內(nèi)容的時(shí)候,再如此這般把要更新的數(shù)據(jù)發(fā)到相應(yīng)的寄存器中,就會(huì)顯示新的內(nèi)容了。 例程只是給了一個(gè)最簡(jiǎn)的程序,沒(méi)有加控制,你可以試著在后面加一個(gè)空死循環(huán),這樣你會(huì)發(fā)現(xiàn)即使單片機(jī)在空死循環(huán)里,數(shù)碼管依然在顯示之前發(fā)進(jìn)去的內(nèi)容。
呵呵!看來(lái)三樓朋友對(duì)CH454很熟悉.是的!說(shuō)的沒(méi)錯(cuò)!