Using the 68HC908QB8 SCI ISR with CW 5 and the MCUInit.c file

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Using the 68HC908QB8 SCI ISR with CW 5 and the MCUInit.c file

3,214件の閲覧回数
datamstr
Contributor II
Hi All,
 
I am working with the 68HC908QB8 and trying to get the receive interrupt running. I have a few questions about working with the SCI Receive ISR generated by the "Device Initialization" code:
 
1. What is the best way to clear the SCIS1_RDRF bit and how to reference it?
2. How do I get the received byte back to the main.c file? ( I have tried extern byte data:smileywink:
 
Has anyone converted the receive circular buffer example referenced in another post to the QB8?
(AppNote430-03.pdf)
If so, can you please send or post it?
 
TIA,
David
 
ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,265件の閲覧回数
datamstr
Contributor II
Hi Mac,
 
So would I have to make it Static Global because it is in an ISR?
 
Thanks,
David
0 件の賞賛
返信

1,265件の閲覧回数
bigmac
Specialist III
Hello David,
 
If you made the variable a static global, it would only have visibility in the file in which it was declared.  This may not be what you require.  An ordinary global will have visibility for all files.  Both types would be permanently allocated to RAM.
 
Regards,
Mac
 
0 件の賞賛
返信

1,265件の閲覧回数
datamstr
Contributor II
I answered my own question #1, I was using the the defs from another 08 processor.
Now the following compiles OK.
 
__interrupt void isrINT_SCIReceive(void)
{
 /* Write your interrupt code here ... */
 byte rec_char;
 if(SCS1_SCRF)  // 1st half of SCRF clear procedure
   rec_char = SCDR;  // 2nd half of SCRF clear procedure
}
Still have question #2.
 
TIA,
David
0 件の賞賛
返信

1,265件の閲覧回数
bigmac
Specialist III
Hello David,
 
You have declared rec_char as a local variable.  For visibility of its contents outside the ISR, it must be declared as a global variable.
 
Regards,
Mac
 
0 件の賞賛
返信