Generate AX. 25 Modem signals with a PIC.


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2007
    Posts
    6

    Question Generate AX. 25 Modem signals with a PIC.

    Hi All,

    Can you please help me to generate AX 25 protocol with a PIC.

    How do you generate the 1200 Hz and 2200 Hz frequencies and the data out on a port with R2R ladder on 4 bits?

    I am busy building a Packet Radio modem for HAM use. Packet Radio / APRS Transmissions.

    I am a licenced Radio HAM and use PBP.

    Thanks my Friends

    Pic Toy

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic Toy View Post
    Hi All,
    Can you please help me to generate AX 25 protocol with a PIC.
    How do you generate the 1200 Hz and 2200 Hz frequencies and the data out on a port with R2R ladder on 4 bits?
    I am busy building a Packet Radio modem for HAM use. Packet Radio / APRS Transmissions.
    I am a licenced Radio HAM and use PBP.
    Thanks my Friends
    Pic Toy
    FREQOUT...it's all in the manual...but then that's only a one-bit output. Put a filter on the output that's good enough and you shouldn't need a 4 bit ladder...

    (Yep...I said it...the manual...unless of course you don't have a manual...)

  3. #3
    Join Date
    Sep 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    Hi Skimask,

    Thanks for your reply. I have used Freqout in the past to create tones with the simple filter , but how do I convert serial data into an audio signal, D-A conversion? not sure what and how to send it to 4 bits on eg. PortB.0 to PortB.3 with R2R D-A?

    I bought PBP many years back from MeLabs and updates from local distributor.

    BR
    Pic Toy

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic Toy View Post
    Hi Skimask,

    Thanks for your reply. I have used Freqout in the past to create tones with the simple filter , but how do I convert serial data into an audio signal, D-A conversion? not sure what and how to send it to 4 bits on eg. PortB.0 to PortB.3 with R2R D-A?

    I bought PBP many years back from MeLabs and updates from local distributor.

    BR
    Pic Toy
    XR2206?

    I just looked at the spec's for AX.25...
    Good luck with that...

  5. #5
    Join Date
    Sep 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    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

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic Toy View Post
    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?

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    So what you're saying is...
    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...

  8. #8
    Join Date
    Sep 2007
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    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

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Pic Toy View Post
    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
    Better idea...You write some code...and if it doesn't work, I'm sure a dozen people will help you troubleshoot it, 'cause here's my example code...

    main:
    if serial_pin = 1 then
    freqout 1,1,2200
    else
    freqout 1,1,1200
    endif
    goto main

Similar Threads

  1. Interface Pic --> Max232 --> GSM Modem
    By SangkiMangki in forum GSM
    Replies: 1
    Last Post: - 28th September 2013, 12:57
  2. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  3. Replies: 2
    Last Post: - 12th September 2007, 08:08
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. No Modem response
    By jimboho in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 11th November 2004, 05:58

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts