Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 02:39 06 Jul 2020 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Spa Controller

     Page 1 of 2    
Author Message
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1651
Posted: 02:15am 28 Nov 2019
Copy link to clipboard 
Print this post

Hi All,

Been running my Spa Controller for a few years on an E28 Backpack which had all pins used.

Plan on upgrading it to an E-100.
(Arrived last week Grog. ).

Because of the pin shortage I built a second MM on Vero board & mounted it in the heat pump I repurposed from a hot water system.


All that one does is monitor 5 thermistors & a flow meter, sends the data back to an E64 over a 433MHz link when polled, which then sends out data packets to 2 other E100's also on 433.

With the extra pins available on the E100, I could run the thermistors there, but would prefer not to be cabling the analogue sensors an extra 2 or so meters.

The Flow meter I will move & add a second.

ATM the one in the heat pump outputs the data on Com1 to a HC-11.

If I decided to connect the Com port of that MM directly to the new E100, would TTL serial levels over 2 metres of so be too much?

If so what would be the simplest module to add to the Com ports at each end for reliable coms between the two.


Thanks

Phil.
Edited 2019-11-28 12:17 by Phil23
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 3407
Posted: 06:58am 28 Nov 2019
Copy link to clipboard 
Print this post

2M should be OK but I tend to use RS485 modules now-a-days to be sure.

Jim
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
 
PeterB
Guru

Joined: 05/02/2015
Location: Australia
Posts: 484
Posted: 10:03am 28 Nov 2019
Copy link to clipboard 
Print this post

G'Day Phil & Jim
I agree RS485 is good stuff. This problem got well and truly discussed some time ago when AndrewG (I think) had a similar problem.

Peter
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 11:10am 28 Nov 2019
Copy link to clipboard 
Print this post

Doesn't sound like full duplex is required but a couple of MAX491s would do the trick and they are virtually plug and play.

In my case, I always want the master to be able to talk to the slaves, even if a slave is in the middle of responding. So the E100 TX line is dedicated. The RX is a shared response line. At 2m, I probably wouldn't bother with biasing or terminating.

Regards,

Craig
Edited 2019-11-28 21:11 by Tinine
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 727
Posted: 02:59pm 28 Nov 2019
Copy link to clipboard 
Print this post

I can't say that I've tested extensively, but I have run MMBasic serial output over 50' of Cat5/6 cable without issues, with moderately complex VT100 screen formatting.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1651
Posted: 08:17pm 28 Nov 2019
Copy link to clipboard 
Print this post

  TassyJim said  2M should be OK but I tend to use RS485 modules now-a-days to be sure.

Jim


Think I've probably got a few more of these somewhere.
Currently using one on another MM to read the 3 Eastron Modbus power meters.

Suitable?

Can't remember how the A-B-Gnd bit went & recall a termination resistor on the furtherest meter.

Think that module has it's own from memory, 120ohm?





Phil.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1651
Posted: 08:50pm 28 Nov 2019
Copy link to clipboard 
Print this post

Also got a few of these at the time,





https://core-electronics.com.au/ttl-uart-to-rs485-converter-module.html

Think I used the others for some reason relating to the Auto transmit/Receive function of the HW-0519.

https://www.sunrom.com/p/rs485-ttl-module-with-protection-auto-transmit/receive switching

Don't think I ever got my head around head the use the others with Modbus slaves.

Or the pinout requirements.

DI, DE, RE, RO.

Phil.
 
Turbo46
Guru

Joined: 24/12/2017
Location: Australia
Posts: 507
Posted: 01:15am 29 Nov 2019
Copy link to clipboard 
Print this post

Phil
This may help

RO (Receiver Output)  Connects to a serial RX pin.
RE (Receiver Enable)  Active LOW.  Drive LOW to enable the receiver.
DE (Driver Enable)  Active  HIGH.  Typically jumpered to RE Pin.
DI (Driver Input)  Connects to serial TX pin.

The 120 ohm resistor R7: If using in a multi-drop configuration, the modules on the two ends of the line should keep these resistors.  Modules in the middle of the line should have these resistors removed to prevent loading the lines too heavily. The signal wires should be a twisted pair, shielded for long runs and there should be a common ground.

Vcc is 5v but mine run quite happily at 3.3v

The Micromite can supply a DE signal (connect DE to RE) but it is the wrong sense (see the manual). Rather than use that pin and an inverter I use an output pin to supply the DE signal, set it high to transmit the message, then, after the message has been sent, set it low to enable reception. Apart from that it is treated as though it is a normal RS232 device.

Bill
Keep safe. Live long and prosper.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 3407
Posted: 02:26am 29 Nov 2019
Copy link to clipboard 
Print this post

I actually use these RS422 modules so that they are plug and play and handle full duplex so I can load programs easily.



Jim
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1651
Posted: 05:16am 29 Nov 2019
Copy link to clipboard 
Print this post

  Turbo46 said  The Micromite can supply a DE signal (connect DE to RE) but it is the wrong sense (see the manual). Rather than use that pin and an inverter I use an output pin to supply the DE signal


So Basically this....

  Quote  Setpin 7, Dout

OPEN "COM1:9600" AS #5 ‘ open the first serial port with a speed of 9600 baud
Pin(7)=1
PRINT #5, "Hello" ‘ send the string "Hello" out of the serial port
dat$ =
INPUT$(20, #5) ‘ get up to 20 characters from the serial port
Pin(7)=0
CLOSE #5 ‘ close the serial port



Phil.
 
Turbo46
Guru

Joined: 24/12/2017
Location: Australia
Posts: 507
Posted: 05:38am 29 Nov 2019
Copy link to clipboard 
Print this post

Yes, but the trap is that you have to wait until the entire message has been sent before lowering the 'DE' pin (and closing the port). For example:

  Quote  ' Send the Response message
SUB TxMsg
 
PIN(DE) = 1
 TXD$ = TXD$ + CRC16$(TXD$)
 
PRINT #1, TXD$;
 
DO: LOOP UNTIL LOF(#1) = 256: PAUSE 20' Wait til message sent
 PIN(DE) = 0
END SUB


Geoff has changed the behaviour of the CLOSE command in later versions of MMBasic so a CLOSE will not occur while a message is still being sent but lowering the 'DE' must wait.

Bill
Keep safe. Live long and prosper.
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 05:58am 29 Nov 2019
Copy link to clipboard 
Print this post

I don't believe that those modules require the DE signal, do they?

I believe that they do it automatically when sensing a TX.

If you go one-to-one with full duplex on something like MAX491s, you simply tie the DE pins high. This way, it's no different to using TTL RX & TX but now you have differential transceivers.

Regards,

Craig

Edit: Referring to TassyJim's module.
Edited 2019-11-29 16:11 by Tinine
 
Turbo46
Guru

Joined: 24/12/2017
Location: Australia
Posts: 507
Posted: 06:18am 29 Nov 2019
Copy link to clipboard 
Print this post

The one in Phil's second photo uses the MAX485. This is the one to which I was referring. Here is the circuit.




There are no smarts. you need to control the transmit/receive switching.

I believe the one in the first photo does do it automatically.

Bill
Keep safe. Live long and prosper.
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 06:47am 29 Nov 2019
Copy link to clipboard 
Print this post

Ah, maybe it's because TassyJim's appear to be using the MAX490 which don't have enables.
From what I can make out, this means that the devices can never go into low power mode(?).

Probably more of an issue with battery powered devices. Not an issue in my case so I might try some MAX490s, next time around.

Regards

Craig
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 3407
Posted: 08:12pm 29 Nov 2019
Copy link to clipboard 
Print this post

  Tinine said  Ah, maybe it's because TassyJim's appear to be using the MAX490 which don't have enables.
From what I can make out, this means that the devices can never go into low power mode(?).

Probably more of an issue with battery powered devices. Not an issue in my case so I might try some MAX490s, next time around.

Regards

Craig

The ones I am using are very good for one to one but not much use for multidrop where you need to put the transmitters into high Z.

Jim
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 12:53pm 30 Nov 2019
Copy link to clipboard 
Print this post

Auto Enable





Cheers,

Craig
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 12:59pm 30 Nov 2019
Copy link to clipboard 
Print this post

 
Turbo46
Guru

Joined: 24/12/2017
Location: Australia
Posts: 507
Posted: 09:25pm 30 Nov 2019
Copy link to clipboard 
Print this post

If I am understanding the above circuit correctly, the driver IC is only enabled when the Serial Out (Tx) pin is low and disabled when it is high (plus a short delay caused by the R/C circuit). As it says "a driver is enabled for only an average of half the time required to transmit a word".

If the data was 'FF' Hex, the driver would be only enabled for the START bit and disabled for the rest of the word except for a short pulse at the beginning or the first '1' bit. The RS485 A/B signal lines would be tri-state for every '1' bit transmitted.

Surely this arrangement would be highly susceptible to noise? If it works at all I can't see how it would work reliably - especially over long distances. The board shown in Phil23's first photo is a little more complex.

Not explained above is that the two Schmidt trigger gates in series with the Tx and Rx lines will add a little propagation delay to the signals so that little (if any) of the START and other '0' bits are lost.

Please correct me if I am wrong.

Bill
Keep safe. Live long and prosper.
 
Phil23
Guru

Joined: 27/03/2016
Location: Australia
Posts: 1651
Posted: 12:40am 01 Dec 2019
Copy link to clipboard 
Print this post

  Tinine said  I don't believe that those modules require the DE signal, do they?

I believe that they do it automatically when sensing a TX.


The ones in the first Pic I posted have Auto TX sensing.

Have found one in the box of stuff up the front; chances are there's another somewhere.

Have a habit of buying stuff in multiples.

Already using one of them to read my Modbus meters.


Phil.
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 366
Posted: 02:35pm 01 Dec 2019
Copy link to clipboard 
Print this post

Yeah the 232/485 converters do the same thing...

Only TX, RX, GND required.


I also tend to buy way more than I need  
 
     Page 1 of 2    
Print this page
© JAQ Software 2020