Shop OBEX P1 Docs P2 Docs Learn Events
towards a P2 PLC - Page 15 — Parallax Forums

towards a P2 PLC

191011121315»

Comments

  • evanhevanh Posts: 16,508

    Rayman,
    I like your approach with the wire pairs. However, running power down a long cable will give you grief unless there is independent reference for the data wires. Relying on the supply return for the reference gets problematic due to power delivery volt droop. And the thin wires of RJ type cables feels that effect in short order.

    Basically you need as a minimum real differential signalling that can operate above and below the power rail and ground respectively. The most rugged approach is isolated signalling like transformer coupled, ie the same as Ethernet, or optocouplers. You can't just have the Prop2 pins direct to the socket.

    So once going down that path you may as well support a higher supply voltage to boot. Keep it open ended to allow 50 Volts or so.

  • evanhevanh Posts: 16,508
    edited 2025-05-30 13:54

    The alternative is change the +5 Volt wires into two more GND, don't have power on the cable. That would allow a much longer cable without needing special interface.

    EDIT: I guess it does depend on actual power consumption at the load end. If it's only a few mA then I'm probably overreacting.

  • RaymanRayman Posts: 15,233

    @evanh Well, for differential signaling, the other way is better for sure. But, not foreseeing doing that.
    Things needed for me are TTL serial, I2C, SPI and stuff like that, over short distances.

    For long distances, one can use actual ethernet...

    Power is something to thing about though... Right now, just using ~10 mA tops. But, was contemplating adding a Nextion display. That will eat power for sure with the backlight...

  • evanhevanh Posts: 16,508

    Short cable will be okay with a lot more current. The problem with using RJ45 sockets is it's very easy to use any old long Ethernet cable.

    The risk of reflections doing damage to logic pins probably goes up with length too.

  • RaymanRayman Posts: 15,233

    Suppose reflections are possible... If end of cable is open, suppose could get a 6.6 V back at P2.
    But, that'd be if P2 side were open. But, cable impedance is 100 Ohms and P2 output impedance is 20 Ohms when driven normally.
    So, think overvoltage would be minimal...

  • evanhevanh Posts: 16,508
    edited 2025-05-30 23:55

    It's around 120 ohms for 3.3 Volt DAC drive. Using BitDAC mode will likely be smoother than Fast logic drive.

    wrpin(<pin>, P_DAC_124R_3V | P_BITDAC | ($f0<<8))
    

    BitDAC also provides option to select reduced high-low voltage drive between VIO (3.3 V) and GIO (0 V) of: 0.22, 0.44, 0.66, 0.88, 1.10, 1.32, 1.54, 1.76, 1.98, 2.20, 2.42, 2.64, 2.86, 3.08 Volts. I dunno how useful it is but it's there.

  • RaymanRayman Posts: 15,233

    Still protection diodes should prevent damage from 100 ohm source

  • evanhevanh Posts: 16,508
    edited 2025-05-31 00:52

    I did belatedly add some protection to my last project that was already using RS485 transceivers.

    It wasn't intended for signal integrity though, it was spike/surge protection. We had an incident, before adding any protection, where the 24 Volts ended up on the data lines which then destroyed all the ICs due to back feeding lifting the 3.3 V power rail up to 24 Volts.
    The data thermistors are PTC, which ensures the zenors won't cook with 24 V on the data wires. And it is only 9600 baud so no imperative to get top speed from the transceiver.

  • evanhevanh Posts: 16,508
    edited 2025-05-31 01:02

    It's not easy to do this type of protection for logic chips. The zenors are rated for 5 volts but will go higher before clamping hard. That's fine for the transceiver chip as it's designed for the data pins to swing further than the rails.

    It wouldn't be so easy to make the zenors work for data pins directly on logic chips like the Prop2. And using regular diodes to clamp to the 3.3 V rail just creates a back feed path. Such protection is already present inside the logic chips.

  • evanhevanh Posts: 16,508
    edited 2025-05-31 01:40

    Oh, not so difficult if not worried about surges from bad wiring. Put the zenors on the other side of the resistors. The resistors then allow the data wires to go a little further beyond the rails, giving the zenors more clamping headroom.

  • evanhevanh Posts: 16,508

    It was also common to use mini filters on logic data lines like this too. I remember them on parallel and joystick ports from the 1980s.

  • @evanh said:
    It wasn't intended for signal integrity though, it was spike/surge protection. We had an incident, before adding any protection, where the 24 Volts ended up on the data lines which then destroyed all the ICs due to back feeding lifting the 3.3 V power rail up to 24 Volts.
    The data thermistors are PTC, which ensures the zenors won't cook with 24 V on the data wires. And it is only 9600 baud so no imperative to get top speed from the transceiver.

    RJ45 cables are really handy. I use them for almost everything where twisted pair cables make sense.

    • blue: PC ethernet
    • yellow: step/direction
    • green: encoder (ABZ differential)
    • black: MODBUS (RS485)

    It's a good idea to choose the pinout in a way that at least inserting a plug in the wrong socket doesn't burn something. This is usually met if no more than +5V is on any pin, all sources are short-circuit protected and all sinks are 5V tolerant. With a little extra effort you can make the transceivers +24V-proof (see #429) but that's not possible in all cases.

    For a +5V output you can add a reverse protection diode and increase the voltage regulator output to 5.6V. This way accidentally connecting +24V doesn't backfeed into the 5V bus blowing everything up.

    Exercise: Find the propeller(s)

  • evanhevanh Posts: 16,508
    edited 2025-05-31 16:53

    Looks like there is two Prop2 ICs. So you're actually using the RMII interface then? That still impresses me. Not just pulling off raw Ethernet that way but following through with IP and UDP and the likes.

Sign In or Register to comment.