Searching \ for '%serial port communication%' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/serials.htm?key=serial
Search entire site for: 'serial port communication'.

_Sub string match.
PICList Thread
'PC serial port communication program'
1999\02\10@010521 by Wagner Lipnharski

picon face
Hello members, I just put available as freeware a new
  PC DOS software (only 1536 bytes) that allows you to
  "copy" a file to the communication port COM1, 2, 3, 4
  at speeds of 1200, 2400, 4800, 9600, specified at the
  command line fashion.  It checks RS232 lines as CTS
  and DSR, if they are down it just inform the user but
  it doesn't stop the file transfer.  It is pretty nice
  to test microcontroller communication software, or
  just to transfer some file, even to print to serial
  printers.  I doesn't use other RS232 lines than TX
  and ground, so a simple two wire cable does the trick.

  This was exactly the reason to produce this software,
  since the traditional DOS command COPY /B file COM1:
  doesn't transfer if DSR or CTS is down, and you need
  to set the port speed before issue the copy command.

  DOS command line is   COPY2COM FILENAME.EXT /PS
  where P is the port as A,B,C,D for COM1,2,3,4
  and S is the speed as 1,2,4,9 for 1200,2400,4800,9600.

  Program:  COPY2COM.EXE - size 1536 bytes, feb 09 1999.

  Download it from http://www.ustr.net  8051-files button.

  Have fun,

  Wagner Lipnharski
  UST Research Inc
  http://ustr.net

1999\02\10@085944 by PDRUNEN

picon face
In a message dated 99-02-10 01:05:25 EST, you write:

<< http://www.ustr.net >>

Will this work on winNT verison 4.0?

1999\02\10@101218 by Wagner Lipnharski

picon face
Man... I don't know.  I have problems even to make
  it works fine under Windows95/98 DOS partition...
  that insist in change some port lines from time
  to time without any reason.  Also, a time dependent
  program running in a Windows DOS partition will
  always suffer because the Windows timeshare. Up to
  now the only way (that I know) to avoid any Windows
  interference problems is run the machine in pure
  DOS or reboot the machine in DOS only.

  If any of you know how to control it make Windows
  keep quiet during a Windows DOS partition program
  is running ... I would like to know, and would
  appreciate so much the help.

  Wagner Lipnharski
  UST Research Inc.
  http://ustr.net


> Will this work on winNT verison 4.0?


'[OT]:serial port communication'
2001\07\10@090120 by sam woolf
flavicon
picon face
I'm having a bit of a nightmare doing serial port communication between a computer and a 16f84. The pic is sending data at 19200 baud to the computer. I have been using a c program based on craig peacock's at http://www.beyondlogic.org/serial/termpoll.c . But unfortunately I am losing significant amounts of data. I think this is because the code needs to be interrupt driven but I can't get the interrupt driven version (http://www.beyondlogic.org/serial/buff1024.c )to work... My compiler does not like the weird pointer-to-function or whatever it is stuff going on with the interrupt function and I cant get my head around what its supposed to be doing either... I'm using microsoft visual c++ 5.0 and have already had to make several adjustments such as changing all the inportb()s to _inp()s... does anyone know what I need to do to make this work, or does anyone have any simple to understand and working microsoft visual c++ 5.0 code for doing interrupt driven serial comms?? I know this is slightly off topic but I am at my wits end!!
SW

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\07\10@095732 by Ashley Roll
flavicon
face
Hi Sam,

Unfortunately I think your probably attacking this from the wrong way if
you're running this under Windows 95/99/ME/NT/2000 (Win32). Code the
directly access registers and interrupts is doomed to fail.

Basically Windows protects direct access to interrupts and IO ports so that
multiple programs will play together nicely. You need to use the windows
provided serial functions.

Look at the SetCommState() function to setup the serial port, CreateFile()
to open a serial port (Name is "COM1" or something like that from memory).
VC++ should have help on these.. if not look on http://msdn.microsoft.com.
You then use WriteFile() and ReadFile() to send and read data, and you can
configure "Event" (kind of like interrupts) using SetCommMask(). You may be
able to find examples in the MSDN site for all this stuff.

The event driven stuff is tricky to get your head around in windows if you
haven't played with it before.

If you don't need to know EXACTLY when a new character arrives, or the state
of the CTS/DSR lines etc change, then it is not too difficult.

You can open the serial port with CreateFile("COM1", .....), use
GetCommState() to retrieve the current settings (speed etc) and
SetCommState() to alter them to be what you need, then you can sit in a loop
using ReadFile() to read incoming data. If you need to send data to the
device, use WriteFile(). Then CloseHandle() when your finished.

Let me know if I can be more help.

Good luck.
Ash.

> {Original Message removed}

2001\07\10@100329 by Eisermann, Phil [Ridg/CO]

flavicon
face
       If you're writing a WIN application, you probably want to look at
CreateFile, ReadFile() and WriteFile() instead of _inp(). VC++ has
documentation on these. Contrary to what it says, you do not need to write a
threaded application; i wrote a serial port programmer for an ADuC812 using
these functions and polling at 9600 baud. I can send you code snippets for
opening the file, reading, and writing if you want. That will give you
something to base your stuff on.


> {Original Message removed}

2001\07\10@145411 by Simon Redwood

flavicon
picon face
Reply To: "Simon Redwood" <.....spredwoodKILLspamspam@spam@sri-net.demon.co.uk>
X-Mailer: ELM [version 2.4ME+ PL60 (25)]
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

I too am having a bit of an nightmare trying to use the seral and paralle
ports for a programmer under Windows.
Dos/Unix works great, but Win9x is a real mare.

If you could possibly also send me those snippets, I would be most grateful.

Thanks in advance,
Simon


>         If you're writing a WIN application, you probably want to look at
> CreateFile, ReadFile() and WriteFile() instead of _inp(). VC++ has
> documentation on these. Contrary to what it says, you do not need to write a
> threaded application; i wrote a serial port programmer for an ADuC812 using
> these functions and polling at 9600 baud. I can send you code snippets for
> opening the file, reading, and writing if you want. That will give you
> something to base your stuff on.
>
>
> > {Original Message removed}

2001\07\10@162448 by Bob Ammerman

picon face
You cannot direcly access ports from a Win32 program!

This is looking for trouble.

You want to use the Win32 comms API.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

{Original Message removed}

2001\07\10@173735 by Eisermann, Phil [Ridg/CO]

flavicon
face
I've responded privately to code requests to avoid attachments. Anyone think
this should be in some sort of FAQ? Plenty of stuff for DOS, but little for
windows that I have seen. Is there something out there already, or is there
a need to create it?

> {Original Message removed}

2001\07\11@041939 by G. Cadman

picon face
Sam,

I have tried this myself with VC++ and found it a bit of a nightmare. In the end I opted for using VB ver 6, with the module MSCOMM. There are some very good examples. You could use one of the ONCOMM events to detect for a TX.
I managed to write my modest program in about 4 hrs after reading this. Some of the documentation is a bit hard to find but it its there.
http://support.microsoft.com/support/kb/articles/Q262/8/83.ASP

Regards

Gary

sam woolf wrote:

> I'm having a bit of a nightmare doing serial port communication between a computer and a 16f84. The pic is sending data at 19200 baud to the computer. I have been using a c program based on craig peacock's at http://www.beyondlogic.org/serial/termpoll.c . But unfortunately I am losing significant amounts of data. I think this is because the code needs to be interrupt driven but I can't get the interrupt driven version (http://www.beyondlogic.org/serial/buff1024.c )to work... My compiler does not like the weird pointer-to-function or whatever it is stuff going on with the interrupt function and I cant get my head around what its supposed to be doing either... I'm using microsoft visual c++ 5.0 and have already had to make several adjustments such as changing all the inportb()s to _inp()s... does anyone know what I need to do to make this work, or does anyone have any simple to understand and working microsoft visual c++ 5.0 code for doing interrupt driven serial comms?? I know this is slightly off topic but I am at my wits end!!
> SW
>
> --
> http://www.piclist.com hint: To leave the PICList
> piclist-unsubscribe-requestspamKILLspammitvma.mit.edu

--


Information in this communication and any attachments are confidential,
and may not be copied or used by anyone other than the addressee, nor
disclosed to any third party without our permission. If you have received
this communication in error, please notify the sender immediately and then
destroy any copies of it. There is no intention to create any legally
binding contract or other commitment through the use of this email.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\07\11@072627 by ISO-8859-1?Q?Ruben_J=F6nsson?=

flavicon
face
Hi sam

I use an ActiveX control to do serial comm on VC++6. This control is
called CommX and is from GreenLeaf Software. It basically does the
hardware handling on the PC and gives You methods, properties and
events instead.

For a free alternative check out

http://codeproject.com/system/cserialport.asp

which is a MFC class to wrap access to the Win32 APIs dealing with
serial ports. I havn't tried this myself, though.

I have also been told that in the free software section at
http://www.taltech.com there should be a C/C++ code example of a terminal
program. Have not checked this myself either.


Regards Ruben


Date sent:              Tue, 10 Jul 2001 13:55:40 +0100
Send reply to:          pic microcontroller discussion list
<.....PICLISTKILLspamspam.....MITVMA.MIT.EDU>
From:                   sam woolf <EraseMEsamwspam_OUTspamTakeThisOuTCOGS.SUSX.AC.UK>
Subject:                [OT]:serial port communication
To:                     PICLISTspamspam_OUTMITVMA.MIT.EDU

> I'm having a bit of a nightmare doing serial port communication
> between a computer and a 16f84. The pic is sending data at 19200
baud
> to the computer. I have been using a c program based on craig
> peacock's at http://www.beyondlogic.org/serial/termpoll.c . But
unfortunately
> I am losing significant amounts of data. I think this is because the
> code needs to be interrupt driven but I can't get the interrupt
driven
> version (http://www.beyondlogic.org/serial/buff1024.c )to work... My
compiler
> does not like the weird pointer-to-function or whatever it is stuff
> going on with the interrupt function and I cant get my head around
> what its supposed to be doing either... I'm using microsoft visual
c++
> 5.0 and have already had to make several adjustments such as
changing
> all the inportb()s to _inp()s... does anyone know what I need to do
to
{Quote hidden}

==============================
Ruben Jvnsson
AB Liros Elektronik
Box 9124, 200 39 Malmv, Sweden
TEL INT +46 40142078
FAX INT +46 40947388
KILLspamrubenKILLspamspampp.sbbs.se
==============================

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...