Long Distance Serial Connection: Success!

bpowell

Senior Member
I have a small shack about 80m from my house ... I recently ran 2 strands of CAT5 cable out there from the house (one for a PC, the other is spare). I've been wanting to play with having a microcontroller out there that I can control from inside the house; connecting it to relays to power on Christmas lights, fans, etc. As a part of my experimenting, I wanted a microcontroller that could

1: Be downloaded via serial connection
2: Didn't require a PC to be in the shack with it
3: Didn't require any special signals to reset / download (RTS / DTR, etc.)

PICAXE fit the bill!

I picked up some cheap TTL >< 422 converters ... couple of bucks on amazon or ebay. Now, using just 4 wires in my spare CAT5 cable, I'm able to communicate with my PICAXE over 80m away! I'm also able to successfully download new code to the PICAXE.

This is my first go at running a long serial connection, and 422 is doing the job nicely!
 

inglewoodpete

Senior Member
I have a small shack about 80m from my house ... I recently ran 2 strands of CAT5 cable out there from the house (one for a PC, the other is spare). I've been wanting to play with having a microcontroller out there that I can control from inside the house; connecting it to relays to power on Christmas lights, fans, etc. As a part of my experimenting, I wanted a microcontroller that could

1: Be downloaded via serial connection
2: Didn't require a PC to be in the shack with it
3: Didn't require any special signals to reset / download (RTS / DTR, etc.)

PICAXE fit the bill!

I picked up some cheap TTL >< 422 converters ... couple of bucks on amazon or ebay. Now, using just 4 wires in my spare CAT5 cable, I'm able to communicate with my PICAXE over 80m away! I'm also able to successfully download new code to the PICAXE.

This is my first go at running a long serial connection, and 422 is doing the job nicely!
RS422 should do the job over 80 metres of twisted pair. Do you know what baud rate/s you are able to achieve or is the link just for programming and logging data (SerTxd)?
 

bpowell

Senior Member
Right now it's just downloading and data exchange via SerRxd and SerTxd (so, a solid 4800 and 9600 respectively) Now that I have the proof of concept, I may work up another device just to cycle through baud rates up to 1Mbps and output something each time ... then I can just drop it in the shack, and come back and see results.
 

bpowell

Senior Member
A side benefit of 422: I can switch the polarity of the 422 lines (swap A & B and Y & Z) by doing this, I can use a standard FTDI adapter to communicate with my PICAXE ... I don't need to use the FTDI adapter I modified for PICAXE (inverting the polarity)...I have stacks of FTDI adapters, but only a couple where I've configured them for PICAXE ... so this frees up one of my PICAXE adapters...woo hoo!
 

Janne

Senior Member
That got me thingking, if the programming actually is half duplex it might even work over an RS.485 connection and would just need 2 wires =)
 

bpowell

Senior Member
That got me thingking, if the programming actually is half duplex it might even work over an RS.485 connection and would just need 2 wires =)
I doubt that would work ... the break-signal seems to be a full-duplex interaction ... the PC pulls the TX line HIGH for 5 seconds, and in that 5 seconds, the PICAXE must reply with it's firmware version number...the TX line goes low after 5 seconds, and then the programming starts...the programming itself is half-duplex, but there'd be a lot of flipping between TX and RX ... the PC will send a byte, the PICAXE will echo it back, and the PC validates the byte received was what was sent and moves onto the next byte.
 

bpowell

Senior Member
RS422 should do the job over 80 metres of twisted pair. Do you know what baud rate/s you are able to achieve or is the link just for programming and logging data (SerTxd)?
I've got a 20x2 on the other end of the wire, so I was able to SetFreq M64 and had steady and clean serial comms at 76,800.
 
Top