i am using the RCM6760 now,i want to use its Serial port C interrupt to receive the character from other device,now, i use
the uart assistant(a pc application software,can receive and send char)as the other device,but the program have no function i want,why?
the code below:
#use “RS232.lib”
void serialc_isr(void);
#define CINBUFSIZE 31
#define COUTBUFSIZE 31
#define BAUDRATE 9600
void main(void)
{
SetVectIntern(0x0e,serialc_isr);
serCopen(BAUDRATE);
WrPortI(SCCR, &SCCRShadow, 0x01);
serCputc(0x55);
while(1)
{
}
}
nodebug root interrupt void serialc_isr()
{
int status,ch;
status=RdPortI(SCSR);
if(status&0x08)
{
printf("a byte is moved from the transmitter buffer
");
}
else if(status&0x80)
{
serCputc(0xb2);
ch = serCgetc();
serCputc(ch);
}
else if(status&0x04)
{
printf("a byte is sending
");
}
}
i can receive the character ‘0x55’ that the uart assistant receive,but send cann’t work.