Author Topic: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?  (Read 11452 times)

0 Members and 3 Guests are viewing this topic.

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #25 on: July 01, 2019, 06:36:16 pm »
It is relatively easy to separate your devices into two different RS-485 networks. A simple MCU in the middle will work as a bridge: will re-transmit the data from "Master" to the "Slave" and back introducing necessary delays. All you need is a single MCU and two RS-485 transceivers.

Pay attention to what the slave's MCU stands for. Most of time this device transmits values which gets from its A/D, the faster the better.
Simple I faced with trouble at the beginning while parameterization of that device (distorted response). That's the point.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #26 on: July 01, 2019, 06:43:39 pm »
Pay attention to what the slave's MCU stands for. Most of time this device transmits values which gets from its A/D, the faster the better.
Simple I faced with trouble at the beginning while parameterization of that device (distorted response). That's the point.

Re-transmission will not decrease throughput, only will add some latency.

Your scope shots don't look very fast. What's you baud rate?
 

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #27 on: July 01, 2019, 06:53:37 pm »
Re-transmission will not decrease throughput, only will add some latency.

Your scope shots don't look very fast. What's you baud rate?

Still, there's no need. I have to fix parametarization first. So it is used 19200. However I'm stuck at this phase. 

Also please take a look at slave's homemade el.diagram attached. The output part.

BR
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #28 on: July 01, 2019, 07:50:19 pm »
So it is used 19200. However I'm stuck at this phase. 

This is not fast.

Also please take a look at slave's homemade el.diagram attached. The output part.

Very strange design. The left part looks like TTL to RS-232 level translator and then the RS-232 is passed to the right part, which appears to be an RS-485 transceiver. It is not clear why they didn't use the RS-485 transceiver capable of working with CMOS levels directly. If the rest of the device is designed this way, perhaps you'd be better off re-designing the whole device from scratch.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 5826
  • Country: dk
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #29 on: July 01, 2019, 08:38:27 pm »
Re-transmission will not decrease throughput, only will add some latency.

Your scope shots don't look very fast. What's you baud rate?

Still, there's no need. I have to fix parametarization first. So it is used 19200. However I'm stuck at this phase. 

Also please take a look at slave's homemade el.diagram attached. The output part.

BR

wait what? that is just wrong, from ttl to rs232 and then some resistors to make work with a ttl level transciever
I assume they swapped A/B to get the data polarity right, but why?
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10090
  • Country: us
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #30 on: July 01, 2019, 09:49:55 pm »
The transmitter should release the bus and the previous receiver should stay off the bus for about 1 bit time.  1ms at 9600 baud.
This is the bus turn-around time.

http://www.ti.com/lit/wp/spry265/spry265.pdf

It is likely that the line control signals are generated in code and depending on processor speed and interrupt handling, this won't be very precise.  Unfortunately, the receiver that is about to become the transmitter has no way of knowing that the previous transmitter is hanging onto the bus.

One way of handling bus contention is to listen to what you are sending.  If there is a mismatch, a collision has occurred and the transmission should be aborted and the entire packet resent.

Given that you don't have control of the software on either end, you're in a jam.

I would show the scope traces to the manufacturer that messed up the transmitter code.

If you have a working unit, compare the traces...
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3390
  • Country: au
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #31 on: July 01, 2019, 10:20:42 pm »
The master has a set of parameterization command (baudrate, parity, 7 or 8 bit frame, one or two stop bits).
The slave has less parameters. I tried different baud rates. No success. That's not a root issue.

Can the link work at 7 bits ? You could try that ?
TX looks a bit slow releasing the bus, but is in idle state at that time. Problem, is, an early-active fights that late-idle.
If you cannot get into the boards, and have to make something work, a possible work around would be to OR wire the RS485, which means you drive active with diodes, and pull passively to idle.
(that's how CAN bus works, it is differential, but avoids this dual-driver contention by only pulling one way)

A diode in parallel with a moderate resistor (maybe 1K) allows the resistor to pass the RX direction, but not pass so much of TX
That means overlaps of idles are ignored, only actives matter and in this case, you are ok from the scope display.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3390
  • Country: au
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #32 on: July 01, 2019, 10:23:22 pm »
Also please take a look at slave's homemade el.diagram attached. The output part.
How much of that circuit is inside the manufactured unit, and how much is added on outside (by you?)
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #33 on: July 01, 2019, 11:01:44 pm »
A diode in parallel with a moderate resistor (maybe 1K) allows the resistor to pass the RX direction, but not pass so much of TX
That means overlaps of idles are ignored, only actives matter and in this case, you are ok from the scope display.

I don't think you can improve the situation by tweaking the bus. With 90% probability, the first transmitter doesn't listen to the bus until the bus is released. Therefore, what happens on the bus during the hold is of no consequence. In fact, OP does get half-decent signal from the second transmitter while the bus is held by the first transmitter (see his animation), but this doesn't solve the problem.
 

Online langwadt

  • Super Contributor
  • ***
  • Posts: 5826
  • Country: dk
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #34 on: July 01, 2019, 11:26:23 pm »
A diode in parallel with a moderate resistor (maybe 1K) allows the resistor to pass the RX direction, but not pass so much of TX
That means overlaps of idles are ignored, only actives matter and in this case, you are ok from the scope display.

I don't think you can improve the situation by tweaking the bus. With 90% probability, the first transmitter doesn't listen to the bus until the bus is released. Therefore, what happens on the bus during the hold is of no consequence. In fact, OP does get half-decent signal from the second transmitter while the bus is held by the first transmitter (see his animation), but this doesn't solve the problem.

yeh with /RE and DE tied together, only delaying the slave data will work
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3390
  • Country: au
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #35 on: July 02, 2019, 01:01:29 am »
yeh with /RE and DE tied together, only delaying the slave data will work
It depends from the #1 which is the slave node. The scope captures show the master in that test is the errant one. (slow master release)

I don't think you can improve the situation by tweaking the bus. With 90% probability, the first transmitter doesn't listen to the bus until the bus is released. Therefore, what happens on the bus during the hold is of no consequence.
Maybe.. easier to test than to guess. The OP sounds like he has limited options....
 

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #36 on: July 02, 2019, 01:59:32 am »

Very strange design. The left part looks like TTL to RS-232 level translator and then the RS-232 is passed to the right part, which appears to be an RS-485 transceiver. It is not clear why they didn't use the RS-485 transceiver capable of working with CMOS levels directly. If the rest of the device is designed this way, perhaps you'd be better off re-designing the whole device from scratch.

It's so designed to provide the customer different variants of communication, such as pure RS232 and RS485 (half-duplex).

BR
 

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #37 on: July 02, 2019, 02:02:29 am »
How much of that circuit is inside the manufactured unit, and how much is added on outside (by you?)

I changed and added nothing there at all. Everything in original state.
« Last Edit: July 02, 2019, 02:18:05 am by CiscERsang »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #38 on: July 02, 2019, 03:18:14 am »
It's so designed to provide the customer different variants of communication, such as pure RS232 and RS485 (half-duplex).

How big is the rest of the board? If it is not too complex, may be you can make your own.

You certainly can try to modify it. Say, you can try to replace the RS-232 translator with a pin-compatible MCU which re-transmits the data with a delay. But it is all manual work. I don't think it would be worth it unless you have very low quantity.

IMHO, if you want to keep the old board then an external re-transmitter is the only option.
 

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #39 on: July 02, 2019, 04:53:07 pm »
How big is the rest of the board? If it is not too complex, may be you can make your own.
The small sub-PCB 15x10 comprises MCU with belongings and MAX232. The base-PCB comprises RS-485 driver and power supply.
Yes, I can keep the sub-PCB and newly rebuild the base PCB. It's possible, thus I get so-called OEM-device.


You certainly can try to modify it. Say, you can try to replace the RS-232 translator with a pin-compatible MCU which re-transmits the data with a delay. But it is all manual work. I don't think it would be worth it unless you have very low quantity.
IMHO, if you want to keep the old board then an external re-transmitter is the only option.

You know this is small part of project of automation. We and our partners acquired some components for testing in this project. We paid money for completed devices which are produced serially.
   In this area, as a rule of thumb, all used components mustn't be OEM. Also, it's supposed to be maintained by local personnel. That means that the customer will be able to purchase and replace faulty, e.g. master or slave, by itself. That's a two-way street, so to speak.

Btw, what IC will be able to play a role of a delay (200us, for example)? Do we have IC with such option, available on the market?

BR
« Last Edit: July 03, 2019, 04:54:59 am by CiscERsang »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #40 on: July 02, 2019, 05:13:10 pm »
Btw, what IC will be able to play a role of a delay (200us, for example)? Do we have IC with such option, available on the market?

There are special delay lines ICs, however I'm not sure there are any which can produce such huge delays as 200 us.

I would just use a simple MCU. All you need it to do is read from one UART port and pass the byte to another UART port - this will produce reasonable delays automatically. It also need to maintain DE line during writes, which is also very easy. Any MCU with enough pins (and preferably one or two UART modules) can do this.

Or, perhaps, if you tell the vendor that you will only buy their devices if they add a delay option, they may cave in.
 
The following users thanked this post: CiscERsang

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3390
  • Country: au
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #41 on: July 03, 2019, 12:39:09 am »
Btw, what IC will be able to play a role of a delay (200us, for example)? Do we have IC with such option, available on the market?
A small MCU with 2 uarts would give a point solution. (not so easy to change baud, * char quantized delays, so ~ 520us at 19200 )
At low baud rates, a small MCU with software delay line could also work, or if you want to avoid any code, a HEF4557 1-to-64 Bit Variable Length Shift Register is an IC.
200us at 19k2 is  3.84 bit times , sampling ~10 times per bit, needs ~38 bits of storage, and a 192khz clock.
 
The following users thanked this post: CiscERsang

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #42 on: July 03, 2019, 04:39:17 pm »
Guys, I don't know exactly which way this slave operates.
so, there are doubts on:
  • for example, so-called interactive mode when parameterizing. A programm command query <-> corresponding reply. Here, nothing bad will happen, due to this is just interractive mode;
  • Since it's primarily A/D, it must broadcast its values in real time or very close to it. So, I don't know whether an implemented delay will undermine that ability or not, while broadcasting.
hope I expressed a thought understandable.

BR
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 3390
  • Country: au
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #43 on: July 03, 2019, 07:42:50 pm »
Guys, I don't know exactly which way this slave operates.
so, there are doubts on:
  • for example, so-called interactive mode when parameterizing. A programm command query <-> corresponding reply. Here, nothing bad will happen, due to this is just interractive mode;
Is that a question, or an operating observation ?

  • Since it's primarily A/D, it must broadcast its values in real time or very close to it. So, I don't know whether an implemented delay will undermine that ability or not, while broadcasting.
That' why you would make the delay as small as is needed to fix the issue.
You mentioned slave HW, do you have access to the master HW, or will you modify every slave  ?

Did you try all the supported baud choices, in case there was a sweet spot ?
 

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #44 on: July 04, 2019, 07:02:16 am »
Is that a question, or an operating observation ?
just observation.


That' why you would make the delay as small as is needed to fix the issue.
You mentioned slave HW, do you have access to the master HW, or will you modify every slave  ?
Yes, I agree, the most reasonable way is modification of MAster, by means of firmware alteration or HW, if possible.

As concerned Master's HW: There are difficulties there too. Unfortunately its PCB is designed not the way when you have an easy access to both sides of PCB. :-- I was able to get an access to one side only.
To get an access to another side requires a desoldering of quite long PCB connector (as it is shown below).

As concerned Master's shematics:
As it turned out, it is quite well designed in terms of safety. When I saw MAX845 on accessible side, a first thought was, both, master and slave are using similar IC types.
But no such luck, The MAX845 I found wasn't a driver that is connected directly to AB lines. As it turned out, it plays role of a driver for special power supply which ensures an isolation from differential line.

So, I still can't even take traces from DI, DE leads of true transmitter. Also I failed to find at least an example sheme where there are participants such as an isolation transformer (HALO), its driver, and transmission driver.

BR









 
« Last Edit: July 04, 2019, 07:06:11 am by CiscERsang »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3567
  • Country: ca
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #45 on: July 04, 2019, 01:27:35 pm »
Even if you don't want to design your own, perhaps you can buy a different board from a different vendor, or a different flavour, such as CAN?

I bet these board are sold for exuberant price. You pay them big money so that everything works out of the box. And it doesn't.

You certainly confused their support teams when you represented the delay as some sort of jitter. Try again. Be more specific. Tell to the master's support that their device holds the bus for too long. Tell to the slave's support that their device responds too fast. Make them work for your money.
 
The following users thanked this post: CiscERsang

Offline CiscERsangTopic starter

  • Regular Contributor
  • *
  • Posts: 119
  • Country: za
Re: MCU, signal jitter within a range of 0,1..0,2ms. Is it acceptable?
« Reply #46 on: July 05, 2019, 04:21:59 am »
Even if you don't want to design your own, perhaps you can buy a different board from a different vendor, or a different flavour, such as CAN?
That's the point, we can't.

I bet these board are sold for exuberant price. You pay them big money so that everything works out of the box. And it doesn't.
Of course this not a board from Aliexpress or ebay.


You certainly confused their support teams when you represented the delay as some sort of jitter. Try again. Be more specific. Tell to the master's support that their device holds the bus for too long. Tell to the slave's support that their device responds too fast. Make them work for your money.
No, I presented them the issue not as a jitter. I just sent them bus collision traces and wrote that the Master holds line too long and slaves response too fast and I need either service parameter or FW alterations. There wasn't any word about jitter or so. :)

I was amazed, when they asked how much we are going to buy for the future projects.  :palm: I doubt that my mail was forwarded to true developers/engineers. it was just seller, having nothing to do with bits, frames, traces and so forth.

My idea if they consider us as a big enough client we will get the green light. That may mean FW update and so on. I know how it works. :-DD

BR
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->