Browsing this Thread:
1 Anonymous Users
Topic options
View mode
舊的在前
Re: 讀取eeprom內資料並顯示於LCD上
版主
Joined
: 2004/4/30 10:53最後登入時間
: 2021/11/30 18:11
From CAE, Microchip
Group:
站務管理者 註冊會員
Level : 75
HP : 744 / 1861
MP : 5367 / 111145
EXP : 45
這程式是 W401 練習六的程式,程式沒有問題的。請檢查一下 hyper-Terminal 是否有自 RS-232 送出資料到 PIC18F452, 要用示波器檢查一下是否有收到 UART 的訊號? 設個斷點在 UART 的接收中斷程式裡,看看是否正常接收?
發表於: 2009/1/14 13:55
讀取eeprom內資料並顯示於LCD上
新會員
Joined
: 2009/1/12 16:44最後登入時間
: 2009/1/12 16:44
Group:
註冊會員
Level : 1
HP : 0 / 0
MP : 0 / 0
EXP : 0
小弟是使用p18f452試了幾天還是一直無法在LCD上顯示,鍵盤輸入的數字,主要是在鍵盤上輸入四個以上至十個以下的數字,每輸入一個數字後即存入EEPROM內,確定輸入完畢後按下Enter,需顯示輸入的數字於LCD顯示器上。(問題:測試過LCD無法顯示出任何數字),不知道程式方面還需要修改哪些,jump10 1-2接、3-4接,jump9皆斷 const rom char LCD_MSG1[]="Waiting Data Now!"; const rom char LCD_MSG2[]="-Display EEPROM- "; const rom far char Disp_Msg1[]="Please Enter your Number :"; const rom far char Disp_Msg2[]="EEPROM WRITE is completed!"; const rom far char Disp_Msg3[]="\aError! Please enter again:"; const rom far char Disp_Msg4[]="\aYou must get 4 Digials at least! "; const rom far char Disp_Msg5[]="Completed to save your Number!"; main program void main(void) { InitializePORT( ); InitializeTMR2( ); OpenLCD( ); Initialize_I2C_Master( ); InitializeINTs( ); InitializeUSART( ); Display_Terminal(Disp_Msg1); LCD_Set_Cursor(0,0); putrsLCD(LCD_MSG1); Rec_Data=0x00; EE_Addr=0; // Set EEPROM start address = 0 do { while(Rec_Data==0x00); if (isdigit(Rec_Data )) { f=EEByteWrite (0xA0,EE_Addr,Rec_Data); f=EEAckPolling(0xA0); EE_Addr++; Rec_Data=0x00; Display_Terminal(Disp_Msg2); } else if (Rec_Data!=0x0D) { Display_Terminal(Disp_Msg3); Rec_Data=0x00; } else if (EE_Addr<Min_Langth) { Display_Terminal(Disp_Msg4); Rec_Data=0x00; } } while ((EE_Addr<10) && ((Rec_Data!=0x0d)||(EE_Addr<Min_Langth))); { Rec_Data=NULL; f=EEByteWrite (0xA0,EE_Addr,Rec_Data); f=EEAckPolling(0xA0); Display_Terminal(Disp_Msg5); } LCD_Set_Cursor(0,0); putrsLCD(LCD_MSG2); LCD_Set_Cursor(1,0); j=0; while(1) { EE_Read_Data.l = EERandomRead(0xA0,j); if (EE_Read_Data.i[0]!=NULL) { WriteDataLCD(EE_Read_Data.i[0]); j++; } else break; } while(1); } 請各位高手大大,能幫幫小弟我,謝謝。
發表於: 2009/1/12 17:23
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.