ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS 7200 serial port at full duplex

To:
Subject: Re: [ts-7000] Re: TS 7200 serial port at full duplex
From: Jim Jackson <>
Date: Fri, 18 Jan 2013 17:18:02 +0000 (GMT)


On Fri, 18 Jan 2013, khouryelie wrote:

> 
> 
> --- In  "khouryelie"  wrote:
> >
> > 
> > thanks everyone but i am starting to think its not my code that's wrong 
> > it's just the cable connections
> > 
> > i am configuring with my code port COM2 to 485 FULL DUPLEX
> > but i am using a null modem cable THE SAME I USED TO TEST ports 232 and 
> > connecting that modem cable to a converter cable from 485 -> 232 then 
> > reading with minicom Through a 232 TO USB 
> > 
> > I think that sending from 485 port to a null modem( that was used with 
> > success with 232 ) is the mistake
> > 
> > ANYONE KNOW IF I should get A 485 null modem cable ? 
> > IS THERE ANY DIFFRENCE between NULL MODEM CABLES ? SOME FOR 232 QND OTHES 
> > FOR 485 FULL DUPLEX ?
> >
> 
> scratch that i am trying with loopback testing and its not working so i added 
> an if tester into my CODE:
> 
> #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,*comp;
> 
>         fd = open("/dev/mem", O_RDWR | O_SYNC);
>       if (fd == -1) 
>       {
>               perror("Error opening file for writing");
>       }
> 
>         base = (unsigned char 
> *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x22C00000);
>       if (base == MAP_FAILED)
>       {
>               perror ("mmap");
>               return 1;
>       }
>         comp = (unsigned char 
> *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x22C00000);
>       
>       *base = 0x01;
>       if(*base==*comp)
>               printf("ERROR \n");
> 
>         close(fd);    
> }
> 
> qnd actually it does return ERROR meaning the value didnt change so i guess 
> my code is wrong and i am not correctly going from 232 to 485 full duplex
> 

Why don't you just slow down and think about the code slowly and locically.

What are you testing with the final "if"? You have 2 pointers to the same 
memory location and testing if the values returned are equal - then 
declaring some sort of error - I think your logic is wrong.

This code is actually setting full duplex rs485 mode.
I do not understand your set up from your description, so cannot help.



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

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