ts-7000
[Top] [All Lists]

[ts-7000] Re: New to TS-7xxx ARM SBC, looking for basic RS232 loopback t

To:
Subject: [ts-7000] Re: New to TS-7xxx ARM SBC, looking for basic RS232 loopback test program. (TS-7500
From: "Jon L" <>
Date: Wed, 16 Dec 2009 15:56:21 -0000

--- In  "Jon L" <> wrote:
>
> Current architecture:
> 
> TS-7500 mounted on the TS-752 development kit, 
> Talk to the TS-7500 through the TS-752 Console port using a hypertrm session 
> running from a Windows XP pro PC. 
> 
> 
> And its been 9 years since I programmed in a unix environment too :-/ (and at 
> that not programming at the hardware level) 
> so please be kind. 
> 
> The skinny is, 
> 
> I want to make a simple loopback test, send out, say 5 characters, on one 
> port, and every time the second port receives the 5 characters it sends back 
> a message "got 5 chars".  If the receiving process gets the first char, but 
> within say 3 seconds doesn't get the 5th, it sends the string "got less than 
> 5 chars". 
> 
> 
> Here's what I've got so far:
> 
> I wrote a bunch of Uart handlers software for a Rabbit Processor and they all 
> work fine, but my boss wants it to run on the busybox linux processor on the 
> TS-7500 board.  So I got me a TS-7500 that has the busybox linux on the flash 
> memory for fast boot, and the full debian linux on the removable card for a 
> development suite. I got my hello world program working just fine (writing to 
> stdio), and it even runs fine on the busybox linux (you must compile with the 
> --static option!!!) 
> 
> I've got my TS-7500 mounted on the development kit TS-752 that has broken out 
> all sorts of the pins as described here: 
> 
> http://www.embeddedarm.com/about/resource.php?item=414  (section "3.1") 
> 
> meantime along with confusion about the pinouts (looks like there are typos 
> describing pins 28 and 29 for example) 
> 
> I'm lost on how to begin.  Can anybody point me in the right direction to 
> programming the UART's in this TS-7xxx environment? Even if its for one of 
> the other boards, I'm sure it should be not too difficult to convert it.
>

Firstly, please note I do actually have a question, but I figured I better 
docuement whats done so far so people can follow along. Sorry in advance if I 
ramble. 


Ok, I haven't looked at the listed programs yet, (I'm about to) but I did look 
at and got working the program ser.c bascially out-of-the-box from here:

http://www.captain.at/howto-simple-serial-port-test-example.php

I set up the uart based on the TS-7500 manual, compiled and ran as so:


ts7500:/dev# xuartctl --port 0 --server --speed 4800
ttyname=/dev/pts/0
ts7500:/dev# ln -sf /dev/pts/0 /dev/testuart

ts7500:/home/jon/programs/ser# ./ser
baud=9600
baud=9600
written:ABC
readport=ABC

The only change I needed to do was substitute "/dev/testuart" where ever the 
source code file ser.c had the reference to "/dev/ttyS0".  

Using the TS-7500 and its development kit the TS-752, UART0 came out on pins 
7,8 of the DB9 (and pins 2,3 of the DB9 are the console port.) 

I hooked up a pins 7 and 8 to com6 of my pc, and started a hyperterminal 
session to monitor the port, and sure enough the characters "ABC" come out on 
the terminal.  



SO HERE'S THE QUESTIONS: 


1) my hyperterminal session was set up at 4800 baud just like its setup stated 
in the "xuartctl --port 0 --server --speed 4800" above, but the source code to 
ser.c states:

int initport(int fd) {
        struct termios options;
        // Get the current options for the port...
        tcgetattr(fd, &options);
        // Set the baud rates to 19200...
        cfsetispeed(&options, B9600);
        cfsetospeed(&options, B9600);
        // Enable the receiver and set local mode...
        options.c_cflag |= (CLOCAL | CREAD);


setting the baud rate to 9600 ("cfsetispeed(&options, B9600); 
cfsetospeed(&options, B9600);") The correct setting is 4800, so how is this 
working?

2) If you look at the program output: 

baud=9600
baud=9600
written:ABC
readport=ABC

you will note that the readport has the charcters "ABC" read.  How did my 
characters written come back around to the readport?  The characters went out 
on UART0 just fine on the TX line, why did they show back up on the RX line?

I also went as far as to disconnect pins from the hyperterminal sessions, no 
change in the program's output. Even when I put the loopback wire in place 
(connect RX to TX ) no change in output. 

I even put a second readport in, and the second one always fails, I only get 
one set of "ABC" back. 






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

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>
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