Glomation
 
Advanced Search
Welcome, Guest. Please login or register.

Login with username, password and session length
February 05, 2012, 06:54:21 AM
News: Glomation introduced new wireless ready low cost GESBC-9260S
Pages: [1]
Topic Tools  
Read March 10, 2009, 05:37:57 PM #0
Tim Bosserman

RS-485 port

I am trying to use the RS-485 port.  According to the GESBC-9260S User’s Manual, the RS-485 port is optional.  Further, it states that the RS-485 port is connected to USART3.  In my kernel bootup I see the following messages:

atmel_usart.0: ttyS0 at MMIO 0xfefff200 (irq = 1) is a ATMEL_SERIAL
atmel_usart.1: ttyS1 at MMIO 0xfffb0000 (irq = 6) is a ATMEL_SERIAL
atmel_usart.2: ttyS2 at MMIO 0xfffb4000 (irq = 7) is a ATMEL_SERIAL
atmel_usart.4: ttyS4 at MMIO 0xfffd0000 (irq = 23) is a ATMEL_SERIAL

I don't see anything connected to atmel_usart.3.  Does that mean I do not have the optional RS-485 port on my SBC?

If my SBC does, in fact, have the RS-485 port, what device in /dev/ do I use to access it?  I'm assuming one of the /dev/ttyS?
ports, but is it something else?  Is there any documentation available on programming the RS-485 port?
 
Read March 11, 2009, 10:37:09 AM #1
admin

Re: RS-485 port

The RS-485 port on GESBC-9260S uses UART3 which is ttyS4 in Linux (the debug port is ttyS0).  If your board is equipped with the RS-485 driver chip you can just open the device file /dev/ttyS4 and start communicating with other RS-485 devices after you set the UART3 mode to RS-485.  The UART3 mode register is at memory location 0xfffd0004.  A value of 0xc00008c1 will set it to RS-485 mode.  You can write a program to set the mode register or use the devmem2 utility program to do it.
 
Read May 12, 2010, 11:16:35 AM #2
mmenti

Re: RS-485 port

The RS-485 port on GESBC-9260S uses UART3 which is ttyS4 in Linux (the debug port is ttyS0).  If your board is equipped with the RS-485 driver chip you can just open the device file /dev/ttyS4 and start communicating with other RS-485 devices after you set the UART3 mode to RS-485.  The UART3 mode register is at memory location 0xfffd0004.  A value of 0xc00008c1 will set it to RS-485 mode. 
I'm trying to get the "opposite" to work: I own a GESBC-9260 (no "S") which claims to have a RS-485 driver chip on-board. But I need a 3rd RS232 port  (RS232 or TTL levels will work both) without loosing the default Debug Port. Is it possible to interface to /dev/ttyS4 by J16 (I've read elsewhere that this wouldn't work when RS-485 driver chip is on-board)? Or do you have other suggestions?

NB: is it allowed to interface to ttyS1/2 over J16 by using TTL levels?

Best regards,

Marco
 
Read May 13, 2010, 02:33:56 PM #3
admin

Re: RS-485 port

The RS-485 driver chip must be removed in order to use the UART3.  Otherwise there will be two source fighting to drive the same line.  All pins on J16 are LVTTL (3.3V).  A 3.3V RS-232 driver chip must be used or additional voltage level shifting circuit must be added.
 
Read May 13, 2010, 03:27:08 PM #4
mmenti

Re: RS-485 port

The RS-485 driver chip must be removed in order to use the UART3.  Otherwise there will be two source fighting to drive the same line.

Thanks for the fast response. Do I also need to remove the existing RS-232 Level-shifters when accessing the RS232 ports through J16?
« Last Edit: May 13, 2010, 03:40:41 PM by mmenti »
 
Read May 14, 2010, 09:39:46 AM #5
admin

Re: RS-485 port

U3 is the RS-232 driver chip for the P1 port.  It can be removed so you can access the TTL level signal on J16.
 
Read May 15, 2010, 11:59:44 AM #6
mmenti

Re: RS-485 port

U3 is the RS-232 driver chip for the P1 port.  It can be removed so you can access the TTL level signal on J16.
I found an easy solution without de-soldering by just enabling USART2 and USART 5.
Just add these lines to patch_board-sam9260ek.c and recompile kernel:

Code:

/* USART2 on ttyS3. (Rx, Tx, only) */
at91_register_uart(AT91SAM9260_ID_US2, 3, 0);

/* USART3 on ttyS4 (RS-485). (Rx, Tx, RTS, CTS) */
at91_register_uart(AT91SAM9260_ID_US3, 4, ATMEL_UART_CTS | ATMEL_UART_RTS);

/* USART5 on ttyS6. (Rx, Tx, only) */
at91_register_uart(AT91SAM9260_ID_US5, 6, 0);

Now I can access these ports on TXD2/RXD2 respectively TXD5/RXD5 by J16 pins.
 
Read May 17, 2010, 03:37:38 AM #7
SteveMartins

Re: RS-485 port

If I wish to fit the RS485 driver chip, can I simply put it down on U15 without any other modifications? also what IC do I need?

thanks,

Steve
 
Read May 17, 2010, 07:43:16 AM #8
mmenti

Re: RS-485 port

If I wish to fit the RS485 driver chip, can I simply put it down on U15 without any other modifications? also what IC do I need?

I don't know for sure. On my GESBC-9260, there's a SP485EE driver chip soldered on. I guess that you also have to add J6 and R65 (Termination resistor) and check/solder R64/D5 (direction pin?). Check also R60/R61 (I guess these are pull-ups).

It might be more reasonable to put these components on a "daughter board" and access the USART by J16.

Best regards,

Marco
« Last Edit: May 18, 2010, 12:52:35 AM by mmenti »
 
Read August 24, 2010, 03:15:21 AM #9
SteveMartins

Re: RS-485 port - RTS Line inverted

I am adding the RS485 chip to my board, however I am unsure about the RTS line, as it is used to control the DE/_RE input lines. Putting a scope on pins 2 and 3 of U15 (not fitted) shows the line hign while not transmitting and low while transmitting, however the datasheet for the SP485E shows this as needing to be high while transmitting (data enabled, receive disabled) and low when not.

Would anyone be able to confirm if these pins are high while transmitting on a board with this chip fitted? does anyone know if there is a configuration setting which changes the polarity of this signal?

TIA

Steve
 
Read August 24, 2010, 07:33:54 AM #10
admin

Re: RS-485 port

The driver chip for GESBC-9260S is MAX1485.  The RTS line can be set to RS-485 mode in one of the USART control registers.  Please see example here http://glomation.net/smf/index.php/topic,175.0.html
 
Read October 22, 2010, 03:37:03 PM #11
thuper

Re: RS-485 port

I have 5 of these boards I purchased in 2009.  I have found a new application for them that requires both rs232 and rs485.  I'm not sure if 485 is included in the boards I have since it is optional.  Is there an easy way to identify?  They have empty pads for JP3, U16, R64 and D5.  Is that where the rs485 components would be?  Do I need these to take advantage of the 9260's rs485 mode?
 
Read October 22, 2010, 04:09:30 PM #12
admin

Re: RS-485 port

The RS-485 is standard on the GESBC-9260 and is optional on the GESBC-9260S.  The driver chip is MAX1485, R64 is 1.5K, D5 is BAS40LT1 or equivalent, JP3 is full duplex or half duplex select.  The AT91SAM9260 RS-485 mode reveres the RTS line logic to control the RS-485 driver chip.
 
Read October 27, 2010, 11:02:42 AM #13
thuper

Re: RS-485 port

Thank you for your response.  Is there a different method for using the RS-485 pins (9 & 10) on J16? or will I still need the max1485?
 
Read October 27, 2010, 02:50:35 PM #14
admin

Re: RS-485 port

The RS-485 specification require the voltage level on the signal lines to conform to the specification.  The driver chip is needed to convert LVTTL signal to the RS-485 voltage level.
 
Pages: [1]
Jump to:  

Theme Update by Runic Warrior Originally created by m3talc0re