Subject: |
Asyn Driver with PXA255 (gumstix) and a non-standard baud rate |
From: |
"Eric Berryman" <[email protected]> |
To: |
[email protected] |
Date: |
Wed, 31 Oct 2007 09:14:50 -0400 |
Hello,
For those that would be interested, here is one solution to using the
asyn driver and a non-standard baud rate on a pxa255 (gumstix). (If
you also can't get setserial to work without too much effort)
First, configure the port for some standard baud rate in your st.cmd:
drvAsynSerialPortConfigure ("SRRGA","/dev/ttyS2", 0, 0, 0)
asynSetOption ("SRRGA", 0, "baud", "38400")
asynSetOption ("SRRGA", 0, "bits", "8")
asynSetOption ("SRRGA", 0, "parity", "none")
asynSetOption ("SRRGA", 0, "stop", "2")
asynSetOption ("SRRGA", 0, "clocal", "Y")
asynSetOption ("SRRGA", 0, "crtscts", "N")
Then poke the divisor registers for your baud rate:
## For PXA arch to set 28800 baud rate
## Set DLAB bit to 1 to access DLL and DLH bits
system("/root/pxaregs STLCR 0x87")
## Set Divisor to 32 for 28800 baud rate
system("/root/pxaregs STDLL 0x20")
system("/root/pxaregs STDLH 0")
## Set DLAB bit to 0 with 8 bit, no parity, 2 stop bit
system("/root/pxaregs STLCR 0x07")
Thank you!
Eric Berryman
National Superconducting Cyclotron Laboratory
Michigan State University
---------- Forwarded message ----------
From: Eric Norum <[email protected]>
Date: Oct 30, 2007 3:46 PM
Subject: Re: Asyn Driver Question
To: Eric Berryman <[email protected]>
Glad to hear that things are working.
Would it be possible for you to post a description of your problem
and solution to tech-talk in case there are others out there trying
to deal with the same hardware?
Begin forwarded message:
> From: Eric Berryman <[email protected]>
> Date: October 30, 2007 2:27:49 PM CDT
> To: Eric Norum <[email protected]>
> Subject: Re: Asyn Driver Question
>
> Yes!
>
> Thank you, that did it.
>
> Thank you again!
>
> On 10/30/07, Eric Norum <[email protected]> wrote:
>> I see no way to set the other termios parameters without setting the
>> serial line rate as well -- tcsetattr() modifies all all settings.
>> Could you run your program which pokes the divisor after the asyn
>> port is created and configured? There's a system() command in the
>> ioc shell for running external programs.
>>
>> On Oct 30, 2007, at 12:56 PM, Eric Berryman wrote:
>>
>>> I'm using 4.9 ... But, my system doesn't support 28.8kbaud (but I
>>> can
>>> get it by changing resistors directly).
>>>
>>>
>>>
>>> On 10/30/07, Eric Norum <[email protected]> wrote:
>>>> What version of ASYN are you using? The recently-released 4.9 has
>>>> support for 28.8kbaud for those systems which support it.
>>>>
>>>>
>>>> On Oct 30, 2007, at 12:33 PM, Eric Berryman wrote:
>>>>
>>>>> Hello!
>>>>>
>>>>> Is it possible to use drvAsynSerialPortConfigure without it
>>>>> configuring the baud rate? I have a pxa255 with linux, and I
>>>>> have to
>>>>> set the baud rate to an abnormal 28800. To do this, I am changing
>>>>> registers on the pxa (Divisor Latch Low Register) by hand
>>>>> (setserial
>>>>> does not seem to work on the pxa255). But, when I run the below
>>>>> st.cmd file it sets the register back to a 38400 baud rate.
>>>>>
>>>>> Thank you!
>>>>> Eric Berryman
>>>>>
>>>>> < envPaths
>>>>>
>>>>> cd ${TOP}
>>>>>
>>>>> ## Must be exec for SRS RGA 28.8k baud rate (changes 38400 to
>>>>> 28800)
>>>>> ## /bin/setserial /dev/ttyS0 spd_cust baud_base 115200 divisor 4
>>>>>
>>>>> ## Register all support components
>>>>> dbLoadDatabase("dbd/rga100.dbd")
>>>>> rga100_registerRecordDeviceDriver(pdbbase)
>>>>>
>>>>> ## Load record instances
>>>>> #dbLoadTemplate "db/userHost.substitutions"
>>>>> dbLoadRecords("db/RGA100.db","P=K5RGA,PORT=SRRGA")
>>>>>
>>>>> ## Set this to see messages from mySub
>>>>> #var mySubDebug 1
>>>>>
>>>>> epicsEnvSet ("STREAM_PROTOCOL_PATH", "$(TOP)/rga100App/protocol")
>>>>>
>>>>> drvAsynSerialPortConfigure ("SRRGA","/dev/ttyS2", 0, 0, 0)
>>>>> # asynSetOption ("SRRGA", 0, "baud", "38400")
>>>>> # asynSetOption ("SRRGA", 0, "bits", "8")
>>>>> # asynSetOption ("SRRGA", 0, "parity", "none")
>>>>> # asynSetOption ("SRRGA", 0, "stop", "2")
>>>>> # asynSetOption ("SRRGA", 0, "clocal", "Y")
>>>>> # asynSetOption ("SRRGA", 0, "crtscts", "N")
>>>>>
>>>>> asynSetTraceMask("SRRGA", 0, 0x3)
>>>>> asynSetTraceIOMask("SRRGA", 0, 0x1)
>>>>>
>>>>> cd ${TOP}/iocBoot/${IOC}
>>>>> iocInit()
>>>>>
>>>>> ## Start any sequence programs
>>>>> seq rgacal_seq(P=K5RGA)
>>>>> seq rgafil_seq(P=K5RGA)
>>>>
>>>> --
>>>> Eric Norum <[email protected]>
>>>> Advanced Photon Source
>>>> Argonne National Laboratory
>>>> (630) 252-4793
>>>>
>>>>
>>>>
>>
>> --
>> Eric Norum <[email protected]>
>> Advanced Photon Source
>> Argonne National Laboratory
>> (630) 252-4793
>>
>>
>>
--
Eric Norum <[email protected]>
Advanced Photon Source
Argonne National Laboratory
(630) 252-4793
- Replies:
- Re: Asyn Driver with PXA255 (gumstix) and a non-standard baud rate Emmanuel Mayssat
- Navigate by Date:
- Prev:
RE: GpibBoardDriverConfig not found Mark Rivers
- Next:
Is there any chance that I can change SCAN parameter dynamically? Zhichu Chen
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
pc104 usb 2.0 module David Kline
- Next:
Re: Asyn Driver with PXA255 (gumstix) and a non-standard baud rate Emmanuel Mayssat
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|