Searching \ for '[OT]: Delphi -> Radio Link -> PIC' 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/microchip/devices.htm?key=pic
Search entire site for: 'Delphi -> Radio Link -> PIC'.

Exact match. Not showing close matches.
PICList Thread
'[OT]: Delphi -> Radio Link -> PIC'
2001\01\15@060325 by David Duffy

flavicon
face
I want to use Delphi 5 with Async Pro 3 to talk to a remote
piece of equipment that has my PIC in it. The data link is a
radio-modem (UHF) that needs to be keyed on for 250ms or
so before sending the data. Does anyone know how to set
Async Pro to raise RTS before transmission of the data?
Using RS485 mode won't work as there is no real delay from
raising RTS & sending the data out in that mode. I could raise
RTS myself & wait to send the data using a timer component
but then there is no reliable way to know when the data has
finished being sent. (or is there?) Thanks in advance...
___________________________________________
David Duffy        Audio Visual Devices P/L
U8, 9-11 Trade St, Cleveland 4163 Australia
Ph: +61 7 38210362   Fax: +61 7 38210281
New Web: http://www.audiovisualdevices.com.au
New email: spam_OUTavdTakeThisOuTspamaudiovisualdevices.com.au
___________________________________________

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@070133 by Simon Nield

flavicon
face
simply send a bunch of garbage / sync bytes before your 'real' data, and ensure that your pic code
will ignore them if any of them do get through.
you know how many bits per second the link is running at, and how many bits are sent per byte (10 if
you are doing the usual 1start +8data +1stop) and how long you need to power the link up before the
data will get through reliably.

numberofpoweringupbytesneeded = (baudrate*poweruptime)/bitsperbyte

with poweruptime = 0.25

regards,
Simon

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@103054 by Bob Ammerman

picon face
Unfortunately, under Windows there is no way to know if all the bytes you
have written have been sent out the serial port. The bytes could be laying
around in any of several buffers--your application buffer for overlapped
I/O, the system buffers, the I/O driver buffer, buffers on an intelligent
serial card if present,  or even the UART's FIFO. This is true whether you
use a layer like AsyncPro or write directly to the Win32 API.

The best you can do, IMO, is to set up (timer component) delays based on the
length of the message. You basically 'hope' that Windows will blast the
characters out the line at full line speed, and that any jitter on your
timer won't exceed the limitations imposed by the far end device's
turnaround time.

This is yet one more limitation of Windows, and desktop OS's in general,
when trying to deal with the 'real-time' world.

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

{Original Message removed}

2001\01\15@104923 by Scott Newell

flavicon
face
>Unfortunately, under Windows there is no way to know if all the bytes you
>have written have been sent out the serial port. The bytes could be laying

You could tie the output of the serial port back in to a second serial
port, and wait for the last transmitted character to be received by the
second port.  Ugly and wasteful, I know.


>The best you can do, IMO, is to set up (timer component) delays based on the
>length of the message. You basically 'hope' that Windows will blast the

I generally use Async Pro and watch the OutBuffUsed variable.  When it goes
to zero, all the chars are out of the Windows buffer.  You've still got to
wait for the UART buffer to empty.


newell

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@110630 by Andy Faulkner

picon face
Why not simply setup your outbound and inbound  buffer
size the same, connect data out to data in on the same
serial port the after the data has been transmitted
check if the data was sent purly bny checking the
inbound buffer contents. or set the buffers to a
smaller capacity.






--- Bob Ammerman <EraseMERAMMERMANspam_OUTspamTakeThisOuTPRODIGY.NET> wrote:
{Quote hidden}

> {Original Message removed}

2001\01\15@173142 by David Duffy

flavicon
face
I don't have access to a second serial port and I'm already
using the receive line for the return data from remote end.

Andy Faulkner wrote:
{Quote hidden}

> > {Original Message removed}

2001\01\15@173719 by Ashley Roll

flavicon
face
Hi Everyone..

I'm new to this list, but I thought I'd answer this question as I know a bit
about Windows programming.. You will probably need to use lower level Win32
calls to do this however..

You're after the function WaitCommEvent(), it allows you to monitor for
events on the comm port including a char being received and all the TX
buffer being sent.. Even allows you to monitor for a BREAK, CTS & DSR
changes, Rings, etc.

Needs Win95 or better though..

For info:
http://msdn.microsoft.com/library/psdk/winbase/commun_4bck.htm

You should also look at SetCommState() as you may be able to use it to play
with the RTS signal.. I think there is another way to explicitly control RTS
from your program but can't remember it off hand.

Hope that helps, If you need more info please ask.

Cheers,
Ash.

[ other replies snipped ]

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@173936 by David Duffy

flavicon
face
Simon Nield wrote:
>simply send a bunch of garbage / sync bytes before your 'real' data, and
>ensure that
>your pic code will ignore them if any of them do get through. you know how
>many bits
>per second the link is running at, and how many bits are sent per byte (10
>if you are
>doing the usual 1start +8data +1stop) and how long you need to power the
>link up before
>the data will get through reliably.
>
>numberofpoweringupbytesneeded = (baudrate*poweruptime)/bitsperbyte
>with poweruptime = 0.25

That's not a bad idea - the baud rate is low (1200) so that should make it
about 30
dummy characters to add to front of the real packet. The packet is well
defined and
has a unique head character so the PIC will ignore any preamble characters.
I might
pick something line 55 hex to help the receiver stabilise nicely.
Regards...

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@174550 by David Duffy

flavicon
face
Ashley Roll wrote:
>I'm new to this list, but I thought I'd answer this question as I know a bit
>about Windows programming.. You will probably need to use lower level Win32
>calls to do this however..
>
>You're after the function WaitCommEvent(), it allows you to monitor for
>events on the comm port including a char being received and all the TX
>buffer being sent.. Even allows you to monitor for a BREAK, CTS & DSR
>changes, Rings, etc.
>
>Needs Win95 or better though..
>
>For info:
>http://msdn.microsoft.com/library/psdk/winbase/commun_4bck.htm
>
>You should also look at SetCommState() as you may be able to use it to play
>with the RTS signal.. I think there is another way to explicitly control RTS
>from your program but can't remember it off hand.

AsyncPro lets you manually control RTS _or_ use RS485 mode. I was going to
use RS485 mode, raise RTS early & let AsyncPro drop it after the packet's done
but the help says that the control modes are mutually exclusive. Bummer...
I think the preamble fudge/fix may be the easiest way to go.

{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body


2001\01\15@180707 by Bob Ammerman

picon face
----- Original Message -----
From: Ashley Roll <spamBeGoneashspamBeGonespamDIGITALNEMESIS.COM>
To: <TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU>
Sent: Monday, January 15, 2001 5:22 PM
Subject: Re: [OT]: Delphi -> Radio Link -> PIC


> Hi Everyone..
>
> I'm new to this list, but I thought I'd answer this question as I know a
bit
> about Windows programming.. You will probably need to use lower level
Win32
> calls to do this however..
>
> You're after the function WaitCommEvent(), it allows you to monitor for
> events on the comm port including a char being received and all the TX
> buffer being sent.. Even allows you to monitor for a BREAK, CTS & DSR
> changes, Rings, etc.

Wow, that's a new one on me! I knew about WaitCommEvent, but not about its
EV_TXEMPTY option.

Knowing the architecture of serial drivers under windows, I'd be a bit leary
about depending on this thing, though.

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

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body


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