Subject: Re: magma LC2+1Sp sparc device question
To: Peter Eisch <peter@boku.net>
From: Bill Studenmund <wrstuden@nas.nasa.gov>
List: port-sparc
Date: 09/29/1999 19:14:04
On Wed, 29 Sep 1999, Peter Eisch wrote:

> 
> looking further, I've done two things:
> 
> - modified the magma.c to verify that the driver is getting touched.
> 
>   I changed the mttyread to log the in and out counts.  Numbers change!
> 
> - connected up to a serial port on a different box, both 9600, pa=none
> 
>   0x0d (CR) appears goes out the magma as 0xfe (lotsa ones)

[snip]

> 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. :-)

Take care,

Bill