Subject: Re: magma LC2+1Sp sparc device question
To: Bill Studenmund <wrstuden@nas.nasa.gov>
From: Peter Eisch <peter@boku.net>
List: port-sparc
Date: 09/30/1999 15:27:57
magma@4800 => ttya@9600
CR: 0x0d -> 0xc7 0101100001 -> 0111000111
0: 0x30 -> 0xc8 0000011001 -> 0000100111
1: 0x31 -> 0xc9 0100011001 -> 0100100111
2: 0x32 -> 0xc8 0010011001 -> 0000100111
3: 0x33 -> 0xc9 0110011001 -> 0100100111
4: 0x34 -> 0xca 0001011001 -> 0110100111
5: 0x35 -> 0xcb 0101011001 -> 0001100111
6: 0x36 -> 0xcc 0011011001 -> 0101100111
7: 0x37 -> 0xcd 0111011001 -> 0011100111
8: 0x38 -> 0xde 0000111001 -> 0011110111
9: 0x39 -> 0xc6 0100111001 -> 0011000111
magma@2400 => ttya@9600
CR: 0x0d -> 0xf8 0101100001 -> 0000111111
<didn't bother going further, this seems to be too far>
Before a wife and kid I would rip this open -- kernel drivers were my
"thing" a couple years ago. I'll have to see what I can do to get a
handle on this.
> > Ideas?
>
> Yes, the clock constant used for the baud rate generator is wrong.
>
> Given an 8-bit byte HGFEDCBA (i.e. H is bit 7, G is bit 6, etc.),
> a serial chip will transmit 0ABCDEFGH1 where 0 and 1 are start and stop
> bits (with value 0 and 1 respectivly). Normally the line is transmitting a
> continuoys 1.
>
> -1: 0x0d -> 0xfe 0101100001 -> 00111111111
> > 0: 0x30 -> 0xfa 0000011001 -> 00101111111
> > 1: 0x31 -> 0xfd 0100011001 -> 01011111111
> > 2: 0x32 -> 0xfa 0010011001 -> 00101111111
> > 3: 0x33 -> 0xff 0110011001 -> 01111111111
> > 4: 0x34 -> 0xfb 0001011001 -> 01101111111
> > 5: 0x35 -> 0xff 0101011001 -> 01111111111
> > 6: 0x36 -> 0xfb 0011011001 -> 01101111111
> > 7: 0x37 -> 0xff 0111011001 -> 01111111111
> > 8: 0x38 -> 0xfa 0000111001 -> 00101111111
> > 9: 0x39 -> 0xfd 0100111001 -> 01011111111
>
> For all of them except for 0x33, the pattern is 00XAXBXCXDXEXFXGXH where X
> is don't care (0x33 would have needed to be 0xfd).
>
> Looks like your serial port is running at twice the rate you expect. Try
> different baud rates and see what happens. Like ask it to run at 1/2 the
> rate you want. :-)
>