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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

2,595 Views
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
 
Labels (1)
0 Kudos
Reply
4 Replies

646 Views
datamstr
Contributor II
Hi Mac,
 
So would I have to make it Static Global because it is in an ISR?
 
Thanks,
David
0 Kudos
Reply

646 Views
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 Kudos
Reply

646 Views
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 Kudos
Reply

646 Views
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 Kudos
Reply