FSK demodulator in firmware
I have what looks to be a 1.6/3.2kHz FSK signal that I'd like to demodulate to a bitstream using a suitable PIC.
It's a two wire system with bursts of the FSK signal riding on top of the DC supply, so no carrier like with radio.
Never dealt with FSK signal before so asking if anyone has done anything like this using PBP?
I'm thinking of using the ZeroCrossingDetector peripheral together with a timer or two. Either just polling the ZCD Out bit and start/stop the timer(s) or possibly tie it in to the timer gate or go the interrupt route. Being such a low frequency signal I think polling will be more than adequate to get started.
The goal, for now, is "just" to get the signal into a digital bitstream that I can then capture with a logic analyzer. I know this is analog domain stuff, PLL's and such but when all you've got is a hammer (PBP in this case)....
Re: FSK demodulator in firmware
Although it is a low frequency, still a zero cross happens every 156.2 usec for the 3.2KHz signal.
Will the pic be fast enough to process that signal? I am sure ZCD and timers will be enough, but then you have to do some work in less than that period.
Ioannis
Re: FSK demodulator in firmware
Plenty fast, I'd say.
At 32MHz an instruction cycle is 125ns. That's ~1250 cycles between zero crossings.
I'm not trying to interpret/decode the data, just demodulate the signal.
Every other zero crossing, grab timer value, do some comparison, flip a bit (or not), reset/restart timer. My gut feeling says we should be able to do that in less than 100 instructions - even with PBP compiled code but we'll see.
What's "bothering me" is the fact the line is idle for extended periods of time meaning there's no zero crossing and timer will overflow/wrap around. I'll need to detect that.