ts-7000
[Top] [All Lists]

[ts-7000] Potential problem reading RS-485 present status on TS-7350

To:
Subject: [ts-7000] Potential problem reading RS-485 present status on TS-7350
From: "Sean" <>
Date: Wed, 12 Nov 2008 20:45:55 -0000
I'm trying to read the location 0x22400000 on my TS-7350 to determine
if RS-484 is installed, as per section 5.8 in the manual.  My code
below returns 0 for a read at that address however, and the board I
have should have RS485 installed.  Can anyone see anything incorrect
in my program or suggest what else could be going wrong?

-----------------------------------------------------------------
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>

/*
 * Simple program to determine if RS485 is installed on a TS-7350.
 * See section 5.8 of
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7300-linux/manuals/ts-7300-manual-rev1.4.pdf
 *
 */
int main() {

    int ret = EXIT_FAILURE;
    int fd = open("/dev/mem", O_RDWR|O_SYNC);

    if (fd != -1) {
        volatile unsigned char* p = mmap(0, getpagesize(), PROT_READ,
MAP_SHARED, fd, 0x22400000);
        if (p != MAP_FAILED) {
            printf("register value is 0x%02x\n", *p);
        }
        else {
            perror("mmap failed");
        }
        close(fd);
        ret = EXIT_SUCCESS;
    }
    else {
        perror("open failed");
    }

    return ret;
}



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

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] Potential problem reading RS-485 present status on TS-7350, Sean <=
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