Re: Low-level serial communication with USB2SERIAL converter
From: Byron A Jeff (byron_at_cc.gatech.edu)
Date: 10/16/04
- Next message: bgeer: "Re: Low-level serial communication with USB2SERIAL converter"
- Previous message: Yves Dufournaud: "Re: equivalent to CreateRemoteThread in linux ?"
- In reply to: Szymon Lukasik: "Re: Low-level serial communication with USB2SERIAL converter"
- Next in thread: Byron A Jeff: "Re: Low-level serial communication with USB2SERIAL converter"
- Reply: Byron A Jeff: "Re: Low-level serial communication with USB2SERIAL converter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 16 Oct 2004 17:45:14 -0400
In article <66256eff.0410131101.379a558f@posting.google.com>,
Szymon Lukasik <szymonl@poczta.onet.pl> wrote:
Sorry I'm slow getting back. It's been a busy week.
>> BAJ wrote...
>> Use the higher level interface that the driver provides you. That's why
>> it exists, so that you can access the serial port though it's connected
>> to a USB cable. There are no corresponding low level registers for you to
>> work with.
>>
>> A question: why do you need access to the low level registers? What
>> functionality are you looking for that requires direct register access.
>
>The first simple reason I wanted to use those low-level functions is
>... I've already implemented them. And for standard serial ports it's
>working fine...
But again you seem to miss the point. The whole point of a device driver
is to provide a consistent interface to an activity. You want to do serial.
The linux serial driver provides you all the functionality you need to
do serial with a standard serial port. The USB serial driver provides the
exact same functionality, except that it works on a USB serial cable.
By your application gets to see and use the same interface. Which of course
as you are now seeing is of great benefit.
>
>The use of higher level interface is not a problem for me... but
>there's one thing which is completely blocking my work. The
>Microcontroller's loader with 16Mhz quartz is communicating with my PC
>using baud-rate (14400) which is not implemented in termios.h (if I'm
>not wrong).
You can use setserial or its equivalent to get the correct bit rate.
Since 14400 is exactly 1/8 of 115200, which is a standard bit rate
for a PC serial port, you shold be able to get it no problem.
As to how it's done, setserial is a program that let's you set a custom
divisor that is applied when you set the bit rate to 38.4Kbps. So
set the divisor to 8, then set your bit rate to 38.4K and you're done.
>
>> Finally direct register access hurts you because then your application
>> must be run as root to gain access to the registers anyway.
>>
>> All the way around this is a poorly thought out path. So if you can come
>> back with an explanation of why you think you need register access and then
>> maybe we can figure out another path.
>
>Ok, so the problem is - how to set baudrate 14400 using C, under
>Linux, with the possibility of working with usb-serial converters?
See above. It's all done for you already.
BAJ
- Next message: bgeer: "Re: Low-level serial communication with USB2SERIAL converter"
- Previous message: Yves Dufournaud: "Re: equivalent to CreateRemoteThread in linux ?"
- In reply to: Szymon Lukasik: "Re: Low-level serial communication with USB2SERIAL converter"
- Next in thread: Byron A Jeff: "Re: Low-level serial communication with USB2SERIAL converter"
- Reply: Byron A Jeff: "Re: Low-level serial communication with USB2SERIAL converter"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|