Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-08

Using /dev/ttyS1

7 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Thilo Berger

On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is to send and receive some characters (9600 8N1).
The things I've tried this night (fdopen etc.) all had no success. Is there someone who has already done this? Any hints about Documentation?

Thanks!

Thilo

Stefan Becker
to Thilo Berger

Hi Thio,
I have a simple programm for linux that does
just that. I can't find yout email address from
your post to that you might please email your
address to me and I will send you or any one
else the code.
BTW: I probably picked this programm code off
the freepascal website or other source. Look for
file seriell.pp

LUFA Speyer (EDV)
email:
tel : +49 (0)6232-629542
fax : +49 (0)6232-629544
http://www.lufa-speyer.de/

Show quoted text 25 lines
-----Original Message----- From: Behalf Of Thilo Berger Sent: Wednesday, August 22, 2001 11:39 PM To: Subject: [fpc-pascal]Using /dev/ttyS1 On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is to send and receive some characters (9600 8N1). The things I've tried this night (fdopen etc.) all had no success. Is there someone who has already done this? Any hints about Documentation? Thanks! Thilo _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
greim
to Thilo Berger: On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is…

Hi Thilo,

i based my code on example.pp of Brad Campbell (). it works very well !
(Thanks Brad !)

Markus Greim
http://www.schleibinger.com
---------------------------------------------------------------------

Thilo Berger wrote 15 lines
On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is to send and receive some characters (9600 8N1). The things I've tried this night (fdopen etc.) all had no success. Is there someone who has already done this? Any hints about Documentation? Thanks! Thilo _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Mauricio Stefani
to Thilo Berger: On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is…
Thilo Berger wrote 6 lines
On /dev/ttyS1 I have a small microcontroller application. The only thing I want to do is to send and receive some characters (9600 8N1). The things I've tried this night (fdopen etc.) all had no success. Is there someone who has already done this? Any hints about Documentation?

Hi :-)

I'm working with the same thing. A problem I got while writing this kind of code was about permissions... Se if your user has permissiom to write the device...

Or if you want I have some full-working procedures, please send me a mail at my work address () and tomorrow I give you some examples, ok?

by the way, wich uC are you using? In ineltec, we work with at89c55 ... maybe we could exchange some ideas (is that right? sorry but... english is not my primary language, heheh)

best regards,
Mauricio (from Brasil :-)

Brad Campbell
to greim: i based my code on example.pp of Brad Campbell (). it works very well ! (Thanks Brad !)…
greim wrote 6 lines
Hi Thilo, i based my code on example.pp of Brad Campbell (). it works very well ! (Thanks Brad !)

Your most welcome.. Nice to know it gets used :p)
I still use it also..
There are some issues with fast timing* turnarounds, but nothing that can't be solved by turning up the kernels HZ value a little :p)

* fast timing being less than 100msec

Brad.... /"\ Save the Forests \ / ASCII RIBBON CAMPAIGN Burn a Greenie. X AGAINST HTML MAIL / \
Thilo Berger
to Mauricio Stefani: Hi :-) I'm working with the same thing. A problem I got while writing this kind of code…
Mauricio Stefani wrote
I'm working with the same thing. A problem I got while writing this kind of code was about permissions... Se if your user has permissiom to write the device...

No, that's ok.

by the way, wich uC are you using? In ineltec, we work with at89c55 ... maybe we could exchange some ideas (is that right? sorry but... english is not my primary language, heheh)

I'll work with an AT89C52 to connect the I2C-Bus with my PC and give a litte intelligence to the bus.
The Pascal-Code should fetch some characters eg. values from the uC and should store it in a
MySQL-Database. So I have something like a little weather-station and could visualize it on the PC.

But I don't feel familiar with Pascal, because I still have a problem with the Code Stefan sent:

--- snip ---
If FD_ISSET(FD,FDS) then         {Have we data waiting in UART ? }
 Begin
         InLen := fdRead(FD,InStr[1],80);
         If InLen > 0 then
         For Loop := 1 to Inlen do
 Write(InStr[Loop]);
 End;
--- snip ---

Well, the Procedure looks if there is something in the UART and fetches it, writes it on the screen.
But how can I create a single string of that?
With something like "DA1=128<CR>" I can work, but on the stream from the uC I can't find
neither Chr(10) nor (13), but on the screen there still is a linebreak on the correct way .....

Any hints?

Thilo
Wermelskirchen, Germany.

Linux is like a wigwam: No windows, no gates, Apache inside :-)