cancel
Showing results for 
Search instead for 
Did you mean: 

Why my stm8s103f3 can not enter into uart rx interrupt?

cgh21
Associate II
Posted on April 14, 2011 at 19:23

Why my stm8s103f3 can not enter into uart rx interrupt?

5 REPLIES 5
cgh21
Associate II
Posted on May 17, 2011 at 15:12

PS:

I am using cosmic 4.3.4+stvd.

richb
Associate II
Posted on May 17, 2011 at 15:12

Unless I miss my guess, you are missing the UARTx_Cmd(ENABLE) command, but it could also be the 'overrun' part of your interrupt enable call. 

Here is my code for UART3 that works (using receive and transmit interrupts):

    UART3_Init(38400,

               UART3_WORDLENGTH_8D,

               UART3_STOPBITS_1,

               UART3_PARITY_NO,

               UART3_MODE_TXRX_ENABLE);   

    UART3_Cmd(ENABLE);

    UART3_ITConfig(UART3_IT_RXNE, ENABLE);

Hope that helps

cgh21
Associate II
Posted on May 17, 2011 at 15:12

As far as i know,there is no need to excute UART_CMD(ENABLE),But i tried, the same.Thanks for your information.

Chris
wen
Associate
Posted on September 29, 2011 at 11:36

 use the register is the fast
mighel84
Associate II
Posted on October 18, 2011 at 18:28

If you don't ENABLE the peripheric will not power up or the clock signal will not be connected to uart internally.

If problem persist try with your compiler getchar putchar functions.