Other Parts Discussed in Thread: MSP430G2231
Hello! I just wanna begin by saying how much I am loving the msp430 Launchpad! Its a very versatile learning tool. I am okay at programming hardware and have had some experience with the launchpad, tinkering with it my self. However I have run into a problem:
I am trying to develop a code that accepts input through one of the general purpose I/O pins( specifically a set of two inputs spaced apart at a particular time interval) and outputs a logic high at another pin to drive a transistor circuit (external) if the duration between two input signals has met a predetermined requirement.
At first I though of sampling a particular channel through the ADC10. I set up the code but I saw that it consistently sampled(even in sample once mode) an input pin and even the slightest physical touch triggered a voltage detection. So that solution was of the door.
Second one was to access the capture of the TimerA in msp430g2231. The pseudo code i have developed is :
1- Wait for an external trigger to start the capture
2- wait for another external trigger to stop the capture
3- check the difference of the two captures
4- IF the difference has met the predetermined requirement, then output high on a pin
5- IF NOT, then begin from step 1 again, till the requirement has been met
A point to mention is that I am not going to be feeding a particular waveform for that matter. Its just going to be a voltage level held a particular value for 1 sec and then drop down to zero. This should trigger the capture for timer A. The second signal, like the first one, should do the same.
Is this do-able or am I looking in the wrong direction? Thanks in advance for looking and trying to help!!! :)