Author Topic: Differential Manchester decoding hints needed  (Read 2519 times)

0 Members and 1 Guest are viewing this topic.

Offline beduinoTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: 00
Differential Manchester decoding hints needed
« on: January 16, 2019, 11:02:34 pm »
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/CPU  :-BROKE

I'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 ;)
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: Differential Manchester decoding hints needed
« Reply #1 on: January 17, 2019, 12:02:18 am »
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.
 

Offline beduinoTopic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: 00
Re: Differential Manchester decoding hints needed
« Reply #2 on: January 17, 2019, 08:54:03 am »
You can use look-up tables for encoding and decoding.
Thanks  :-+
That is interesting - it looks like patent exists for such approach  US20110158310A1 - Decoding data using lookup tables
https://patents.google.com/patent/US20110158310  - application by "Nvidia Corp" around 10 years ago  ;)

 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: Differential Manchester decoding hints needed
« Reply #3 on: January 17, 2019, 03:20:20 pm »
That is interesting - it looks like patent exists for such approach  US20110158310A1 - Decoding data using lookup tables
https://patents.google.com/patent/US20110158310  - application by "Nvidia Corp" around 10 years ago  ;)

Thanks 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...

 
The following users thanked this post: ivan747


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf