AX.25 bit encoding for packet radio TNC

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need information about AX.25 bit encoding for packet radio transmission using a TNC.

My understanding is the actual data bits are sent asynchronously, which requires the data to be segmented into groups with a start bit and stop bit for each group.

The problem is when AX.25 bit stuffing adds extra zero bits to the data. For a simplified example: when sending 16 bits of data with 1 stuffed bit added for a total of 17 bits in the Tx bit stream, how are these bits sent in an asynchronous format delimited by start and stop bits?

If the original 16 bits of data are segmented into 8 bit bytes it would look like this:
start bit – 8 bits of data - stop bit, start bit – 8 bits of data - stop bit

After bit stuffing how would the 17 bits look?
start bit – 9 bits of data - stop bit, start bit – 8 bits of data - stop bit
Because of the variable 8/9 bit length an AVR USART would not decode this format.
Or would it use fixed 8 bit lengths with the 17th data bit in a third 8 bit byte (with the left over 7 bits discarded as padding)?

However the bits are sent, I understand its the receiver's job to remove any stuff bits and restore the original data from within the unique flag byte boundaries.

The demodulation of the FSK tones will be handled by a Bell 202 chip and logic levels are fed to an AVR chip. I want to know if I can use the hardware USART with a fixed word length or if I have to use a software UART that can deal with variable length words.

I have found AX.25, TNC and packet specifications on the web, but I can not find anything that goes deeply enough into the actual physical layer data encoding to answer this question.

I would also like to know if NRZ or NRZI bit coding is used for HAM packet.

Thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Contact me off-list at ka7ehk@yahoo.com. I am working on a very similar project. I can help with a lot, but not all the details. For example, you can't (easily) use the UART because there are no start and stop bits in the data; everyone bit-bangs some port pin.

Jim, KA7EHK

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Fri. Sep 9, 2005 - 08:48 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey Jim... dont those TNCs us Zilog SCC 8530 uarts? The datasheet for the uart has a detailed chapter on the SDLC mode and the bitstuffing.....

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Some do and some don't use the Zilog SCC. There have been (at least) two successful ax.25 implementations without SCC in AVR (and I have the files for both) and there are several PIC sources (also have files).

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Jim,
I've searched for TNC and found this thread.
Can you please post the links of those implementations for the AVR.

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will look for them. One is for a regular list member and most of the others have gone away. I do have some archive copies, however. There is also a lot of PIC code on the TAPR website. Its not hard to translate as it is pretty well commented. Contact me with a "personal message" on this board, and I can send things to you.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess I might be the regular list member that Jim is referring to. Hi.

My TNC projects are located here:
http://users.rcn.com/carlott/projects.html

I've not really looked at that stuff in a while. Encoding is pretty easy. There are other projects out there coded in C that might be a little easier to understand / port.

Oddly enough, The AVR project I'm working right now has a zilog z85230 SCC to talk to some legacy SDLC equipment. Comm rate is a little high for bit banging, although I was tempted for a second.

The Zilog SCC manual is a good resource to help understand synchronous links. Explanations of NRZ/NRZI, bit stuffing, DPLLs, and all sorts of related materials. A good read.

-carl

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Carl is the very one! Thanks. Your project is the only AVR-based packet project I can currently find on the internet.

I do have an archive from one or more other projects and can send copies if provided an address.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey,

Check out the WhereAVR project. I've got some code I modifed from that...

Regards,

-Colin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
My TNC projects are located here:
http://users.rcn.com/carlott/pro...

Great projects there Carl! :)
My cousin is a ham and I keep trying to get him interested in these little AVRs... your website may help :)

Hi ka7ehk :)

Your avatar photo is VERY distinguished looking!
You should be in the movies :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Gwen -

I'd rather put together great AVR projects, hi hi.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank u.. carl.. i try it..