ts-7000
[Top] [All Lists]

[ts-7000] TS-7400 DIO and UARTS 0,1,and 2

To: "" <>
Subject: [ts-7000] TS-7400 DIO and UARTS 0,1,and 2
From: Jayne Dickinson <>
Date: Fri, 20 Jun 2008 16:55:06 -0700
Greetings,

We have developed our own daughter card to interface with the TS-7400 
motherboard's lower header pins

UART0_TX = lower pin #22 = DIO_18
UART0_RX = lower pin #23 = DIO_19

UART1_TX = lower pin #25
UART1_RX = lower pin #24

UART2_TX = lower pin #21 = DIO_17
UART2_RX = lower pin #20 = DIO_16


I am booting directly from flash ( using busybox ) and downloaded a simple test 
and also the ts_utils ( test7400DIO )
and having difficulty getting the built-in UART0 to send and receive data....

I disabled the /sbin/getty for UART0 in /etc/inittab... I've setup the UART0 to 
use DIO_18 and DIO_19

Is there another serial driver I need to install, I only want the TTL Uarts...

------------------------------------------------------------------------------------------------------------------------------------------------------------

Here's the result of lsmod

$ lsmod
Module                  Size  Used by    Tainted: P
vfat                   10140   0 (unused)
tsuart0                 8880   0
fat                    29608   0 [vfat]
bootloader              3040   0


$ uname -a
Linux ts7400-host1 2.4.26-ts11 #128 Tue Apr 8 13:34:20 MST 2008 armv4l unknown


$ ./test7400DIO
.0 -> 1 (HI) failed [5555] [0001]
.2 -> 3 (HI) failed [5555] [0004]
.4 -> 5 (HI) failed [5555] [0010]
.6 -> 7 (HI) failed [5555] [0040]
.8 -> 9 (HI) failed [5555] [0100]
.10 -> 11 (HI) failed [5555] [0400]
.12 -> 13 (HI) failed [5555] [1000]
.14 -> 15 (HI) failed [5555] [4000]
.0 -> 1 (LO) failed [5555] [7FFE]
.2 -> 3 (LO) failed [5555] [7FFB]
.4 -> 5 (LO) failed [5555] [7FEF]
.6 -> 7 (LO) failed [5555] [7FBF]
.8 -> 9 (LO) failed [5555] [7EFF]
.10 -> 11 (LO) failed [5555] [7BFF]
.12 -> 13 (LO) failed [5555] [EFFF]
.14 -> 15 (LO) failed [5555] [BFFF]
.........0 <- 1 (LO) failed [AAAA] [FFFD]
.2 <- 3 (LO) failed [AAAA] [FFF7]
.4 <- 5 (LO) failed [AAAA] [FFDF]
.6 <- 7 (LO) failed [AAAA] [FF7F]
.8 <- 9 (LO) failed [AAAA] [FDFF]
.10 <- 11 (LO) failed [AAAA] [F7FF]
.12 <- 13 (LO) failed [AAAA] [DFFF]
.14 <- 15 (LO) failed [AAAA] [7FFF]
Done with 24 errors


Here my sample source to initialize the TS7400 so UART0 will use DIO_18 and 
DIO_19
///////////////////////////////////////////////////////
// setup DIO and data direction for uarts 0,1,and 2
///////////////////////////////////////////////////////
int ts7400_UartInit ( void )
{
    int status = -1;
    int memfd = -1;
    char *uartregs;

    //////////////////////////////////////////////////////////////
    // access internal TS7400 registers from userspace
    //////////////////////////////////////////////////////////////
    memfd = -1;
    memfd = open ( "/dev/mem", (O_RDWR | O_SYNC ));
    if ( memfd > 0 )
    {

         //////////////////////////////////////////////////////////
         // setup uart on DIO_18 and DIO_19
         //////////////////////////////////////////////////////////
         uartregs = NULL;
         uartregs = (char *)mmap(0, 4096, (PROT_READ| PROT_WRITE),
                                  MAP_SHARED, memfd, 0x12000000 );

         if ( uartregs != NULL )
         {
             //////////////////////////////////////////////////////////
             // enable UART 0 on DIO pins 18-19
             //////////////////////////////////////////////////////////
             printf("previous uartregs[0] = 0x%x \n", uartregs[0] );
             uartregs[0] = 0x01;
             printf("current uartregs[0] = 0x%x \n", uartregs[0] );

             //////////////////////////////////////////////////////////
             // set up DIO_18 out and DIO_17 out
             //////////////////////////////////////////////////////////
             printf("previous uartregs[1] = 0x%x \n", uartregs[1] );
             uartregs[1] = 0x66;
             printf("current uartregs[1] = 0x%x \n", uartregs[1] );
         }
         else
         {
             printf("mmap of 0x12000000 failed...exit! \n");
             close ( memfd );
             return ( CM_SERIAL_MMAP_ERR );
         }
    }
    else
    {
       printf("ts7400SerialInit: open to /dev/mem failed!!\n");
       status = CM_SERIAL_OPEN_MEM_ERR;
    }

    return ( status );
}

Results when I run my simple test...

$ ./tsSerialTest
opened iomap ...
previous uartregs[0] = 0x23
current uartregs[0] = 0x21
previous uartregs[1] = 0x2f
current uartregs[1] = 0x6f


Has anyone else done this with the TS-7400??
Thanks in advance!
Jayne



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
  • [ts-7000] TS-7400 DIO and UARTS 0,1,and 2, Jayne Dickinson <=
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU