SAMD21 and manchester encoding

Hello, I'm using an Arduino Uno to communicate with a peripheral using manchester encoding with a bit rate of 1kbps. For wi-fi connectivity needs I would like to use a Nano 33 IOT. Is it possible to use SERCOM for manchester coding? The frame has a fixed length of 4 bytes plus the start and stop bits. Unfortunately I only found guides to use SPI and I2C instead of serial...

I don't think so, but that's after all of 3 minutes of research.

During which time I learned that the Nano 33 IOT steps along pretty briskly, and there are libraries and explanations of variuos ways to produce the data stream.

I have done it using plain code, without any interrupts or peripherals. I expect these days that use of interrupts and counter-timer capabilities of the Nano would make it fairly straightforward.

Try a few minutes with google, I just

arduino manchester encoding

Can you link or post the exact specifications of the receiving device? In my case it was for RF transmission and the packet included a long string of zeroes as training data.

HTH

a7

here you can find the specification of the opentherm protocol, on page 16 there are the time specifications.

Currently an ISR triggered by a timer counter is used on the arduino uno and by adapting the library a bit I was able to replicate the same operation with the SAMD21.

But from what I understand with the use of SERCOM you could get higher performance with less work

A search of the SAMD21's .pdf data sheet produced no mention of term "manchester". So it doesn't look promising.

You say you have it working, what would constitute higher performance?

And if it is functioning now, seems like you've done the work… :expressionless:

a7

A manchester encoder can be implemented with a single external XOR gate, from an SPI signal. On newer Atmel and Microchip parts, you can do this internally using the CCL peripheral (but this feature is not available on SAMD21.)

Decoding is more complicated.

See: Microchip's Manchester Code - YouTube

Thanks for your attention, the symbols generated by my Arduino are not timed as correctly as those generated by the remote. On paper, it should be better to outsource these jobs to peripherals when possible

With the Logic Analyzer I tried to use the SPI interface and the comparison is embarrassing :sweat_smile: but unfortunately I think it is not possible to get a 2 kHz signal because of the 48 MHz clock.

Do you know any Arduino equipped with a CCL peripheral?

Adafruit has some SAMD51 boards (which does have a CCL. I haven't checked whether it would work out for generating a manchester serial signal.)

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.