Skip to main content
vivek
Associate III
November 7, 2019
Question

STM32F105 USART not receive DATA continuous using ATMEGA16.

  • November 7, 2019
  • 2 replies
  • 1114 views

I am using STM32F105 (25Mhz crystal freq)with atmega16.

cycle of data sending:

1.STM32 to ATMEGA16.

2. ATMEGA16 to STM32.

first cycle is working fine but in second cycle atmega send data perfectly but stm32 not receive receive continue data.

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
November 7, 2019

What exactly are the symptoms? No byte arrives to STM32, or some byte arrive but some are missing, or all data arrive but they are corrupted?

  

JW

vivek
vivekAuthor
Associate III
November 7, 2019

some are arrive but some are missing but not update next data continuously in a stm usart interrupt buffer .

Ozone
Principal
November 7, 2019

Most probably an issue in the receive interrupt handler.

Spending too much time in the handler blocks the processing of further characters.

Reception will not continue until you clear the OV flag.

Presenting some code would be helpful.

vivek
vivekAuthor
Associate III
November 7, 2019

/* STM32 USART INTERRUPT HANDLER */

void USART2_IRQHandler(void)

{

do

{

if(USART_GetITStatus(USART2,USART_IT_RXNE)!=RESET)// if((USART2->SR & USART_FLAG_RXNE)!=RESET)

{

Interrupt_Receive_Buffer[Receive_Counter] = USART2->DR;//USART_ReceiveData(USART2);

Receive_Counter++;

}

}

while(Receive_Counter !=17);

}

/* return back receive data */

void Read_Disaply_Interrupt_Data(void)

{

/* send buffer byte by byte */

if(Interrupt_Receive_Buffer[0]== 0xAA)  //check buffer

{

if(Interrupt_Receive_Buffer[1] == 0x56)

{

if(Interrupt_Receive_Buffer[4]== 0x49)   //compare Current Buffer

{

Switch_Key_Press_Status_Update(Interrupt_Receive_Buffer[9]); in this function i am transfer (what i received through atmega16)

}

}

}

}

In a very first time data received but next data did not updated in received buffer.