Differential Manchester decoding hints needed  - Page 1
Forum section: electronics / projects

author: beduino
author_rank: Regular Contributor
timestamp: January 16, 2019, 11:02:34 pm
content: Hello,I'm looking for some hints howto decode Differential Manchester (alternative) since encoding is easy using any MPU/CPU described for example here:https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/Differential_Manchester_encoding.html"Differential Manchester encoding Scheme is a line code in which data and clock signals are combined to form a single 2-level self-synchronizing data stream. It is a differential encoding, using the presence or absence of transitions to indicate logical value. It is not necessary to know the polarity of the sent signal since the information is not kept in the actual values of the voltage but in their change: in other words it does not matter whether a logical 1 or 0 is received, but only whether the polarity is the same or different from the previous value; this makes synchronization easier."I'm working on some kind of customized Differential Manchester protocol with CRC bits automatically expanded to byte as two additional bits with additional optional encryption at clock between 10kHz-100kHz since not too much data needed to exchange using 1 wire aka I2C with additional pull up to VCC.There are many examples howto encode Differential Manchester, but not too many hints howto decode on MPU/CPUI've marked in yellow in attached image Differential Manchester (alternative) which I'd like to encode (easy) and decode in software or maybe using USI hardware on AVR MPU with digital I/O pin externally pull up to Vcc,so similar like in I2C, MPU pin in state output low or input high impedance via pull up to VCC logic one.Thanks in advance for any ideas

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 17, 2019, 12:02:18 am
content: You can use look-up tables for encoding and decoding.A reasonable compromise for MCUs is a look-up table for 4-bit nibbles. Each entry is double that (thus 8-bit). The resulting look-up table will be 256 items encoding a 4-bit nibble.For differential Manchester, you can negate the signal depending on the initial state and thus use only one look-up table as well.Much faster than a loop with tests to determine each resulting bit, especially on small/slow MCUs.

author: beduino
author_rank: Regular Contributor
timestamp: January 17, 2019, 08:54:03 am
content: Quote from: SiliconWizard on January 17, 2019, 12:02:18 amThanksThat is interesting - it looks like patent exists for such approach US20110158310A1 - Decoding data using lookup tableshttps://patents.google.com/patent/US20110158310- application by "Nvidia Corp" around 10 years ago

author: SiliconWizard
author_rank: Super Contributor
timestamp: January 17, 2019, 03:20:20 pm
content: Quote from: beduino on January 17, 2019, 08:54:03 amThanks for pointing this out... I used this approach in a project around 10 years ago. That wasn't patented back then although I'll have to check the exact date of my project.The little fuckers... I didn't think of patenting this back then, as I thought it was a pretty "obvious" approach...