Author Topic: CH32V003 interrupt worked  (Read 1242 times)

0 Members and 1 Guest are viewing this topic.

Offline SajeevTopic starter

  • Contributor
  • Posts: 34
  • Country: in
CH32V003 interrupt worked
« on: July 23, 2023, 05:10:31 pm »
Hi forum members,
Greetings of the day!
I am new to this forum and a hobbyist.
I lost sleep last week trying to setup EXTI interrupt on CH32V003. Everything was very confusing and the reference manual doesnt describe things clearly. My interrupt would either get stuck inside the ISR or will never continue with the main program on return. After multiple attempts i found that enabling nesting and hardware stacking in CSR  INTSYSCR 0x804 was causing all the issue. Its better to keep the CSR 0x804 untouched and perform a 15 register push and pop in the ISR. Then the program works fine. I tried EXTI0 from PD0 and also tried software triggered version of the same and found working. Please find attached the assembly program and header files. I assembled the program on BRONZEBEARD assembler and uploaded with WCHELINK. Posted here so someone may benefit. I dont know C
Regards
Sajeev


 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->