找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 4205|回復(fù): 7
打印 上一主題 下一主題
收起左側(cè)

新手求大神指導(dǎo),12864液晶用keil調(diào)試時(shí),一直在忙檢測(cè)函數(shù)里死循環(huán),怎么回事?

[復(fù)制鏈接]
回帖獎(jiǎng)勵(lì) 2 黑幣 回復(fù)本帖可獲得 2 黑幣獎(jiǎng)勵(lì)! 每人限 3 次(中獎(jiǎng)概率 70%)
跳轉(zhuǎn)到指定樓層
樓主
ID:229016 發(fā)表于 2017-11-13 13:00 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
uchar dectbusybit() //忙檢測(cè)
{
   uchar s;
   RS=0; //讀指令
   RW=1;
   EN=1;
   delayms(5);
   s=P0;
   EN=0;
   return s;
  }
void lcd_wrcom(uchar com) //寫指令函數(shù)
{
   while((dectbusybit()&0x80)==0x80);//忙等待
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:248503 發(fā)表于 2017-11-13 13:42 | 只看該作者
Peripherals Menu
The menu Peripherals includes dialogs to view and change on-chip peripheral settings. The content of this menu is tailored to show specific peripherals of the CPU selected for the application. This menu is active only in Debug Mode.

The table shows some typical dialogs provided by this menu

Menu Item Description
Interrupts Interrupt Controller
I/O Ports I/O Ports
Serial Serial Port
Timer Timers/Counters
Watchdog Watchdog Timer
A/D Converter Analog to Digital Converter
D/A Converter Digital to Analog Converter
I2C Controller I2C Controller
CAN Controller CAN Controller

看uv幫助文件。
回復(fù)

使用道具 舉報(bào)

板凳
ID:229016 發(fā)表于 2017-11-13 16:33 | 只看該作者
我看了,但不懂這一段英文與我的問題有什么關(guān)系,能說詳細(xì)點(diǎn)嗎?
回復(fù)

使用道具 舉報(bào)

地板
ID:137239 發(fā)表于 2017-11-13 17:04 | 只看該作者
讀P0狀態(tài)時(shí)要給P0口拉高,即P0=0xff,再讀
回復(fù)

使用道具 舉報(bào)

5#
ID:229016 發(fā)表于 2017-11-13 18:19 | 只看該作者
我加入了uchar dectbusybit()        //忙檢測(cè) {    uchar s;    P0=0xff;    RS=0; //讀指令    RW=1;    EN=1;    delayms(5);    s=P0;    EN=0;    return s;   }調(diào)試還是這樣的
回復(fù)

使用道具 舉報(bào)

6#
ID:248503 發(fā)表于 2017-11-13 18:38 | 只看該作者
I/O Ports I/O Ports 打開對(duì)應(yīng)端口,把輸入的勾去掉或者打上。
回復(fù)

使用道具 舉報(bào)

7#
ID:7485 發(fā)表于 2017-11-13 20:35 | 只看該作者
沒有12864的應(yīng)答,當(dāng)然就認(rèn)為是“忙”。
回復(fù)

使用道具 舉報(bào)

8#
ID:213173 發(fā)表于 2017-11-13 22:17 | 只看該作者
因?yàn)闆]有應(yīng)答,用keil調(diào)試時(shí)把這句注釋掉//while((dectbusybit()&0x80)==0x80);//忙等待  ,
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表