[GreenKeys] Teletype 32-ASR / Arduino vs Raspberry Pi

epvgk at limpoc.com epvgk at limpoc.com
Tue Jun 11 19:07:16 EDT 2013


On Tue, Jun 11, 2013 at 03:42:20PM -0700, tony.podrasky wrote:
> GA OMs;
> 
> Eric, that's not quite correct:
> 
> The kernel doesn't have to know anything about Baud. The UAR/T
> is the one that handles stuff like that.
> 
> Do a <man setserial>. You can tell the UAR/T to do pretty much
> any speed you like.
> 
> Here's a few entries from my RTTY program:
> 
> [These are near the beginning of the program]
> 
> system("/bin/setserial /dev/ttyS0 spd_cust divisor 2534");
> 
> system("/bin/stty -F /dev/ttyS0 38400 cs5 raw -cstopb -echo");
> 
> 
> [These are from inside the program where I can change the speed
> on the fly]

I think setserial works with devices whose config registers are clones of the 
venerable 8250, 16550A, etc line, but the raspberry pi serial hardware is Amba 
PL011, i believe on board the ARM SOC chip. At any rate setserial didn't work
with it for me.  

BTW if you're going to try this make sure you disable "console=/dev/ttyAMA0" in 
the kernel commandline or you'll find your linux console message output spewing
to the TTY. 

eric



eric



> 
> 
> if (strcmp(command, sixty) == 0) /* | if input = sixty, set port speed | */
>                     {                                           /* |
> to 60 WPM.                       | */
>                     printf("\n[ESCAPE SEQUENCE SIXTY ACK]\n");
>                     system("/bin/setserial /dev/ttyS0 spd_cust
> divisor 2534");
>                     }
> 
> if (strcmp(command, sixtysix) == 0)             /* | if input =
> sixtysix, set port    | */
>                     {                                           /* |
> speed to 66 WPM.                 | */
>                     printf("\n[ESCAPE SEQUENCE SIXTYSIX ACK]\n");
>                     system("/bin/setserial /dev/ttyS0 spd_cust
> divisor 2304");
>                     }
> 
> if (strcmp(command, hundred) == 0)              /* | if input =
> hundred, set port     | */
>                     {                                           /* |
> speed to 100 WPM.                | */
>                     printf("\n[ESCAPE SEQUENCE HUNDRED ACK]\n");
>                     system("/bin/setserial /dev/ttyS0 spd_cust
> divisor 1536");
>                     }
> 
> 
> (I hope that it legible: this version of Thunderbird has an automatic
> line wrap that I can't change but the outgoing e-mail doesn't have it).
> 
> UE,
> W6ESE - tony
> NNNN
> ZCZC
> 
> On 06/11/2013 02:47 PM, epvgk at limpoc.com wrote:
> >Oh, I guess I should mention that the linux kernel doesn't support or know anything
> >about the 45.45 baud speed; I think had to modify the linux kernel to allow the speed,
> >but the hardware is capable of generating that baud rate.
> >
> >eric
> 
> -- 
> Tony J. Podrasky | I've been thinking about all my cool electronic
>                  | gadgets and how they've never brought me any real
>                  | happiness. I guess it's because I don't have
>                  | enough of them.                   -Matt Diamond


More information about the GreenKeys mailing list