Re: PIC18F6490 UART
|
||||
---|---|---|---|---|
資深會員
|
最後發現也不是區域變數的問題,我將RX9D丟到位元變數再讀取RCREG之後就正常了,如下所示
bit_rx9d1_state=_RX9D1; uns8_temp=RCREG1; 其中uns8_temp為區域變數
發表於: 2009/2/6 12:01
|
|||
|
PIC18F6490 UART
|
||||
---|---|---|---|---|
資深會員
|
#pragma interrupt isr_high nosave=section(".tmpdata")
void isr_high(void) { unsigned char uns8_temp; if(_RC1IE && _RC1IF) { //uns8_temp=RCREG1; test=RCREG1; RC1IF=0; } } 以上是我通訊中斷的副程式,原本我用uns8_temp=RCREG1;接收到的uns8_temp皆為0,但改為test之後就正常了,兩者的差別是test是廣域變數而uns8_temp為區域變數,這是為甚麼呢?
發表於: 2009/2/5 15:40
|
|||
|