Re: [求助]PIC18F662X -- UART傳送問題??? 急~~~
|
||||
---|---|---|---|---|
高級會員
|
謝謝回覆~~
Debug中......
發表於: 2007/9/3 10:20
|
|||
|
Re: [求助]PIC18F662X -- UART傳送問題??? 急~~~
|
||||
---|---|---|---|---|
高級會員
|
謝謝回覆!!
----------------------------------------------------------------------------- // 以下的條件式改為 Pc_Output_Ptr < Pc_Output_Code_Cnt // 以本程式為例, 發送6個字元時, // 應為 [0], [1], [2], [3], [4], [5] 這6個字元 if (Pc_Output_Ptr < Pc_Output_Code_Cnt ) { Write2USART(Pc_Output_Buffer[Pc_Output_Ptr]) ; Pc_Output_Ptr += 1; } 這是另一個問題---- 我改為以上時, 利用監控程式, MCU送出為 XX,XX,XX,XX,0x0D,0xFF, 0x0A送不出來 若為原程式, MCU送出 XX,XX,XX,XX,0x0D,0x0A,0xFF 不知道位什麼會送出0xFF????程式並沒有送出0xFF的值.
發表於: 2007/8/31 17:43
|
|||
|
Re: [求助]PIC18F662X -- UART傳送問題??? 急~~~
|
||||
---|---|---|---|---|
中級會員
|
看起來是沒有明顯的錯誤啦!
但還是提一些修改的建議給你...
void SendACKtoPC(void)
發表於: 2007/8/31 16:23
|
|||
|
Re: [求助]PIC18F662X -- UART傳送問題??? 急~~~
|
||||
---|---|---|---|---|
版主
|
看不出來程式有錯誤,還是要你自己慢慢的 Debug :
1. 利用剩下的 Output 腳,在接收完成與傳送開始的程式做設定I/O輸出 Hi or Low 用示波器看看脽出錯。 2. 善用 ICD2 的中斷設定來除錯。
發表於: 2007/8/31 14:21
|
|||
|
[求助]PIC18F662X -- UART傳送問題??? 急~~~
|
||||
---|---|---|---|---|
高級會員
|
程式部分如下:
當PC連續送資料給MCU, MCU要回ACK(SendACKtoPC)給PC, 當MCU回幾次ACK給PC後(次數不一定), MCU就送不出ACK, 是程式問題嗎??哪裡須修正?? 有沒有MCU連續傳送資料的範例程式可參考. 謝謝回覆!!
void SendACKtoPC(void)
發表於: 2007/8/31 11:57
|
|||
|