Tool/software:
Shanghai Quectel's MSPM0L1306 is experiencing a program runaway issue due to frequent changes in multiple GPIOs, triggered by group interrupt detection. Please provide some suggestions to resolve this issue. Thank you!
The customer is unable to provide the code, only the following requirements:
Conditions: There are two periodic electrical signal levels from the outside, with a period of 5ms, and the proportion of high and low levels is usually 3:2 or 4:1.
Requirements: The program should perform different branch processes based on the combination of the two external electrical signal levels (00, 01, 10, 11). It should also control the opening or closing of other GPIOs.
Solution: Use PA5 and PA11 to monitor the electrical level changes of the two external signals. Enable GPIOA interrupt, and the interrupt trigger condition is either rising or falling edge. In the interrupt service routine, read the Pins to determine which PA5 or PA11 triggered the interrupt, and set the corresponding flag. In the main function, check whether both flags are set.
Dilemma: Generally, two GPIOA interrupts need to be monitored to determine the external signal combination and enter the correct branch process. This process is time-consuming and cannot cover the 5ms cycle of the external signal.
What are some suggestions for optimizing the program process, or are there any other solutions to recognize and respond to external signal combination changes?