PDA

View Full Version : Strange serial input format to code ... suggestions please



Chuck D.
05-19-2006, 03:04 AM
I've been working with the BS2 for a few months and am working up a prototype of a bridge between two common marine electronics communications protocols: SeaTalk and NMEA-0183.

Per a reference on SeaTalk at http://www.thomasknauf.de/rap/seatalk1.htm#Ser, SeaTalk transmits
11 bits for each character:

# 1 Start bit (high)
# 8 Data Bits (least significant bit transmitted first)
# 1 Command bit, set on the first character of each datagram. Reflected in the parity bit of most UARTs. Not compatible with NMEA0183 but well suited for the multiprocessor communications mode of 8051-family microcontrollers (bit SM2 in SCON set).
# 1 Stop bit (low)

I'm curious if anyone has attempted to recieve and/or transmit characters with such non-standard data transmission schemes, whether reading and writing such characters is possible with SERIN/SEROUT (or something else), and if so, HOW??

Mike Green
05-19-2006, 03:49 AM
The Stamp series of devices can only handle 8 bit serial data. The MAX3110 UART is from Maxim, connects to the Stamp via an SPI interface and can handle 8 bits + parity. Have a look at its datasheet.

allanlane5
05-19-2006, 08:09 AM
Well, what you're describing was created by the 8051 and compatible chips. It's basically 10 bit RS-232 -- where the 9th bit is 'set' to indicate the associated byte is an 'address' byte. The 8051 had built-in hardware that would generate an interrupt on that "9th bit", so the chip could safely ignore the non-address bytes (or pay attention to them if it HAD recieved the right address byte).

But no, the BS2 is pretty limited in its RS-232 byte interpretation. 8N1, or 7E1 (8-data, no parity, 1 stop bit), (7-data, even parity, 1 stop bit). Okay, with inter-byte delays you can add 'stop' bits, but that's about it.

Typically one would use a co-processor programmed for the right protocol to recieve this.

Chuck D.
05-19-2006, 06:59 PM
Thank you for the replies ... the background info and recommendation on the MAX3110 are useful.

stamptrol
05-19-2006, 07:44 PM
Some recent experience with another "weird" protocol makes me want to try feeding that signal into the stamp set at 8N1.

My incoming signal was 8Odd1 and the stamp just seems to ignore the parity bit and correctly decode the data.

As long as that Command bit doesn't do anything, you should be able to get the data.

Cheers

Gadgetman
05-19-2006, 08:47 PM
You may want to look at either the SX/B or the Propeller as these are much more flexible.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...