PDA

View Full Version : Max cable length?



Fredrick
- 29th June 2010, 15:55
What is max cable length between the PIC and the serial LCD, will it work whit a 15 - 20 meter long cable?
Any special cable needed?
Serial LCD http://www.parallax.com/dl/docs/prod/audiovis/SerialLCD-RevE.pdf

ScaleRobotics
- 29th June 2010, 16:26
Assuming you are using a max232 device in your hardware it is well within the limits.
Edit: and this link has some different results: http://www.hamradio.cc/computer/RS232_serial_communications.php


<table class="pinout"><caption>RS232 cable length according to Texas Instruments</caption><tbody><tr><th>Baud rate</th><th>Maximum cable length (ft)</th></tr><tr class="odd" align="center"><td>19200</td><td>50</td></tr><tr class="even" align="center"><td>9600</td><td>500</td></tr><tr class="odd" align="center"><td>4800</td><td>1000</td></tr><tr class="even" align="center"><td>2400</td><td>3000</td></tr></tbody></table>

Fredrick
- 29th June 2010, 19:28
I want to connect a display to this devboard http://www.mikroe.com/eng/products/view/3/picplc16b-plc-system/ and it has the MAX232 onboard.

Do I have to use a MAX232 in both ends (display and devboard) or just that one on the devboard.

If you take a look at this display http://www.sparkfun.com/datasheets/LCD/SerLCD_V2_5.PDF it take incoming "TTL level" signals, should I still use a MAX232 whit this display, the MAX232 converts the PICīs TTL signals to RS232 signals that has a voltage upp to -+10 volts so if I have a MAX232 at the sender side I will damage the 16F88 on the display hardware if I donīt convert the RS232 signals back to TTL level signals?

ScaleRobotics
- 29th June 2010, 19:52
I am not sure how far TTL would travel. I would guess that it is much shorter than using a max232, since you don't have the range of voltage available. You could test it without...., or you could put a max232 on both sides, or...

You might be able to get by using a max232 on your hardware side, and on the serial lcd side, use a resistor as shown in the PBP manual under SERIN example. This 22k resistor would protect your serial lcd (RX) from the max232 voltages, but should preserve the distance, since the +/- voltage is getting all the way to the resistor.

ScaleRobotics
- 29th June 2010, 21:04
Then again, Darrel got 25 feet using a normal LCD. See this thread: http://www.picbasic.co.uk/forum/showthread.php?t=7596&p=47417#post47417

So maybe at the 2400 baud rate, you could get enough distance using ttl?

Fredrick
- 1st July 2010, 01:24
Thank you for your help.
I have now ordered this display http://www.sparkfun.com/commerce/product_info.php?products_id=9568 and will come back whit some feedback when I have make some tests.

Fredrick
- 2nd July 2010, 17:15
I just tried whit 9600 baud on a 11 meters shielded cable and it seems work well so far :)
I have no MAX232 on the sender side, I just connect the RX direct to PORTC.6

Fredrick
- 2nd July 2010, 20:13
Update:
9600 Baud and a 15 meter long cat5 cable and it still working whit this code and TTL level signals direct from the PIC.



start:
SEROUT2 lcdtx,84,[254,1]
SEROUT2 lcdtx,84,[254,line1,dec counter," ROW1"]
SEROUT2 lcdtx,84,[254,line2,dec counter," ROW2"]
SEROUT2 lcdtx,84,[254,line3,dec counter," ROW3"]
SEROUT2 lcdtx,84,[254,line4,dec counter," ROW4"]
pause 500
goto start


counter is a long sized variable.

ScaleRobotics
- 2nd July 2010, 20:37
Update:
9600 Baud and a 15 meter long cat5 cable and it still working whit this code and TTL level signals direct from the PIC.

Thanks a lot Frederick, very interesting. This is a good MythBusters episode, at least for me! You want to try another couple speeds, like 19200 and 38,400 (if the LCD has them)? Then you will have some pretty complete info for anyone thinking the same thing!

Walter