AnsweredAssumed Answered

Uart 6 problems

Question asked by jdcowpland on Dec 2, 2013
Latest reply on Dec 5, 2013 by fm
Hey folks,

Having some issues receiving data on uart6 on my STM32F415VG and hoping someone might be able to help. I'm sending data at 115.2kbaud with 8 bits, no parity and one stop bit. I send the data to my peripheral device ( a sequence of 5 bytes) and it responds with 5 bytes. I can see both these signals on the lines between the devices using an oscilloscope. Problem is that it looks like the response is possibly too fast for the processor to catch? My receive code looks like this:

USART6_CR1.RE = 1;

i=0;
while(1){
  if(usart6_sr.b5 == 1){
  buffer[i]= USART6_DR;
  i++;
     if(i==4){
     break;}

I know i could use the stm libraries, but I'm using Mikroelektronika as my IDE so that's not going to work all that easily. I've run a debug, and the first time through, the uart picks up the first response byte and the SR register has a value of 248. That shows that there is an overrun error. The second time through that while loop, the value is 192, which shows that there is no data left to read. Makes me think that all the data is coming too fast and that it catches the first byte but the rest of the data keeps coming before it can clear the data register and so it logs an over run. Any ideas?

Outcomes