* Regarding USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938
@ 2011-08-10 5:25 Raju Rameshwar Uprade
2011-08-10 9:34 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Raju Rameshwar Uprade @ 2011-08-10 5:25 UTC (permalink / raw)
To: Greg KH; +Cc: linux-kernel, linux-usb
Hello Greg,
I have purchased a USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938.
And I have written a user space program to communicate with my Rs-485 device at the
other end.The device at the other end expect 1 address byte with mark parity and rest of
the bytes with space parity.
Below is the userspace code which I have used for setting the Mark and Space parity bit.
// Send the first byte with mark parity-
attr.c_cflag |= PARENB;
attr.c_cflag |= CMSPAR;
attr.c_cflag |= PARODD;
tcsetattr(fd, TCSADRAIN, &attr);
write(fd, buff, 1); // It writes the address byte
// Send the rest with space parity
attr.c_cflag |= PARENB;
attr.c_cflag |= CMSPAR;
attr.c_cflag &= ~PARODD;
tcsetattr(fd, TCSADRAIN, &attr);
write(fd,buff+1,( length-1));
I can see the Data going out on the Scope when I terminate the userspace program using
Control+ C. But the device at the other end is not responding.
Kindly tell me Whether It can be done from userspace or I have to modify the device driver.
Regards,
Raj.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Regarding USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938
2011-08-10 5:25 Regarding USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938 Raju Rameshwar Uprade
@ 2011-08-10 9:34 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2011-08-10 9:34 UTC (permalink / raw)
To: Raju Rameshwar Uprade; +Cc: Greg KH, linux-kernel, linux-usb
On Wed, 10 Aug 2011 10:55:39 +0530
"Raju Rameshwar Uprade" <rajsingh@ncra.tifr.res.in> wrote:
>
> Hello Greg,
> I have purchased a USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938.
> And I have written a user space program to communicate with my Rs-485 device at the
> other end.The device at the other end expect 1 address byte with mark parity and rest of
> the bytes with space parity
Linux will be doing RS232/422 by default. If you are doing EIA-485 then
you also need to manage the transmitter and how that is handled is going
to depend upon the cable you have. It may need driver changes, it may
simply need you to manage the carrier assert and sometimes carrier
presence in order to implement the transmitter.
Really you'll need to look at the suppliers data sheets and see.
Alan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-08-10 9:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 5:25 Regarding USB-RS485 Cable Manufacturer: FTDI SerialNumber: FTU6Z938 Raju Rameshwar Uprade
2011-08-10 9:34 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®