ts-7000
[Top] [All Lists]

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

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


On Thu, 17 Jan 2013, khouryelie wrote:

> hello i am trying to use my COM2 port on the TS 7200 in RS-485 Full 
> duplex mode
> 
> apparently i have to change the mode register to hex 01 at physical 
> address 0x22C0_0000

I think you need to do a byte write - otherwise you are writing
hex 00 to 0x22C0_0000 0x22C0_0001 0x22C0_0002 and hex 01 to 0x22C0_0002
when you write the integer hex 01 to 0x22C0_0000

Just try changing Made to unsigned char *

Don't why you have the infinite loop!

> 
> 
> _______________________________________________
> the first is the code i tried to make
> 
> the second is provided within the Manuel 
> 
> can som1 point out my problem and why is it not working ?
> 
> ______________________________________________
> #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,v;
>       volatile unsigned int *Mode,*check;
> 
>       assert(fd != -1);
> 
>       fd = open("/dev/mem", O_RDWR | O_SYNC);
> 
>       Mode = (unsigned int 
> *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x22C00000);
> 
>       *Mode = 0x01;
> 
>       while(1)
>       {
>               *Mode = 0x01;
>               sleep(5);
>       }
> 
>       check = (unsigned int 
> *)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x22C00000);
>       printf("%p\n",check);
> 
> 
> }
> 
> 
> ________________________________________________
> 
> 
> 
> #include <linux/ts_sbc.h>
> #include <linux/include/asm/ioctls.h>
> #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
> mcr = AUTO485FD;
> //mcr = AUTO485HD; //for half duplex
> ioctl (fd, TIOC_SBCS485, &mcr);
> //write() and read() from fd
> ioctl (fd, TIOC_SBCC485, &mcr);
> //further reads() and writes() may not behave
> 
> 
> 
> 


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

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