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,210 次查看
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,261 次查看
datamstr
Contributor II
Hi Mac,
 
So would I have to make it Static Global because it is in an ISR?
 
Thanks,
David
0 项奖励
回复

1,261 次查看
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,261 次查看
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,261 次查看
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 项奖励
回复