Skip to main content
Visitor II
April 14, 2011
Question

Why my stm8s103f3 can not enter into uart rx interrupt?

  • April 14, 2011
  • 5 replies
  • 1111 views
Posted on April 14, 2011 at 19:23

Why my stm8s103f3 can not enter into uart rx interrupt?

    This topic has been closed for replies.

    5 replies

    cgh21Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:12

    PS:

    I am using cosmic 4.3.4+stvd.

    Visitor II
    May 17, 2011
    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

    cgh21Author
    Visitor II
    May 17, 2011
    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
    Visitor II
    September 29, 2011
    Posted on September 29, 2011 at 11:36

     use the register is the fast
    Visitor II
    October 18, 2011
    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.