標題: 新手求大神指導,12864液晶用keil調(diào)試時,一直在忙檢測函數(shù)里死循環(huán),怎么回事? [打印本頁]

作者: 探路    時間: 2017-11-13 13:00
標題: 新手求大神指導,12864液晶用keil調(diào)試時,一直在忙檢測函數(shù)里死循環(huán),怎么回事?
uchar dectbusybit() //忙檢測
{
   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);//忙等待

作者: cccc8888    時間: 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幫助文件。
作者: 探路    時間: 2017-11-13 16:33
我看了,但不懂這一段英文與我的問題有什么關系,能說詳細點嗎?
作者: STC89C51    時間: 2017-11-13 17:04
讀P0狀態(tài)時要給P0口拉高,即P0=0xff,再讀
作者: 探路    時間: 2017-11-13 18:19
我加入了uchar dectbusybit()        //忙檢測 {    uchar s;    P0=0xff;    RS=0; //讀指令    RW=1;    EN=1;    delayms(5);    s=P0;    EN=0;    return s;   }調(diào)試還是這樣的
作者: cccc8888    時間: 2017-11-13 18:38
I/O Ports I/O Ports 打開對應端口,把輸入的勾去掉或者打上。
作者: ahshmj    時間: 2017-11-13 20:35
沒有12864的應答,當然就認為是“忙”。
作者: wulin    時間: 2017-11-13 22:17
因為沒有應答,用keil調(diào)試時把這句注釋掉//while((dectbusybit()&0x80)==0x80);//忙等待  ,




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1