PDA

View Full Version : Specific Area Message Encoding (S.A.M.E.)



Ryan7777
- 29th November 2008, 19:02
Any one know of any posts regarding the decoding of S.A.M.E. messages? or if you can help more in depth please let me know.
I guess posts on FSK or AFSK would be helpful as well.
I figure i'll need a f-V converter and to use an analog input. Any tips on how to massage the data once its in the PIC?
I looked for some posts and didn't come up with much.

Anyway

Thanks ahead of time!

Archangel
- 29th November 2008, 19:54
Google.
http://www.weather.gov/nwr/nwrsame.htm
http://www.bookrags.com/wiki/Specific_Area_Message_Encoding

Ryan7777
- 2nd December 2008, 16:08
I kind of already know that much info, its just the baud rate stuff and other things that are making my head hurt. 520.83 BAUD and no Stop bit seems to rule out using serin or hserin, correct me if im wrong and make fun of me if you wish. I was simply going to handle the 2083.3 HZ Mark tone 1562.5Hz Space tones with a couple of 567 tone decoders and a comparator. That would at least get me some TTL 1's and 0's to work with. But im lost on how to handle the data as far as timing goes. If it were 9600 8n1 i'd have no trouble decoding it.
Any idea's?

mackrackit
- 2nd December 2008, 18:37
I think in this case
baud would equal bps.

Archangel
- 2nd December 2008, 20:14
. . . and make fun of me if you wish . . . . Oh hell no, 1st off not my style, second off, you're probably better at this than I am.

Ryan7777
- 3rd December 2008, 11:35
But some people round here can't seem to help themselves when it comes to a little slap over the head. I don't mind, sometimes I need it. I think I'll let this post lay for a while and see if anyone has any advice. But I'm thinking SHIFTIN might work, then i'll have to figure out a way to clock in and count the number of incoming bits or bytes. The preamble alone is 16 bytes of $AB repeating. Then the message itself, which is what i want to decode, can be up to 268 bytes long. but it is supposed to always start with ASCII ZCZC to let you know the message is starting, then wait for "NNNN" which is the end of the message. Everything is delimited with a "dash", so it shouldn't be so hard to break the message down. I've never worked with SHIFTIN before, and know nothing of interupts, so if anyone has any advice or a better way, let me know!

mackrackit
- 4th December 2008, 04:02
It most times gets me in trouble... but I have been thinking. :o

8N0 sounds like synchronous, so would a PIC with USART work?
Mister E's multicalc give this for 520.83 baud.


DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 20h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 255 ' 520.83 Baud @ 20MHz, 134.43%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically


And...being 1 STOP bit is a signal going from low to high, and the last bit of SAME is always 0
would that look like a STOP bit?

If I did my math correctly...
SERIN2 MODES
520.83 baud in TRUE mode is
1900
520.83 baud in INVERTED mode is
5996

Maybe someone with a BRAIN will correct me :)

Ryan7777
- 4th December 2008, 16:41
Though the magic green book didn’t seem to say much on how to get from true mode to inverted with its (1000000 / baud) – 20 equation, like how to get the extra bits in there? Anyway, the 8N0 thing is really what bothers me, does it even need a stop bit? If it does I do know that each bit is supposed to be 1.92mS wide but don’t really know what I’d do there, I figure it would have to be something external to the PIC or at least the HSERIN command. I realized that shiftin’s clock pin is an output, and I’d need it to be a clock in to be useful. It looks like a USART will work with Slave mode as long as it will let me do the odd baud and I can figure out a way around no stop bit..

fronkensteen
- 4th December 2008, 18:14
Though the magic green book didn’t seem to say much on how to get from true mode to inverted with its (1000000 / baud) – 20 equation, like how to get the extra bits in there?
It sure does!!!
Look for the phrase "Bit 14 selects inverted or true level"

Ryan7777
- 4th December 2008, 20:18
So where does bit 14 fit into 1000000? or are we looking at the last 7 bits of 14? and please SOMEONE who can offer some "on the topic" advice chime in?

fronkensteen
- 4th December 2008, 21:14
So where does bit 14 fit into 1000000? or are we looking at the last 7 bits of 14? and please SOMEONE who can offer some "on the topic" advice chime in?

You're right. I don't have a clue. Or do I?
Was I 'On Topic' or not?
You be the judge...

From the book-

Mode is used to specify the baud rate and operating parameters of the
serial transfer. The low order 13 bits select the baud rate. Bit 13 selects
parity or no parity. Bit 14 selects inverted or true level. Bit 15 is not
used.
The baud rate bits specify the bit time in microseconds - 20. To find the
value for a given baud rate, use the equation:
(1000000 / baud) - 20
See those references to Bit 13, Bit 14, Bit 15?
Do you still think that the MODE parameter used with SERIN2/SEROUT2 is limited to 8 bits?

So, if you want this 520.83 baud (1,000,000 / baud = 1920.x) - 20 = 1900 = %0000 0111 0110 1100, to work with 'true levels', you have the number already. If you want it to work with 'inverted levels', you set bit 14, just like the book says. %0000 0111 0110 1100 becomes % 0100 0111 0110 1100.

Sorry. Am I still 'Off-Topic'?

mackrackit
- 4th December 2008, 22:24
So where does bit 14 fit into 1000000?
It does not. 1000000 is only 7 bits long :D

please SOMEONE who can offer some "on the topic" advice chime in?
I thought the Brain guy was on topic. You asked a question and you were told where to find the answer.

Maybe this will help
http://www.picbasic.co.uk/forum/showpost.php?p=60804&postcount=10

At this point I would say to hook it up and play with it.

falingtrea
- 5th December 2008, 18:57
Because I am totally clueless on this, I had to ask. Is this the audio stuff they when broadcast when testing the alert system on TV?

mackrackit
- 5th December 2008, 19:07
There is digital stuff along with the transmission.
http://www.weather.gov/nwr/same.htm
Tells a little about it.