新會員
Joined
: 2004/10/16 3:44 最後登入時間
: 2015/1/13 13:11
Group:
註冊會員
Level : 1 HP : 0 / 8 MP : 1 / 498 EXP : 34
|
各位大大: 我是新手,正在學PIC18, 以組合語言,寫RS232的程式,透過MPLAB IDE中,Debugger\setting\Utra1 IO來收發信號資料; 雖可收發資料,但透過Stop Watch視窗監看接收byte時間間隔, 有點疑問,
baud rate 為 9600, @40MHz, on P18F2410 device BSF TXSTA,BRGH ;BRGH =1 BSF BAUDCON,BRG16;BRG16=1 MOVLW LOW(.1040) MOVWF SPBRG MOVLW HIGH(.1040) MOVWF SPBRGH
所以接收或發送1個byte的時間為, (1/9600)* 10 = 1.04166ms 但在STOP WATCH所測得接收BTYE TO BYTE時間差,是 1.871ms; 在發送時,BTYE TO BYTE時間差,是 4.67 是baud rate的設定上有問題,或是這是軟體模擬的差異? 我還沒有在硬體電路上測試
發表於: 2007/1/14 22:51
|