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 ]
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:
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