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

Login with username, password and session length
February 05, 2012, 07:44:12 AM
News: Welcome to GLomation peer support forum
Pages: [1] 2
Topic Tools  
Read March 10, 2010, 12:55:21 PM #0
arapoport

RS485 on 9G20

Is RS485 enabled by default on the 9G20 ? If not, is there any way to enable it ?

Thanks,

Alex
 
Read March 10, 2010, 01:45:34 PM #1
admin

Re: RS485 on 9G20

The factory installed kernel should already have the RS-485 port (USART3 of the AT91SAM9G20 chip) enabled with RTS signal assigned to the port.  The USART must be set to RS-485 mode in order to use the RTS signal to do the flow control.  Please see http://glomation.net/smf/index.php/topic,175.0.html.
 
Read March 10, 2010, 01:53:01 PM #2
arapoport

Re: RS485 on 9G20

Thanks !
 
Read March 10, 2010, 02:01:37 PM #3
arapoport

Re: RS485 on 9G20

In the boot log I only see:

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

Is USART3 ttyS2 ?

Alex
 
Read March 10, 2010, 04:11:45 PM #4
admin

Re: RS485 on 9G20

It is ttyS4.  Looks like the default installed kernel does not have USART3 enabled.  Please see the topic given in previous post on how to enabled it in the kernel.
 
Read March 11, 2010, 07:02:04 AM #5
arapoport

Re: RS485 on 9G20

So the devmem2 0xfffd0004 w 0xc00008c1 command does register ttyS4 AND set its mode to RS485 ? Or should I activate the ttyS4 port in some other way and afterwards, set it as RS485 using devmem2 ?


It is ttyS4.  Looks like the default installed kernel does not have USART3 enabled.  Please see the topic given in previous post on how to enabled it in the kernel.
 
Read March 11, 2010, 09:01:15 AM #6
admin

Re: RS485 on 9G20

The serial port driver must first be registered in the kernel in order to use it from user space.  The default kernel source needs to be modified to add the registration of USART3 as indicated in the other topic.

Once the serial port is available in the user space the port must be set to RS485 mode in order to use the hardware flow control.  The devmem2 utility is used to set the mode register.  You can use other means to set it or even set it in the kernel when it is initializing the serial port.
 
Read March 11, 2010, 09:07:02 AM #7
arapoport

Re: RS485 on 9G20

I see. Last question: is there any image ready that I can use for this board (that has the USART3 enabled) without altering and compiling the kernel myself ?

Alex
 
Read March 17, 2010, 11:08:56 AM #8
sebacancinos

Re: RS485 on 9G20

I have the same problem.

I recompiled the Kernel and now I see the ttyS4 port, modified the 0xfffd0004 register to enable de RS485 driver, but still can't get any readings on the port. Tested the same code on a serial port and it worked alright.
 
Is there any way to test the RS485 driver? Anything else I should do?

Thanks
Sebastian
 
Read March 18, 2010, 02:02:38 PM #9
admin

Re: RS485 on 9G20

The serial driver from the Linux kernel should work on the RS-485 port as it is.  Please check your cable connections.  You can also check the RS-485 line with a scope to make sure you have signal going out.
 
Read March 26, 2010, 08:40:48 AM #10
frankz

Re: RS485 on 9G20

Has anyone finally made RS485 worked? Mine is still not working after following steps,
1. Upgrade kernel image
2. Change register to enable RS485 mode

The issue is that I can't open '/dev/ttyS4' port.
 
Read March 26, 2010, 09:34:59 AM #11
arapoport

Re: RS485 on 9G20

No, it doesn't work yet. We can open the ttyS4 port, but no data is flowing to the RS485 device. For our development we can use an adapter, but for deployment it will be a serious problem if we can't get it work.
 
Read March 26, 2010, 01:40:04 PM #12
admin

Re: RS485 on 9G20

The RS-485 port on the GESBC-9G20 is a half duplex port.   The device connected to the port must be also a half duplex port.  Also should check if the termination resistor is required.
 
Read March 26, 2010, 04:05:20 PM #13
frankz

Re: RS485 on 9G20

The RS-485 port on the GESBC-9G20 is a half duplex port.   The device connected to the port must be also a half duplex port.  Also should check if the termination resistor is required.

Mine just worked.   Smiley

They just updated the kernal file
http://www.glomationinc.com/Support/9G20/uImage
and I downloaded it, update it to the board. Set the rts to high using devmem2. Now /dev/ttyS4 works just fine.

Make sure your kernal is built after this date,
uname -a
> Linux GESBC 2.6.27.4 #1 Thu Mar 25 17:53:01 EDT 2010 armv5tejl GNU/Linux
 
Read March 31, 2010, 04:45:00 PM #14
arapoport

Re: RS485 on 9G20

It works now, thanks !  Cheesy
 
Pages: [1] 2
Jump to:  

Theme Update by Runic Warrior Originally created by m3talc0re