Skip to main content
Visitor II
April 16, 2009
Question

STM8S208MB UART3 Interrupt Problem

  • April 16, 2009
  • 4 replies
  • 1096 views
Posted on April 16, 2009 at 12:15

STM8S208MB UART3 Interrupt Problem

    This topic has been closed for replies.

    4 replies

    acgtysrAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi there ,

    I am very new both to microcontroller programming and microcontrollers.

    I am using Ride7 compiler and Rlink programmer and STM8S-128 EVAL BOARD.

    I was trying to understand. While trying, I got help from the FWLIB examples. But UART3 Interrupt Example bugs me very much even though I programmed compiled example interrupt source of UART3-HyperTerminal-Interrupt directory . UART3 RX and TX Interrupts don't work . Here is the sample source of mine.

    void UART3_TX_IRQHandler (void) interrupt 20

    {

    something();

    }

    void UART3_RX_IRQHandler (void) interrupt 21

    {

    something();

    }

    void main(void)

    {

    enableInterrupts();

    CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);

    UART3_DeInit();

    UART3_Init((u32)9600, UART3_WORDLENGTH_8D, UART3_STOPBITS_1,UART3_PARITY_NO, UART3_MODE_TXRX_ENABLE);

    UART3_ITConfig(UART3_IT_RXNE_OR, ENABLE);

    UART3_ITConfig(UART3_IT_TXE,ENABLE);

    while (1);

    }

    I wrote down the necessary header files which were specified in readme.txt in the UART3-Hyperterminal-Interrupt directory , at the begining of my source file . What do I miss ? What am I doing wrong ? Please help. Thanks.

    [ This message was edited by: acgtysr on 15-04-2009 15:12 ]

    [ This message was edited by: acgtysr on 15-04-2009 15:26 ]

    acgtysrAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    okay I solved that problem. After your instructions , i was able to make it work. Thanks for your help.

    best regards

    acgtysrAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    First of all thanks for your interest, I did exactly what you said but while compiling RIDE brought out a fail. Fail is such as this ;

    Copyright (c) Raisonance S.A.S. 1987-2009. All rights reserved

    ***ERROR 100 : UNRESOLVED EXTERNAL

    SYMBOL : ?assert_failed(Project)

    LINK/LOCATE RUN COMPLETE, 1 ERROR FOUND.

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:02

    Hi,

    Firstly, It seems that you use an old version for the stm8s firmware library because the USART3 examples are deleted from the library. You can download the new Library from this link:

    http://www.st.com/products/support/micro/files/stm8sfwlib.zip

    You can refer to UART1_Interrupt in the library, This example provides a basic communication between UART1 and UART3 using interrupts.

    To make the example work with RIDE you should do the following update in the RIDE project properties: update the type for small enum variables char by int (project\properties\Compiler option\code generation\type for small enum variables\int)

    Let me know if have solved your issue

    Regards

    mozra