How do you have the physical connection setup? The 7800 has 2 half
duplex 485 ports. If you use them together such that you read on one
port and write on the other, you have a single full duplex port. It
sounds like you did not actually clear bit 15 in register 0xE800000C to
set RS-485 on /dev/ttts2 and /dev/ttts3. If you search the list, you'll
find examples of how to clear the register and setup the port.
This is one way of clearing the correct bit:
#include <sys/mman.h>
#define BASE_ADDR 0xe8000000 // base address for FPGA
int fd_485 = open("/dev/mem", O_RDWR|O_SYNC);
unsigned int *rs;
unsigned int *start;
start = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd_485,
BASE_ADDR);
rs = (unsigned int *)(start + 0xc); // add in address offset
*rs = (*rs & 0xffff7fff); // clear bit 15 to enable RS-485 mode
munmap((void*)rs, getpagesize()); // unmap memory map
close(fd_485); // close fd
Robert
-----Original Message-----
From: On Behalf
Of ghughes400
Sent: Wednesday, March 23, 2011 4:04 PM
To:
Subject: [ts-7000] TS7800 Help with RS-485 option
I am working with the TS-7800.
I would like to use the RS-485 in full duplex mode. My code does not
seem to be working. I can see data going out but not back in. The online
manual says I have to set bit 15, in the fpga resister. Which I have
tried and doesnt seem to help any.
Is there any sample code of seting up the RS-485 full duplex correctly?
Thank you
Greg
------------------------------------
Yahoo! Groups Links
------------------------------------
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/
|