8E1 Serial with Basic Stamps
I'm trying to communicate with an industrial Pressure/Level sensor with serial communication parameters of 8E1 (8 Bits, Even Parity, 1 Stop Bit). I'd like to use a basic stamp to poll and process the data from the sensor but it seems the serout/serin command can not handle 8 bits and even parity. Has anyone been able to make a stamp communicate with 8E1 settings? If so, can you share your solution?
Thanks
Thanks

Comments
data |= ((data<<1)^(data<<2)^(data<<3)^(data<<4)^(data<<5)^(data<<6)^(data<<7)^(data<<8))&$100
Post Edited (Mike Green) : 12/19/2009 12:31:28 AM GMT
PUB rx: rxByte | t {{ Receive a byte; blocks caller until byte received. }} if rxOkay dira[noparse][[/noparse]sin]~ ' make rx pin an input waitpeq(inverted & |< sin, |< sin, 0) ' wait for start bit t := cnt + bitTime >> 1 ' sync + 1/2 bit repeat 9 ' ***** waitcnt(t += bitTime) ' wait for middle of bit rxByte := ina[noparse][[/noparse]sin] << 8 | rxByte >> 1 ' sample bit ***** waitcnt(t + bitTime) ' allow for stop bit rxByte ^= inverted & $1FF ' adjust for mode ***** rxByte &= $FF ' strip off received parity ***** PUB tx(txByte) | t {{ Transmit a byte with even parity; blocks caller until byte transmitted. }} txByte |= ((txByte<<1)^(txByte<<2)^(txByte<<3)^(txByte<<4)^(txByte<<5)^(txByte<<6)^(txByte<<7)^(txByte<<8))&$100 if txOkay outa[noparse][[/noparse]sout] := !inverted ' set idle state dira[noparse][[/noparse]sout]~~ ' make tx pin an output txByte := ((txByte | $200) << 2) ^ inverted ' add stop bit, set mode ***** t := cnt ' sync repeat 11 ' start + eight data bits + even parity + stop ***** waitcnt(t += bitTime) ' wait bit time outa[noparse][[/noparse]sout] := (txByte >>= 1) & 1 ' output bit (true mode) if sout == sin dira[noparse][[/noparse]sout]~ ' release to pull-up/pull-downThis is actually off-topic for this BASIC Stamp forum. If you have any questions or comments further on this, please start a new thread in the Propeller forum. Thanks.
Post Edited (Mike Green) : 12/19/2009 12:36:01 AM GMT