ts-7000
[Top] [All Lists]

[ts-7000] Re: RS-485 full duplex sending and not recieving

To:
Subject: [ts-7000] Re: RS-485 full duplex sending and not recieving
From: "khouryelie" <>
Date: Fri, 01 Feb 2013 08:19:58 -0000
hello everyone,

it's

RX+ COM2 to TX+ (485 cable )
RX+ (485 cable ) to TX+ COM2
rx- COM2 to tx- (485 cable )
rx- (485 cable ) to tx- COM2

and it is not a cable problem, cause the cable supports full duplex and is 
working on another machine in full duplex

and i am failing to receive even in loopback test
i have tried loopback testing with 422 port it works 

the only problem i have is with 485 full duplex on my COM2 port on th ts-7200

this is from the program about RTS setting

#define TIOC_SBCC485 _IOW('T',0x70,int) /*TS RTS/485 mode Clear*/
#define TIOC_SBCS485 _IOW('T',0x71, int) /*TS RTS/485 mode Set */

i tried with RTS Set and clear and stil not receiving data

i strongly think it must be something i have to do in my program that is made 
to set COM2 to 485 FULL DUPLEX

_______________________________________

#include<unistd.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdio.h>
#include<fcntl.h>
#include<assert.h>
#include<linux/ts_sbc.h>
#include<asm/ioctls.h>
#include<sys/ioctl.h>

// futher info at 
http://wiki.embeddedarm.com/wiki/Linux_for_ARM_on_TS-72XX_User%27s_Guide#RS-485_Support_on_COM2


#define TIOC_SBCC485 _IOW('T',0x70, int) /*TS RTS/485 mode Clear*/
#define TIOC_SBCS485 _IOW('T',0x71, int) /*TS RTS/485 mode Set */
#define AUTO485FD 1
#define RTSMODE 2
#define AUTO485HD 4

int main(void)
{
        int fd,status;
        char mcr;
        fd = open("/dev/ttyAM1", O_RDWR | O_SYNC);
        if (fd == -1) 
        {
                perror("Error opening file for writing");
        }

        mcr = AUTO485FD;
        status=ioctl (fd, TIOC_SBCS485, &mcr);
        if(status==-1) 
        {
                printf("ERROR\n");
        }

}
________________________________________  or this 

#include<unistd.h>
#include<sys/types.h>
#include<sys/mman.h>
#include<stdio.h>
#include<fcntl.h>
#include<assert.h>

int main(void)
{       
        int fd;
        volatile unsigned char *base;

        fd = open("/dev/mem", O_RDWR | O_SYNC); // we open /dev/mem to acces 
read and write 
        if (fd == -1) 
        {
                perror("Error opening file for writing");
        }

        base = (unsigned char 
*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x22C00000); // map  
the user space file(/dev/mem) to memory and write at address 0x22C00000
        if (base == MAP_FAILED)
        {
                perror ("mmap");
                return 1;
        }
      
        *base = 0x01; // set value in 0x22C00000 to hex 01 

        close(fd);      
}




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

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