We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?
Possible solutions (given the clarity of the stated problem):
hardware,software,registers,timing,configurization,processing,contention,error handling,steps,sampling,noise,mode,detection,amplitude,rate,quantization,deviation,accuracy,limits,tolerances,transitions,length,parity,chronousity,clocks,protocol,etc....