Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RS232 Communication in C++ under Linux

Status
Not open for further replies.

foifsensej

Junior Member level 1
Junior Member level 1
Joined
Apr 8, 2004
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
117
Hello!

I would like to communicate with my microcontroller over the rs232 port. First i would just like to send some characters to the comport. Does anyone have some good tutourials for C/C++ under Linux? (Links, pdf?)

Thanks!
 

you will found it in howto directory
or in kernel documentation

you'll got the example in that file
 

there are two possibilities to access the serial port under linux:
- ioperm
- a kernel module

ioperm needs root login to be used and is because of this not very often seen in bigger projects but if you just need it for testing, it might be enough for you. Here google is your friend.

Writing a kernel module is quite "interesting" and consumes a lot of time.
I haven't written one yet, but I started doing it and aborted after around 30 hours of hacking and trying...
But you also could find a tutorial. The topic will probably be "General Hardware Access Kernel Module Development" or something like that.

I think a have seen a german book in the library called "MSR mit Linux" or something like that. If I find it again, I will post the infos here.
 

The Serial Programming Guide for POSIX Operating Systems.

This guide is organized into the following chapters and appendices:
Chapter 1, Basics of Serial Programming
Chapter 2, Configuring the Serial Port
Chapter 3, Talking to MODEMs
Chapter 4, Advanced Serial Programming
Appendix A, RS−232 Pinouts
Appendix B, ASCII Control Codes
 

Look for the serialhowto in the HowTo section of your Linux disitribution.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top