ts-7000
[Top] [All Lists]

[ts-7000] Another COM2 question

To:
Subject: [ts-7000] Another COM2 question
From: "loki2517" <>
Date: Sun, 22 Apr 2007 17:08:51 -0000
Ok, please bear with me.  I know there are many many topics regarding
to people unable to get COM2 working on the TS-7250 but I've read
through them and can't solve my problem.  I'm hoping that I'm just
doing something stupid here, but I really am stuck.  I'm trying to get
a digital compass to talk to my TS-7250 over RS-232 3 wire serial.  I
have it wired up to a D9 and am using the adapter that came with the
board to connect the 2 ports together.  I am talking tom y 7250 via
ethernet logins so I have commented out both serial ports for console
work in etc/inittab.  I also have removed JMP 2 just to be sure.  JMP
3 is still installed, but I don't think it should affect anything.

I first run setserial /dev/ttyAM1 to set up the port.  After setting
it to port 0x808c0000, baud_base 9600 (speed of the compass) and IRQ
52 here is my output from setserial /dev/ttyAM1 -a:

/dev/ttyAM1, Line 1, UART: undefined, Port: 0x808d, IRQ: 54
        Baud_base: 9600, close_delay: 50, divisor: 0
        closing_wait: 3000
        Flags: spd_normal

Here is the simple C program I wrote just to test the port.  All it
does is open the port, read 20 characters and output them to the
console, then reprint all of them again as a string then quite.  

readcom2.c

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

FILE *fs;
//FILE *fw;
char heading[20]={0};
int n = 0;
int main()
{
        fs=fopen("/dev/ttyAM1","rb");   
                for (n=0; n<20 ;n++){
                int temp = fgetc(fs);
                putchar(temp);
                heading[n]=temp;
                }
//      fw=fopen("out.txt","wb");
        fclose(fs);
//      p=fprint(heading,fw);
        puts(heading);
        //p=fclose(fw);
        return 0;
}

This compiles with no errors or warnings and when I run in on the
board it just sits there and does nothing.  I have changed this to it
used Port1 by changing the fopen to open /dev/ttyAM0 and get the same
results.  I have a feeling I am still missing a setup somewhere but I
don't know where.  It's not very helpful that the section on COM1 and
COM2 in the Manual I got is "TO DO".  Any help would be appreciated.

L




 
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