I'm a beginner. Looking for the most efficient way to continually loop, monitoring an input for one of four possible patterns as shown in the attached file. I need to jump to a different subroutine for each pattern.
I'm using GCB with a 16F1829 and a PicKit 3 and LPC Demo Board.
Thanks, that does give me some ideas. I don't really need to measure the waveforms, just discriminate between them. One thing I didn't mention is that this is a micropower application, so I am using 32kHZ clock and many configs turned off. Is it possible to change configuration items inline with GCB code? For instance, turning on comparator function for a few milliseconds to monitor a signal, then turning it back off to reduce current drain.
I hope my question makes sense.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you've got to decide whether to monitor the duty cycle using a gated timer. Or you count the number of pulses in a fixed time period (has to be > 10s to capture the slow one).
Either way timer1 is probably the way to go and counting the pulses may work in SLEEP if you want to keep the current down.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm a beginner. Looking for the most efficient way to continually loop, monitoring an input for one of four possible patterns as shown in the attached file. I need to jump to a different subroutine for each pattern.
I'm using GCB with a 16F1829 and a PicKit 3 and LPC Demo Board.
You should read http://ww1.microchip.com/downloads/en/appnotes/01473a.pdf this will give you some insights. Once you have digested the pdf then post again.
Select-Case may be answer but the pdf will help you determine the strategy.
Thanks, that does give me some ideas. I don't really need to measure the waveforms, just discriminate between them. One thing I didn't mention is that this is a micropower application, so I am using 32kHZ clock and many configs turned off. Is it possible to change configuration items inline with GCB code? For instance, turning on comparator function for a few milliseconds to monitor a signal, then turning it back off to reduce current drain.
I hope my question makes sense.
I think you've got to decide whether to monitor the duty cycle using a gated timer. Or you count the number of pulses in a fixed time period (has to be > 10s to capture the slow one).
Either way timer1 is probably the way to go and counting the pulses may work in SLEEP if you want to keep the current down.