Re: rs232接收的問題一問
|
||||
---|---|---|---|---|
高級會員
|
鮑率為9600
發表於: 2007/10/22 14:34
|
|||
|
Re: rs232接收的問題一問
|
||||
---|---|---|---|---|
初級會員
|
鮑率的設定值為何呢?
發表於: 2007/10/22 10:42
|
|||
|
Re: rs232接收的問題一問
|
||||
---|---|---|---|---|
高級會員
|
後來解決了因osc用的不同、device用的電壓只有3v所以無沒用到20MHz 的osc。
後來又遇到一個問題、之前人寫的debug mode 將資料用一個io 摸擬uart傳送到電腦的資料我換了之前、在電腦前看就都亂掉了。 原本是使用timer2我後來改到timer4因為型態才相同。 osc 4Mhz 使用4倍頻所以是16MHz 以下是一些相關的設定、有大大能幫我看一下嗎 18f6680換18f8622 void Dputc(uw8 cc) { uw16 i; Dbit = 0x0001; Ddata = 0xF007 | ((uw16)cc<<4);//61447 T4CONbits.TMR4ON = 1; i = 0; while(T4CONbits.TMR4ON) { if (i>RSWAIT_T2MS) break; _nop(); i++; } } if (PIR3bits.TMR4IF) { // Timer4 Interrupt for DBG (9600 bps). PIR3bits.TMR4IF = 0; TMR4 = 0; if (Ddata & Dbit) PORTEbits.RE7 = 1; else PORTEbits.RE7 = 0; Dbit <<= 1; if (Dbit==0x8000) T4CONbits.TMR4ON = 0; } TRISE = 0x10; INTCON = 0xE0; INTCON2 = 0x8E; INTCON3 = 0xB0; PIR1 = 0x0; PIR2 = 0x0; PIR3 = 0x0; PIE1 = 0x21; PIE2 = 0x0; PIE3 = 0xEA; IPR1 = 0x21; IPR2 = 0x0; IPR3 = 0xE2; RCON = 0x80;
發表於: 2007/10/17 16:04
|
|||
|
Re: rs232接收的問題一問
|
||||
---|---|---|---|---|
新會員
|
發表於: 2007/10/2 12:46
|
|||
|
rs232接收的問題一問
|
||||
---|---|---|---|---|
高級會員
|
我原本寫的是用18f6680後來改成18f8622在應用uart2的時候產生了問題
我傳送了48byte的ff給是收到的第一個byte是ff後面的2~48都變成了fe到底發生了什麼事情了
發表於: 2007/10/1 17:52
|
|||
|