Hello Mac,
Thanks for the reply.
This is my code for ISR:
#define ISR(x) __interrupt void x(void)
#pragma CODE_SEG __NEAR_SEG NON_BANKED
ISR (ISR_SCI0)
{
UCHAR scistatus = 0;
UCHAR scidata = 0;
scistatus = SCI0SR1;
if (scistatus & (SCI0SR1_OR_MASK | SCI0SR1_FE_MASK | SCI0SR1_NF_MASK)) // Is any error flag set?
{
if (scistatus & SCI0SR1_OR_MASK) // Is overrun error detected?
{
scistatus = 0x01; // If yes then set an internal flag
}
if (scistatus & SCI0SR1_NF_MASK) // Is noise error detected?
{
scistatus = 0x08; // If yes then set an internal flag
}
if (scistatus & SCI0SR1_FE_MASK) // Is framing error detected?
{
scistatus = 0x02; // If yes then set an internal flag
}
scidata = SCI0DRL; // Dummy read of data register - clear error bits
//StatReg &= ~SCI0SR1_RDRF_MASK; // Clear the receive data flag to discard the errorneous data
}
if (scistatus & SCI0SR1_RDRF_MASK) // Is the receiver interrupt flag set?
{
scidata = SCI0DRL; // data read
}
SCI0DRL = scidata;
//if (SCI0CR2_SCTIE) // Is the transmitter interrupt enabled?
{
if (scistatus & SCI0SR1_TDRE_MASK) // Is the transmitter interrupt flag set?
{
scistatus = SCI0SR1;
}
}
}
#pragma CODE_SEG DEFAULT
Below is my isr table:
extern void near _Startup(void); /* Startup routine */
//extern void near ISR_RTI(void);
extern void near ISR_SCI0(void);
#pragma CODE_SEG __NEAR_SEG NON_BANKED /* Interrupt section for this module. Placement will be in NON_BANKED area. */
__interrupt void UnimplementedISR(void)
{
/* Unimplemented ISRs trap.*/
asm BGND;
}
typedef void (*near tIsrFunc)(void);
const tIsrFunc _vect[] @0xFF80 = { /* Interrupt table */
UnimplementedISR, /* vector 63 */
UnimplementedISR, /* vector 62 */
UnimplementedISR, /* vector 61 */
UnimplementedISR, /* vector 60 */
UnimplementedISR, /* vector 59 */
UnimplementedISR, /* vector 58 */
UnimplementedISR, /* vector 57 */
UnimplementedISR, /* vector 56 */
UnimplementedISR, /* vector 55 */
UnimplementedISR, /* vector 54 */
UnimplementedISR, /* vector 53 */
UnimplementedISR, /* vector 52 */
UnimplementedISR, /* vector 51 */
UnimplementedISR, /* vector 50 */
UnimplementedISR, /* vector 49 */
UnimplementedISR, /* vector 48 */
UnimplementedISR, /* vector 47 */
UnimplementedISR, /* vector 46 */
UnimplementedISR, /* vector 45 */
UnimplementedISR, /* vector 44 */
UnimplementedISR, /* vector 43 */
UnimplementedISR, /* vector 42 */
UnimplementedISR, /* vector 41 */
UnimplementedISR, /* vector 40 */
UnimplementedISR, /* vector 39 */
UnimplementedISR, /* vector 38 */
UnimplementedISR, /* vector 37 */
UnimplementedISR, /* vector 36 */
UnimplementedISR, /* vector 35 */
UnimplementedISR, /* vector 34 */
UnimplementedISR, /* vector 33 */
UnimplementedISR, /* vector 32 */
UnimplementedISR, /* vector 31 */
UnimplementedISR, /* vector 30 */
UnimplementedISR, /* vector 29 */
UnimplementedISR, /* vector 28 */
UnimplementedISR, /* vector 27 */
UnimplementedISR, /* vector 26 */
UnimplementedISR, /* vector 25 */
UnimplementedISR, /* vector 24 */
UnimplementedISR, /* vector 23 */
UnimplementedISR, /* vector 22 */
UnimplementedISR, /* vector 21 */
ISR_SCI0, /* vector 20 */
UnimplementedISR, /* vector 19 */
UnimplementedISR, /* vector 18 */
UnimplementedISR, /* vector 17 */
UnimplementedISR, /* vector 16 */
UnimplementedISR, /* vector 15 */
UnimplementedISR, /* vector 14 */
UnimplementedISR, /* vector 13 */
UnimplementedISR, /* vector 12 */
UnimplementedISR, /* vector 11 */
UnimplementedISR, /* vector 10 */
UnimplementedISR, /* vector 09 */
UnimplementedISR, /* vector 08 */
//ISR_RTI, /* vector 07 */
UnimplementedISR, /* vector 06 */
UnimplementedISR, /* vector 05 */
UnimplementedISR, /* vector 04 */
UnimplementedISR, /* vector 03 */
UnimplementedISR, /* vector 02 */
UnimplementedISR, /* vector 01 */
UnimplementedISR, /* vector 00 */
_Startup /* Reset vector */
};
Please let me know where I am going wrong. Thanks in advance.