Attiny416 for rs-422 adressing routing?

Go To Last Post
25 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, im brand new to using AVR to be honest and want to know if what i need to do is possible and have some pointer on how to do it. Then i will be able to learn from there and work on my project.I know its a weird way to learn but its how im able to do it.

 

So my board would work like this:

1. Receive 4 differential signal feed to a  AM26C32 ( Quadruple Differential Line Receive) to convert then back to serial. 

2. The 4 serial signal are ws2811 data (with added header for adressing) feed to the attiny416 that would read the header and output the data to a pin if the header match what is set via dip switches on this board.

3. if data dont match it just ignor it.

 

so basicly its used for device adressing and one device have 4 independant signal that will have same adress.

 

I know it is possible since i try to make a device compatible with something that alredy exist and work.

 

I hope you can understand what i want to make but if not ask me question since my native langua is french and some time its hard to explain things like this for me.

 

 

N00B learning!

Last Edited: Tue. Mar 30, 2021 - 05:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Welcome AVRFreaks!

 

pr0cess0r wrote:
i try to make a device compatible with something that alredy exist and work.

It may help if we knew what this device is?  Link?

pr0cess0r wrote:
im brand new to using AVR to be honest and want to know if what i need to do is possible and have some pointer on how to do it.

So what have you done using AVR's? or any other micros?

 

This may not be a good beginner project!

 

Jim

 

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pr0cess0r wrote:
im brand new to using AVR

welcome to AVR!

 

Do you have any experience with any other microcontroller(s) ?

 

Receive 4 differential signal feed to a  AM26C32 ( Quadruple Differential Line Receive) to convert then back to serial

Not sure what you mean by that - they are already "serial" ?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


What you describe sounds like a multiplexer or am I missing something? (I probably am, in that case please show us a scheme explaining what you want in more detail. One picture is worth 1000 words, as they say...)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The OP writes about "RS422" and about "serial". These are two totally different animals.

 

RS422 defines one of a fairly large set of serial hardware standards. RS232, RS422, and RS485 are three out of a fairly large list. They define things like voltage levels, number of devices on a "channel" and such. These standards say nothing about baud rates, character sets, message formats and such. The data that is transported by these is ALL serial.

 

I suspect that the OP is referring to the logic level (also known - not particularly correctly - as "TTL") asynchronous serial input and output of a UART as "serial". 

 

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

Last Edited: Tue. Mar 30, 2021 - 04:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok so the led controller output a signal using the WS2811 protocol. For led strip that a far from the controller we use differential line driver (AM26C31 and AM26C32 pair) to keep data integrety.

 

One differential receiver will receive 4 differential pair and basicly it extend 4 ports on the controller to 4 remote ports that are Independent.

 

Then come the smart differentiel receiver! At the software side if you enable this then you will have 3 set of ports designed by A-B-C. This allow to send different effect two those 12 ports.

 

So the software will add headers to the ws2811 signal to tell the receiver what ID this data id for.

 

So here come the attiny416 it receive 4 idependent data stream and if the header match the ID set with the dip switches and it output it to the led DI pin.

 

The 4 signal are idependent.

 

so if you have 3 smart receover they will be adressed  A-B-C with the dip switches and all be connected to the same ethernet cable. (here is the rs-422 part i guess)

 

Here is the hardware that alredy do it https://www.pixelcontroller.com/...

Here is some info when they added the feature for smart differential receivers https://github.com/FalconChristm...

 

I dont know exactly how it is presented into the data stream but will ask them.

 

As for other mcu project i play with esp32 esp8266 in arduino and platform IO with WLED and ESPIXELSTICK but im not a programmer. 

 

I need to start to understand how it can be done then i will get the dev board and start testing it with lots of frustration and fail!

 

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I get it now. Ok, the tiny416, using the event system and the CLL can indeed switch 4 digital signals (actually since there are 3x EVOUT and 2x LUT out it could switch up to 5 signals). Once the switch is ON the signal will just pass with no software intervention (no CPU load).

 

But it will need some time to decode the headers from 4 signals and turn the necessary switches ON/OFF, so it all depends on the complexity of the address header and the timings involved in that protocol.

 

My feeling is that it should be possible.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you sure that it's actually the  WS2811 protocol that's being sent over the differential pairs?

 

Or could it be just the necessary data encoded in some more "conventional" way ... ?

 

pr0cess0r wrote:
I dont know exactly how it is presented into the data stream

You certainly need to know that!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

El Tangas wrote:
CLL

You mean CCL ?

 

https://www.avrfreaks.net/commen...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

True, if it's encoded I very much doubt any AVR could handle the decoding of 4 channels.

 

awneil wrote:
You mean CCL ?

 

Yes, mistyped.

Last Edited: Tue. Mar 30, 2021 - 05:25 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Im sure its the WS2811 signal since i made my own board with other software connected to their receiver and it work! minus the smart part! So on this im 100% sure since differential out or direct local ports can be interchanged with no software change and also there is dump receiver that only have the am26C and a 75hct125 nothing else that can run software.

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, so the first thing you need is to obtain the header signal protocol.

 

Edit: maybe it will need to be reverse engineered? Time to put your logic analyser to work.

Last Edited: Tue. Mar 30, 2021 - 05:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So to be clear it alredy exist and use attiny416 since i have one in hand and looked at it.

 

There is differential receiver wiithout the attiny and the smart receiver with the attiny and they work the same if set to NORMAL mode.  There is 4 way to set those dip switches so 3 adresses or normal.

 

So i know it alredy exist and work just want to learn how to do it myself because im building my own differential receivers boards and would like to add this feature. The attony also allow for a test mode where it will generate signal to the 4 output to test the leds are working.

 

here is a picture of the small baord i made to connect esp32 ethernet module and have 4 ports over differential lines.

 

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I asked the guy that unserstood how it work and add it to falcon pi player for is kulp boards. I hope he will share the info with me ... else it is in the opensource software code on git hub.

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok if you are following this.

 

I did not get any answer yet but from thinking non stop im guess i finally understand how its done and make sense to make it easy on a not so powerfull mcu.

 

They have 4 differential wires connected to GPIOs on the controller side.

 

They trigger a state on those 4 wires that tell the attiny to listen for what id data is aimed at.

 

Then they trigger high or low those 4 pins to tell what adress need to play the data comming.

 

then they tell the attiny to go back to led adata mode and the attiny have those 4 switches on or off depending on the ID.

 

It do this all the time very fast so no need for the attony to decode the WS2811 stream and the WS2811 stream is not altered at all.

 

I think it hold low the 4 pins to tell it will send ID data then use a coniation of high and low pins then hold 4 pins low to return to led data. 

 

This make sense with what i understood of the falcon pi player source code that manage the smart receiver part.

 

What do you think about this ?

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pr0cess0r wrote:
I think it hold low the 4 pins to tell it will send ID data then use a combination of high and low pins then hold 4 pins low to return to led data.

(...)

What do you think about this ?

 

I think the process you mentioned makes general sense. But details are still missing: hold low for how long? Or it's just the falling edge enough? The address data comes after how much time? The address data is held for how long? What is the address format?

You need to know this in detail to write your firmware.

 

That's why I mentioned you need to use a logic analyser to capture the process.

Last Edited: Wed. Mar 31, 2021 - 03:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will get/build a logic analyzer when i have some time to get those info! There is a free design based on freescale that i alredy have so will try this!

 

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It would be better if you could get a proper description of the format - otherwise you never know if there's some special/unusual case that you don't happen to have seen.

 

Or, in fact, if all you've seen is a special/unusual case ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok so I got this!
The signal is 800khz.

So it is oscillate at 800khz for 180us for ID one and 360us for id two and 540 for id.

It hold it low 180us before and after it set Id.

I don’t know if attiny416 can decode 4 800khs stream at the same time in real time but I doubt it.

If this signal is read slower would it be possible to detect low for 180us and high for 180us.

Attachment(s): 

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pr0cess0r wrote:
I don’t know if attiny416 can decode 4 800khs stream at the same time in real time but I doubt it.

I doubt it too.

 

But you said:

pr0cess0r wrote:
So to be clear it alredy exist and use attiny416 since i have one in hand and looked at it.

 

Therefore it's possible. Are you sure all the 4 data lines can have individual addresses?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes I’m 100% sure it work with attiny416. I think that they are independent a ce same sequence you could use or not those smart receivers and the controller cannot change timing so all 4 channels would be in the same state at the same time.

If attiny is too slow. This signal that is mostly high if you look at the capture i shared. Can a slower capture be able to see it as 1 or 0 and count how long it is . So the code would detect low for 180us to know it must count how much time it’s high before going low for 180us again. So it don’t have to decode anything of the signal.

Don’t know if it make sense how I explain it?! Now I have to see how to code this and try it!

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1


I'm trying to help you but you sure don't make the job easy. Let's see, you showed me this:

 

 

From your text, I' guessing SR1 and SR2 are the address header and PIX is the data. Is that right?

 

Then you say the header is "800 kHz" and "mostly high". I'm guessing this means it's a PWM wave with duty cycle > 50%, because I surely can't figure it out from such low res image.

 

Then, there are 4 data lines but the trace only shows one. I can't guess which one; there is no information in the trace saying  line1, line2, line3, line4 or something similar. Anyway, I have 25% information, am I supposed to guess the other 75%?

 

 

 

 

Yes, your trace shows an overview of the signal, but I'd also like to see the details, and what is going on in the other channels at the same moment, like in this random example:

 

 

In this example, note that the SPI SCLK signal blocks seem "mostly high" also, but we know it's not; it's 50% PWM (square wave). We can't tell because the resolution is not enough.

 

 

So please provide better information, I can't see what you see, I can't experiment or measure, I don't have your device. Only the information you post here.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First of all thank you for your help. I know I don’t have lots of information and work to get more information.

I did not do this trace and will try to make my own trace with 4 channels.

But I know they are all independent since I can disconnect any of those line and the remaining will work.

Sr1 call smart receiver 1 and sr2 smart receiver 2.

The sr1 and sr2 part are all 1 in ws2811 protocol. The 180us low is not in ws2811 protocol it is just low.

- One is indicated by: .8us high, .45us low

So what I think is that if you lower the capture résolution and read it as on and off and count the time it’s on and off would it make sense?

So when it read completely low it know it have to be ready to count the high time and when it get low again it know it must just let data pass.

I see it has doing it at electrical level not the protocol level does it make sense.

To me i see it has a way to do it with low power mcu.

N00B learning!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

pr0cess0r wrote:
The sr1 and sr2 part are all 1 in ws2811 protocol.

 

How can you possibly know that? Certainly not from that low resolution picture. Therefore, you still have more information you don't share.

And what is "PIX"?

 

pr0cess0r wrote:
- One is indicated by: .8us high, .45us low

 

Yes I know the protocol. We often discuss it in this forum.

 

pr0cess0r wrote:
The 180us low is not in ws2811 protocol it is just low.

Wrong. A LOW longer than 50us is part of the protocol and means "reset - new data will be incoming next".

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, im back with more info and now its clear to me. All is based on source code of FPP that manage those smart différentiel receivers base on what is setup on the web interface. 

 

here is the source code that is intesting. https://github.com/FalconChristm...

 

Line 33 34 35 define how many pixel datas is used for the differential receiver trigger and id communication)   its 6*3   so 6 led of 3 channels RGB.  so its 6 x 24 bit = 144 but  of data and it say it it use all white at 100% brightsness so it is  all 1 and in ws2811 protocol 1 = 1.25uS.

 

144*1.25=180uS.

 

Then at line 54 to 74 it set a new variable  toggleCount = SMART_RECEIVER_LEN*2 ( this is for id two so it will be 2*180uS).

 

At line 319 you see how it use the leadin togglecount and les out.

 

and yes PIX on the signal capture is the actual led data that the led will receive.

 

 

So here is how i understand it now.

 

1.The 4 pin need to be able to read the signal that is ws2811 signal and low signal.

2.We need to be able to decode the signal at binary level no need to turn it back to numbers.

3.When it detect low for 180uS its toggle the switch off (so the channel id data wont turn led on) and set a counter to count the number on 1 it get in ws2811 format then depending on the number of 1 24/48/72 it know the ID 1/2/3.

4. it compare id to the id variable in momery from the dip switched. 

5. if the ID match it toggle the switch on the you have the PIX data that is not looked at because is not in listen mode.

6. it does this on the 4 input at the same time.

 

since it dont have to decode the signal to actually reproduce led pwm signal but only need to read the binary i guess its does not need lots of power.

 

So now i must find how to do this in the code i guess but now i really think it make sense.

N00B learning!