Please refer to above circuit.
I have a SIM900A module connected with the UART of a PIC. D1 toggles every second, using timer interrupt, to indicate that while loop is running satisfactorily. D2 toggles only when switch changes its state. "PORTB Interrupt on Change" is used to detect change in state of switch.
The circuit works correctly but as soon as a minute elapses and SMS is sent D2 toggles a number of times and multiple SMSs are sent instead of one indicating change in state of switch. This behavior is observed only when the switch is in closed state before sending SMS.
The problem cannot be of de-bouncing since if switch is closed initially before powering up the circuit and it remains in the same state before first minute even then the same problem is encountered.
The circuit works fine with a veroboard but started creating problems when I went to a PCB design.
What could be the possible reason and solution for this problem?
The above circuit is just part of the whole circuit.
U2 and U7 are voltage regulator but only one is used at a time. U2 is for 7805 and U7 is for LT1084. Only one of them is soldered.
RV1 and RV2 are potentiometers connected with output of two comparators of LM324(U6). RV3 is connected with LT1084 to adjust output voltage in case of using LT1084.
RSMD on the right side of board is 12mohm resistor.
U5 is MAX232.RL1 is a 5V relay and Q1 is a transistor. D2 is voltage reference for ADC while SW1 is a DIP switch to enable or disable the use of voltage reference.