Hello,
after solving the problems with sending over USART2 (with your great help at this forum) I implement the timer and interrupt library
* File Name : stm32f10x_tim.c
* Author : MCD Application Team
* Version : V2.0.3
* Date : 09/22/2008
and
stm32f10x_it.c
Unfortunately the TIM2_IRQHandler disturb USART2 during sending.
USART2 should send 45 bytes, but send with aktiv timer interrupt only 28 bytes.
But why can the TIM2_IRQHandler disturb USART2 ?
Regards, FunRice
The content of TIM2_IRQHandler is
void TIM2_IRQHandler(void)
{
if (TIM_GetITStatus(TIM2, TIM_IT_CC1) != RESET)
{
TIM_ClearITPendingBit(TIM2, TIM_IT_CC1);
GPIO_WriteBit(GPIOB, GPIO_Pin_6, (BitAction)(1 - GPIO_ReadOutputDataBit(GPIOB, GPIO_Pin_6)));
capture = TIM_GetCapture1(TIM2);
TIM_SetCompare1(TIM2, capture + CCR1_Val);
}
}