serial ISR doesn't run

Hello,

the ISR runs only for the first time. I'm not sure if the settings for the interrupt are correct. Can anyone explain me the difference between ASC0_RIC_IR and ASC0_RIC

thanks for help

Rainer

void rs232_open()
{

ASC0_CON = 0x8011; // set serial mode // Baudrate Generator disabled,Baudrate timer prescaled divide by 2 // even parity, ignore Parity, Receiver enabled REN = 1, One Stop Bit // 8 Bit data asyncron Mode

ASC0_BG = 0x81; // set baudrate fix Input Clock Dividers // 19200Baud 0x40/0x41 // 9600Baud 0x81/0x82

ASC0_TIC = 0x80; // set transmit interrupt flag ASC0_RIC = 0x45; // delete receive interrupt flag

}

void int_232_serv() interrupt intreg = 43
{

register BYTE c; ASC0_RIC_IE=0; // Receive interrupt disabled

c = ASC0_RBUF;

Receive = TRUE;

ASC0_RIC_IR = 0; ASC0_RIC_IE = 1;
}

Parents
  • Hello,

    has anyone a example for a loop back serial ISR routine for the xc161 Controller like the example for the 8051

    void rs232_open( )
    {

    PCON = 0x80; SCON = 0x50; RCAP2H = 0xFF ;

    RCAP2L = 0xFA ; // T2CON = 0x34 ; // baud ES = 1;
    }

    void int_232_serv() interrupt 4 { register BYTE c, nextp;

    if( RI ) { // receiver interrupt c = S0BUF;

    RI = 0 ; } else if( TI ) { // transmitter interrupt

    S0BUF = c; TI = 0 ; } }

    Thanks for help

    Rainer

Reply
  • Hello,

    has anyone a example for a loop back serial ISR routine for the xc161 Controller like the example for the 8051

    void rs232_open( )
    {

    PCON = 0x80; SCON = 0x50; RCAP2H = 0xFF ;

    RCAP2L = 0xFA ; // T2CON = 0x34 ; // baud ES = 1;
    }

    void int_232_serv() interrupt 4 { register BYTE c, nextp;

    if( RI ) { // receiver interrupt c = S0BUF;

    RI = 0 ; } else if( TI ) { // transmitter interrupt

    S0BUF = c; TI = 0 ; } }

    Thanks for help

    Rainer

Children
More questions in this forum