Hi! I have a problem receiving (by interrupt) more than a byte from serial port on STM32 project. could you please post an example code?
void USARTx_IRQHANDLER(void) { if (USART_GetITStatus(USART3, USART_IT_RXNE)) { /* Read one byte from the receive data register /*RxBuffer[RxCounter++] = (USART_ReceiveData(USART3) & 0x7F); if(RxBuffer[RxCounter] == '\r') { /* Disable the COM1 Receive interrupt USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); */
t = USART3->DR; // the character from the USART1 data register is saved in t
/* check if the received character is not the LF character (used to determine end of string) * or the if the maximum string length has been been reached */
if (t != '\r') { buff[cnt] = t; cnt++; } else { // otherwise reset the character counter and print the received string cnt = 0; //USART_puts(USART3, received_string); //USART_ITConfig(USART3, USART_IT_RXNE, DISABLE); } }
what's wrong?