Lockedpic32mx250+uart/2

Post
teppei68
New Member
2013/07/21 02:44:30
hi at all,
so about UARTx and 250 all its ok, i can send a string from pic to PC with RTS/CTS, if i send a char from PC to pic happen a strange thing a char its received and i can show on lcd but the isr UART routine pass two time for a one char received so in this way always i receive a char and something other....the same it happen if i send a string like: PC=>32 (6chars) and i have on lcd P#C#=#>#3#2# (12chars)!
 
UART_INT_RX_CHAR
char p[64];
char *ricevo=p; 
 
 
void __ISR(_UART1_VECTOR, ipl2) IntUart1Handler(void)
{
    if(INTGetFlag(INT_SOURCE_UART_RX(UART1)))
            {
                INTClearFlag(INT_SOURCE_UART_RX(UART1));// Clear the RX interrupt Flag
                ricevo[s++]=U1RXREG;
                passaggi++;  // say me how many times it enter here
            }
   if(UART1GetErrors() & (_U1STA_OERR_MASK | _U1STA_FERR_MASK | _U1STA_PERR_MASK)) // handle an error on U1
            {
                UART1ClearAllErrors();                                                            // handle error...
                passi++;                                                                            // Say me if an error occur
            }
 
this function seem doesn't works at all:
getsUART1(1024,buffer,50);                                                            // feed buffer
 
anyone can help me?
andersm
Super Member
Re:pic32mx250+uart/2 2013/07/21 04:15:18
Read the received byte before clearing the interrupt flag. (Also wrong forum, this is not an XC32-related question.)
teppei68
New Member
Re:pic32mx250+uart/2 2013/07/21 13:43:14
ops.. how can i  change place about this thread? mr green
thank to answer absolutely solved all uart' problem! wink