Advanced Search
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
February 05, 2012, 07:44:12 AM
Home
Help
Calendar
Login
Register
News
: Welcome to GLomation peer support forum
Glomation
»
Peer Support Forums
»
GESBC-9G20
»
RS485 on 9G20
« previous
next »
Pages: [
1
]
2
Topic Tools
Topic Tools
Send this topic
Print
March 10, 2010, 12:55:21 PM
#0
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
RS485 on 9G20
Is RS485 enabled by default on the 9G20 ? If not, is there any way to enable it ?
Thanks,
Alex
March 10, 2010, 01:45:34 PM
#1
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
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
.
March 10, 2010, 01:53:01 PM
#2
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
Re: RS485 on 9G20
Thanks !
March 10, 2010, 02:01:37 PM
#3
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
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
March 10, 2010, 04:11:45 PM
#4
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
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.
March 11, 2010, 07:02:04 AM
#5
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
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 ?
Quote from: admin on March 10, 2010, 04:11:45 PM
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.
March 11, 2010, 09:01:15 AM
#6
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
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.
March 11, 2010, 09:07:02 AM
#7
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
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
March 17, 2010, 11:08:56 AM
#8
sebacancinos
sebacancinos
Show sebacancinos's last posts.
Show general stats for sebacancinos.
Hero
Posts: 4
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
March 18, 2010, 02:02:38 PM
#9
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
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.
March 26, 2010, 08:40:48 AM
#10
frankz
frankz
Show frankz's last posts.
Show general stats for frankz.
Super Hero
Posts: 8
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.
March 26, 2010, 09:34:59 AM
#11
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
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.
March 26, 2010, 01:40:04 PM
#12
admin
admin
Show admin's last posts.
Show general stats for admin.
Administrator
Super Hero
Posts: 339
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.
March 26, 2010, 04:05:20 PM
#13
frankz
frankz
Show frankz's last posts.
Show general stats for frankz.
Super Hero
Posts: 8
Re: RS485 on 9G20
Quote from: admin on March 26, 2010, 01:40:04 PM
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.
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
March 31, 2010, 04:45:00 PM
#14
arapoport
arapoport
Show arapoport's last posts.
Show general stats for arapoport.
Super Hero
Posts: 25
Re: RS485 on 9G20
It works now, thanks !
Pages: [
1
]
2
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Announcements
=> General Discussion
=> Programming Tips, Recommendded Readings, etc.
-----------------------------
Peer Support Forums
-----------------------------
=> GESBC-9302
=> GESBC-9260
=> GESBC-9G20
=> GESBC-2440
=> GESBC-9315
Loading...