- Microcontroller: dsPIC30F4013
- Compiler: xc16
I'm trying to receive an array from UART, but I only get the first 5 bytes.
I know that the receiver buffer is 4 words deep, but I need to receive the other bytes too. Maybe using a circular buffer, but I don't know how to uses this.
Can anyone help me to get all the bytes in the array?
This is my current code:
void __attribute__((__interrupt__, auto_psv)) _U1RXInterrupt(void) {
IFS0bits.U1RXIF = 0;
int i = 0;
while (U1STAbits.URXDA) {
array[i] = U1RXREG;
i++;
if (i == 10) {
break;
}
}
}
I'm sending each array position to a PC:
Sorry for my bad English.