Browsing this Thread:
1 Anonymous Users
|
一個 USART 傳輸的問題
|
|
中級會員
Joined
: 2007/12/26 17:11 最後登入時間
: 2009/6/16 14:53
Group:
註冊會員
Level : 6 HP : 0 / 128 MP : 17 / 6283 EXP : 12
|
請問一下各位高手大大 我利用 PIC18F65J90 將其 TX、RX 接了一個設備 透過丟一各 command,該設備會回應訊息給 PIC 但現在有個問題是,我 Command 丟了,可是該設備都無任何回應 有量波形、PIC接腳位收端都無波行反應 但發送端腳位是有波形的,確定有將 command 送出去 不曉的是不是 Baud rate 設錯,baud rate 是 115200 是不是有大大可以幫我看一下那邊設錯,因為我有改用另外一顆 PIC18F6490 透過 PIC18F6490 將 command 丟給另一端設備,另一端設備也都有回應 但是改成PIC18F65J90後,command 丟了,可是另外一端設備卻不會有回應
以下是我 PIC18F65J90 的 OSC 和 USART 設定 ============================================== Configuration Bits 裡面的 Oscillator 為 INTOSC HS
OSCCONbits.IDLEN=0; OSCCONbits.IRCF2=1; OSCCONbits.IRCF1=1; OSCCONbits.IRCF0=1; OSCCONbits.OSTS=1; OSCCONbits.IOFS=1; OSCCONbits.SCS1=0; OSCCONbits.SCS0=0;
OSCTUNEbits.INTSRC=1; OSCTUNEbits.PLLEN=1; OSCTUNEbits.TUN5=0; OSCTUNEbits.TUN4=0; OSCTUNEbits.TUN3=0; OSCTUNEbits.TUN2=0; OSCTUNEbits.TUN1=0; OSCTUNEbits.TUN0=0;
Open1USART( USART_TX_INT_OFF & USART_RX_INT_ON & USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 16); // 16 for 115200 bps in 8MHz ======================================================================= 以下是我 PIC18F6490 的 OSC 和 USART 設定
Configuration Bits 裡面的 Oscillator 為 INT RC-CLKOUT on RA6,Port on RA7
OSCCONbits.IDLEN=0; OSCCONbits.IRCF2=1; OSCCONbits.IRCF1=1; OSCCONbits.IRCF0=1; OSCCONbits.OSTS=1; OSCCONbits.IOFS=1; OSCCONbits.SCS1=0; OSCCONbits.SCS0=0;
OSCTUNEbits.INTSRC=1; OSCTUNEbits.PLLEN=1; OSCTUNEbits.TUN4=0; OSCTUNEbits.TUN3=0; OSCTUNEbits.TUN2=0; OSCTUNEbits.TUN1=0; OSCTUNEbits.TUN0=0;
Open1USART( USART_TX_INT_OFF & USART_RX_INT_ON & // 將USART接收設定為中斷方式接收 USART_ASYNCH_MODE & USART_EIGHT_BIT & USART_CONT_RX & USART_BRGH_HIGH, 16); // 52 for 9600 bps in 8MHz
===================================================================== 基本上兩各PIC設定都一樣 只有 Configuration Bits 裡面的 Oscillator 不一樣
懇請各位大大指點了,先說聲謝謝
補充一下,有去量這兩各 PIC 送出來的 Command 的訊號 週期頻率明顯不一樣
發表於: 2009/4/10 16:41
|
|
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.