From: Darren G. <ts...@ya...> - 2005-02-01 02:58:35
|
Thanks for this info! Thinking this would be a slam dunk I tried typing "setserial=20 /dev/ttyS0", oops no setserial in gumstix distribution. I read up on=20 setserial and downloaded the source for setserial 2.17. When I run it=20= on the gumstix, I get semi-reasonable looking output: # ./setserial /dev/ttyS1 -a /dev/ttyS1, Line 1, UART: undefined, Port: 0x0000, IRQ: 14 Baud_base: 921600, close_delay: 50, divisor: 0 closing_wait: 3000 Flags: spd_normal But when I try to change anything, I get "invalid argument" from=20 ioctl(fd, TIOCSSERIAL, &new_serinfo) in the set_serial() function: # ./setserial /dev/ttyS1 low_latency Cannot set serial info: Invalid argument # ./setserial /dev/ttyS1 divisor 10 Cannot set serial info: Invalid argument But different from "missing argument": # ./setserial /dev/ttyS1 divisor Missing argument for divisor I added some printfs to dump the new_serinfo struct, thinking I might=20 be able to see what the ioctl is complaining about, but no luck. I can=20= see that the command line is being parsed properly: # ./setserial /dev/ttyS1 divisor 5 /dev/ttyS1, Line 1, UART: undefined, Port: 0x0000, IRQ: 14 Baud_base: 921600, close_delay: 50, divisor: 5 closing_wait: 3000 This same source seems to work fine on my SUSE box. Any ideas about what might be going wrong? thanks, darren On Jan 30, 2005, at 6:58 PM, Craig Hughes wrote: > =46rom the PXA Processor Developer's guide: > > 10.4.2.3 Divisor Latch Registers (DLL and DLH) Each UART contains a=20 > programmable baud rate generator that can take the 14.7456 MHz fixed =20= > input clock and divide it by 1 to (216=961). For the FFUART and the=20 > STUART, the divisor is from 4 to (216=961). The baud rate generator=20= > output frequency is 16 times the baud rate. Two 8-bit latch =20 > registers, shown in Table 10-5 and Table 10-6, store the divisor in a=20= > 16-bit binary format. Load these divisor latches during=20 > initialization to ensure that the baud rate generator operates=20 > properly. If each Divisor Latch is loaded with a 0, the 16X clock=20 > stops. The Divisor Latches are accessed with a word write. The baud=20= > rate of the data shifted in to or out of a UART is given by the=20 > formula: [picture of formula] For example: if the divisor is 24, the=20= > baud rate is 38400 bps. The divisor=92s reset value is 0x0002. For the=20= > FFUART and the STUART, the divisor must be set to at least 0x0004=20 > before the UART unit is enabled. > > > The formula in question is baudrate =3D 14.7456MHz/(16xdivisor), ie > > divisor =3D (14.7456*10^6)/(16*baudrate) > > (14.7456*10^6)/(16*31250) =3D 29.49 > > So you'd have to choose 29 or 30 > > 14.7456M/16*29 =3D 31779 > 14.7456M/16*30 =3D 30720 > > setserial should work I think for either of those values. > > C > > > On Jan 30, 2005, at 5:55 PM, Darren Gibbs wrote: > >> Would it be fantastically tricky to get gumstix to do non-standard=20 >> baud rates on a uart? I'm thinking of MIDI (31250). >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: IntelliVIEW -- Interactive=20 >> Reporting >> Tool for open source databases. Create drag-&-drop reports. Save time >> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, = etc. >> Download a FREE copy at http://www.intelliview.com/go/osdn_nl >> _______________________________________________ >> gumstix-users mailing list >> gum...@li... >> https://lists.sourceforge.net/lists/listinfo/gumstix-users > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive = Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users > |