Manchester Encoding

Making your program work.
Posts: 1
Joined: Sun Jun 28, 2009 11:17 pm

Manchester Encoding

Post by manfre »

I'm trying to use a Chipcap digital humidity sensor (datasheet .pdf) and have been unable to decode the signal. Is there existing code examples out there for decoding a manchester signal with an arduino?

Format for RH is 1x Start Bit (cycle 50% low, 50% high), 8x data bits, 1x parity bit.

I've tried to use decode using interrupts and a real time approach. Both have left me with garbage data that does not consistently validate against the parity bit.

Interrupt approach:

Attach a falling interrupt 0 to the RH data line. The interrupt stores the time of the fall and sets a flag. loop() checks the flag and then calculates the time till the rise and clears the flag. A fast rise (~30% cycle) means 1, a slow rise (>50%) means 0.

Realtime approach:

Power the chip and then wait for the line to go high. Wait for the drop and time until the rise. Then wait until the drop and delay the time diff to get a bit reading.

Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: Manchester Encoding

Post by oz »

Maybe search for
"avr manchester encoding"

Here's one hit I got ... g/#more-63

Hopefully the translation won't be too painful - and you may get lucky and it will run out of the box.


Post Reply