Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

How do I connect DIRECTLY to a serial port?

WSinc
New Contributor I
783 Views
I have a GPS device connected to my PC, hanging on COM1. I want to send and receive serial bytes to/from it. The baud rate is 9600.
Does this require special routines, or can the OPEN statement suffice, followed by READ and WRITE statements?
I tried accessing the SPORT_**** routines, but USE DFLIB does not allow me to use those. Maybe a different USE statement?
0 Kudos
4 Replies
Steven_L_Intel1
Employee
783 Views
If you're using Intel Fortran, try USE IFPORT. SPORT routines are the easiest route - OPEN and READ/WRITE won't work well for this and you can't set baud rates.
0 Kudos
WSinc
New Contributor I
783 Views
Unfortunately, I have the Compaq Fortran, version 6.6.
I did notice that some SPORT routinesDO allow me to set baud rate.
Are you saying these don't work properly?
0 Kudos
Steven_L_Intel1
Employee
783 Views
No, I didn't say that. The SPORT routines work fine as far as I know. But the documentation can be unclear, especially as it relates to setting the number of stop bits.
0 Kudos
Paul_Curtis
Valued Contributor I
783 Views
The att. module (posted here before) shows how to do serial communications in a Win32 environment (has to be totally opsys-specific, of course). This is probably more than you were looking for, in that this module addresses the issue of threadedness by creatinga thread for each port and conducting the serial i/o in separate threads, but that's the way to go.
Unfortunately, the SPORT routinesgot the threading model wrong, and are nonfunctional (ie, waste of time).
Regards, Paul Curtis
0 Kudos
Reply