AnsweredAssumed Answered

STM8L152C6T6 USART1 interrupt probelm

Question asked by verma.sushil on Jan 12, 2015
Hi , i am unable to transfer and receive data from usart1 using interrupt. I used polling method to transfer and receive data from usart1 and it is working OK. ( Tx and Rx are Shorted)
I am using STVD and Cosmic compiler to run the codes. My problem is that , with the below codes when i used enableinterrupt(); function , control is stuck somewhere and it not return to main loop .
So can you please tell us where is the problem. Also i am not able to run any interrupts too.

Codes are

     /* Select HSI as system clock source */
     #ifdef USE_HSI
          /* Select 2MHz HSE as system clock source */


 CLK_PeripheralClockConfig(CLK_Peripheral_USART1, ENABLE);      
 USART_ClockInit(USART1,USART_Clock_Enable,USART_CPOL_Low, USART_CPHA_1Edge,USART_LastBit_Disable); 

and in Interrupt handler file codes is below to write 1 in he lcd if interrupt executes.

/* In order to detect unexpected events during development,
   it is recommended to set a breakpoint on the following instruction.
  //while (1);
  LCD_WRITE("1 ");