Yes I can use the XR2206 or even the FX604 or FX614, guys are doing it all with one single 16F84 and 16F628.
BR
Pic Toy
Yes I can use the XR2206 or even the FX604 or FX614, guys are doing it all with one single 16F84 and 16F628.
BR
Pic Toy
So what you're saying is...(gotta see if I'm getting this right or not)...
A serial line input....regular ol' RS232 type serial data type stuff...
4 bit ladder output....Port D0-D3 for example...
Serial input is low, output on 4 bit ladder is effectively a 'sine' wave at 1200hz...
Serial input is high, output on 4 bit ladder is a 'sine' wave at 2200hz?
Standard ol' Bell202 (was it the 202?) modem type stuff yes?
So I did a bit of thinking...and this might be the hard way to go about it...if my earlier post was correct in the way I was thinking about the issue at hand......
Build up 2 tables, one table contains values for a 4 bit sine wave at 1200 hz, one table contains value for a 4 bit sine wave at 2200 hz. Should be easy enough in Excel or whatever. And these tables only have to be long enough to produce a complete sine wave (or a half or a quarter sine wave, depending on how math savvy you are).
Sounds simple enough...But these tables would have to be synchronized to produce those frequencies at a known sample rate, in this case, 19531.25hz, which just happens to be 20Mhz (oscillator) / 4 (instruction rate) / 256 ( timer 0 overflow interrupt). I.E. 16.276 samples would be one complete sine wave at 1200hz, 8.8778 samples for one complete sine wave at 2200hz. So you can see that you'd need a table long enough to get something where the table would end at a nice 'stopping point' for each sine wave before starting over again.
On each Timer 0 overflow interrupt...
-If the serial input line is low, you step thru table 1 (1200hz) lookup values and output those on your R2R ladder port bits...
-If the serial input line is high, you step thru table 2 (2200 hz) lookup values and output those on your R2R ladder port bits...
One problem I see is the transition between the 2 frequencies when the serial input line changes. You could possibly go from the top of one phase of one freq to the bottom of another phase of the other freq...thereby generating crazy harmonics that the detectors at the other end might not like, or then again, they may not care and filter them out (likely the case).
I suppose if you had a good enough filter on the PIC pin output, you could just shift out 1's and 0's to approximate the freq's, or just use the FREQOUT command in a really tight loop. Maybe define'ing the OSC to a different value than what you're actually using to get faster ONMS times and changing the frequency depending on the ratio of Fosc vs. what you're actually running the PIC at. For example...
DEFINE OSC 4 (while running the PIC at 4Mhz)
FREQOUT pin, 1, 1200 would give you 1ms of 1200hz
but...
DEFINE OSC 4 (while actually running the PIC at 20Mhz)
FREQOUT pin, 1, 6000 would actually give you .2ms of 1200hz
This way you could sample the serial line every .2ms (or just a hair over that). As long as you weren't running over 4800 baud, this method MIGHT work.
I doubt it, but it's an idea I had running thru my head...
Thanks Skimask for the explanation !!
I need some guidence my friend like sample code. I never did it this way.
I will receive GPS info serial in on a pin and have to send it out "voice" (AX.25 Protocol) into a radio's mic.
BR
P T
Bookmarks