etpuUART problem

Discussion to talk about software related topics only.
Post Reply
raja
Posts: 1
Joined: Mon Feb 01, 2010 9:35 am

etpuUART problem

Post by raja »

Dear Sir,
I am using interrupts and an RS232 port. The interrupt works fine.
The RS232 is not working if I include

ETPU_Interrupt_Routine = ENC_ETPU_ISR;
kindly advice.

Regards
Rajasekar


int ENC_ETPU_ISR(int channel)
{
switch(channel){
case ENCA_P1:{
break;
}

}
eTPUEventClear(channel); // Clear event so cahnnel can interrupt again
return 0;
}


void InitETPUIntr(void){
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
fs_etpu_gpio_cfg_input_trans(ENCA_P1, FS_ETPU_OP_LOW);
eTPUInterruptEnable(ENCA_P1);
}
#define ATXCH 14
#define ARXCH 15
#define UART_RX_CHANNEL (15) // Defines which eTPU channel will be UART RX
#define UART_TX_CHANNEL (14) // Defines which eTPU channel will be UART TX
void SerialInit(void){

eTPUfdx = eTPUFDUartOpen(ARXCH, ATXCH);

}
User avatar
lgitlitz
Posts: 331
Joined: Wed Apr 23, 2008 11:43 am
Location: San Diego, CA
Contact:

Re: etpuUART problem

Post by lgitlitz »

When using the NetBurner API, there are two callback functions that can be used to declare your eTPU interrupt routine:
extern int ( *ETPU_Interrupt_Routine )( int channel );
extern int ( *ETPU_Interrupt_Routine_UART )( int channel );

If you use ETPU_Interrupt_Routine, then the routine that your point to is all that is included inn the ISR. If you use ETPU_Interrupt_Routine_UART then the channel is first checked if it is a UART. If not then it will run your ISR. Just change the following in your code:
ETPU_Interrupt_Routine = ENC_ETPU_ISR;
should be:
ETPU_Interrupt_Routine_UART = ENC_ETPU_ISR;

-Larry
Post Reply