Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
高級會員
|
多謝各位了~終於找到真正原因了...原來是超級終端機那邊有個流量限制, 因為預設是 "硬體" ,我把它改成無 就能收的到訊號了... 感恩~~
發表於: 2007/12/10 8:58
|
|||
|
Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
資深會員
|
DSW2 pin3,4 要 on
你由電腦送信號時 那 DSW2 旁的 LED16 (RX) 有沒有反應 LED15 是 TX 至於範例 有 Pic16 or dsPic30 右邊範例程式(29)有 pic16 的 pic18 我再找找
發表於: 2007/12/7 13:51
|
|||
|
Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
新會員
|
可以去掉Tx只保留Rx試試看摟(IPR1只留RCIP)
或是貼一下code大家來debug
發表於: 2007/12/7 13:28
|
|||
|
Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
高級會員
|
多謝T大的提醒~但是我已經把 TRISC 全都設定為1了,也是不行.您是否有code 能直接給我test一下呢?
發表於: 2007/12/7 10:46
|
|||
|
Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
資深會員
|
我看了一下 18F8680 的 DataSheet 越來越發現 Microchip 的奧妙
參照:
表示 bit<7:6> 都必須設成 1 感覺上 在設這些 I/O pin 在 pic16, pic18, dsPic30 都有點不太一樣 尤其在 pic16 若 pin 有 analog 的功能 還要 disable ANSEL 才能讀 digital 的資料 我為了這個花了兩個鐘頭把 datasheet 讀了好幾遍 才找出原因
發表於: 2007/12/6 14:51
|
|||
|
Re: 使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
高級會員
|
= =" 都沒人回答,我從新補充清楚一點好了.
PIE1 00100000B // Bit5 :1=RCIE Enable PIR1 00010000B // Bit4 :1=TXIE Enable IPR1 11111111B //全部中斷設定成高優先權 (包含 RCIP 跟TXIP) RCON 10011100B //Bit7:IPEN 1=Enable priority //Bit4:~RI Reset Instruction Flag //Bit3:~TO Watch dog Time out Flag //Bit2:~PD Power-down Detection Flag (Bit2~Bit4 這些設定有錯嗎?) INTCON 10000001B //Bit7 :1=GIE/GIEH Enable TXSTA 10100110B //Bit7:CSRC Don't care (Asyn mode) //Bit5:TXEN 1=Transmit Enable //Bit2:BRGH 1=High speed //Bit1:TRMT 1=TSR empty RCSTA 10010000B //Bit7:SPEN 1=Serial Port Enable //Bit4:CREN 1=Enable receiver (Asyn) TRISC 10111111B //把RC6 設定為輸出~RC7 設定為輸入 請問大家 我還有哪些東西是沒注意到的呢? 用了好久都用不出來.好困擾....
發表於: 2007/12/6 9:42
|
|||
|
使用APP023-1 USART接收問題(18F8680)
|
||||
---|---|---|---|---|
高級會員
|
小弟我使用這片練習版 想試著使用 RS-232 跟電腦超級終端機發送訊號.目前
我用PIC 發出字元,超級終端機都收的到, 但是我使用超級終端機發送字元PIC 卻收不到 不知到是哪裡有問題, RCREG 裡面 一直都沒有資料...檢查後的結果 我的一些REG內容是這樣的... PIE1 00100000B PIR1 00010000B IPR1 11111111B RCON 10011100B INTCON 10000001B TXSTA 10100110B RCSTA 10010000B TRISC 10111111B 麻煩請大家幫個忙~
發表於: 2007/12/5 10:14
|
|||
|