cancel
Showing results for 
Search instead for 
Did you mean: 

stm8 tx by interrupt output many \0

David.Cheng
Associate II
INTERRUPT_HANDLER(USART1_TX_TIM5_UPD_OVF_TRG_BRK_IRQHandler,27)
{
    /* In order to detect unexpected events during development,
       it is recommended to set a breakpoint on the following instruction.
    */
    USART_SendData8(USART1, TxBuffer[TxCounter++]);
    USART_ClearITPendingBit(USART1, USART_IT_TC);
 
    if(TxCounter == 10)
    {
        /* Disable the USART Transmit Complete interrupt */
        USART_ITConfig(USART1, USART_IT_TC, DISABLE);
    }
}

USART_Cmd(USART1, DISABLE);
            USART_ITConfig(USART1, USART_IT_TC, ENABLE);
            USART_Cmd(USART1, ENABLE);

call this to send data

USART MODE

[20:41:57.432]ÊÕ¡û¡ôþ

\0\06\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.469]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.505]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.542]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.579]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.615]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0ÿ\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

[20:41:57.652]ÊÕ¡û¡ô\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

0 REPLIES 0