cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F105 USART not receive DATA continuous using ATMEGA16.

vivek
Associate II

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.

4 REPLIES 4

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

Ozone
Lead

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.

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

/* 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.