Truncated match.
PICList
Thread
'SERIAL COMMS...'
1997\06\01@030055
by
David Howey
Hi everyone,
I've just got a PIC program up and running to drive two RC servos and an
LCD display and talk to the PC via RS232. Question is, how the heck do
you talk to the serial port from the PC (eg. in Pascal). I know how to
read/write to the parallel port - just simply do a "Port[$***] :=
whatever". But how's about the serial port? Can anyone help me out on
this?
Thanks
-Dave
* RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message man
ger.
1997\06\01@033836
by
Richard Katezansky
This may not be the answer your looking for, but why not just use a comm
program like Procomm or Crosstalk if your in DOS or one of the simple
terminal programs that comes with Windows. After all your just testing,
why write more code to debug.
Cheers.
At 07:13 PM 5/31/97 GMT, you wrote:
{Quote hidden}>Hi everyone,
>
>I've just got a PIC program up and running to drive two RC servos and an
>LCD display and talk to the PC via RS232. Question is, how the heck do
>you talk to the serial port from the PC (eg. in Pascal). I know how to
>read/write to the parallel port - just simply do a "Port[$***] :=
>whatever". But how's about the serial port? Can anyone help me out on
>this?
>Thanks
>-Dave
> * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible
message man
>ger.
>
>
******************************
Richard Katezansky
Tangent Electronics Ltd.
Montreal, Canada
******************************
1997\06\01@101423
by
yu94
David Howey wrote:
>
> Hi everyone,
>
> I've just got a PIC program up and running to drive two RC servos and an
> LCD display and talk to the PC via RS232. Question is, how the heck do
> you talk to the serial port from the PC (eg. in Pascal). I know how to
> read/write to the parallel port - just simply do a "Port[$***] :=
> whatever". But how's about the serial port? Can anyone help me out on
> this?
> Thanks
> -Dave
> * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message
man
> ger.
Yes,
You can 'bash' the hardware if you wish (I have done many times in the
past) but for a small sum of cash there are a number of good Pascal
comms libraries, in the UK the Grey Matter catalogue lists a few. If you
realy want to Do It Yourself I'm sure I can dig out some example code
that will work with Turbo Pascal 5 (or higher).
Paul Fletcher.
1997\06\01@112000
by
Darren Humphrey
David Howey wrote:
>
> Hi everyone,
>
> I've just got a PIC program up and running to drive two RC servos and an
> LCD display and talk to the PC via RS232. Question is, how the heck do
> you talk to the serial port from the PC (eg. in Pascal). I know how to
> read/write to the parallel port - just simply do a "Port[$***] :=
> whatever". But how's about the serial port? Can anyone help me out on
> this?
Try these ftp sites: oak.oakland.edu (or http://www.acs.oakland.edu) and
ftp.funet.fi. Both have good Pascal archives.
I'm pretty certain youi can just download a Turbo pascal "unit" that
has everything you want.
If not, check their C archives. There are definitely C routines
available that you could read and use as the basis of your code.
Darren
1997\06\01@124736
by
eric naus
part 0 745 bytes
I'd also be interested in seeing your code for your servo controller.
Hope this helps.
Bye for Now
Eric
At 07:13 PM 5/31/97 GMT, you wrote:
{Quote hidden}>Hi everyone,
>
>I've just got a PIC program up and running to drive two RC servos and an
>LCD display and talk to the PC via RS232. Question is, how the heck do
>you talk to the serial port from the PC (eg. in Pascal). I know how to
>read/write to the parallel port - just simply do a "Port[$***] :=
>whatever". But how's about the serial port? Can anyone help me out on
>this?
>Thanks
>-Dave
> * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message man
>ger.
>
Attachment converted: wonderland:Serial#.txt (TEXT/MSIE) (00002421)
1997\06\01@125152
by
eric naus
part 0 869 bytes
Ignore that last attachment. That was something I thought had to do
with a serial port comm. but turned out to be Ser #. I just haven't gotten
around to clear some of the garbage out. Sorry.
This attachment should work.
Bye Now
Eric
At 07:13 PM 5/31/97 GMT, you wrote:
{Quote hidden}>Hi everyone,
>
>I've just got a PIC program up and running to drive two RC servos and an
>LCD display and talk to the PC via RS232. Question is, how the heck do
>you talk to the serial port from the PC (eg. in Pascal). I know how to
>read/write to the parallel port - just simply do a "Port[$***] :=
>whatever". But how's about the serial port? Can anyone help me out on
>this?
>Thanks
>-Dave
> * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message man
>ger.
>
Attachment converted: wonderland:Serv.bas (TEXT/MSIE) (00002422)
1997\06\01@133512
by
nigelg
|
In message <spam_OUT97060107300835355TakeThisOuT
shades.nildram.co.uk> .....PICLISTKILLspam
@spam@MITVMA.MIT.EDU
writes:
> I've just got a PIC program up and running to drive two RC servos and an
> LCD display and talk to the PC via RS232. Question is, how the heck do
> you talk to the serial port from the PC (eg. in Pascal). I know how to
> read/write to the parallel port - just simply do a "Port[$***] :=
> whatever". But how's about the serial port? Can anyone help me out on
> this?
You just need to either write, or download (there are LOTS out there), a
serial comms unit. Then its a simple matter to do serial comms from
Turbo Pascal. If you can't find anything suitable, E-Mail me direct and
I'll send you a suitable unit.
BTW, what exactly are you wanting to do at the PC end?.
Nigel.
/--------------------------------------------------------------\
| Nigel Goodwin | Internet : nigelg
KILLspamlpilsley.demon.co.uk |
| Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk |
| Chesterfield | |
| England | |
\--------------------------------------------------------------/
1997\06\01@144447
by
Eric Martens
|
Thanks for the serial numbers. it isn't the stuff we're used to on this mailing
list, but
is was a big help for me. There were a few serial numbers that i didn't have,
Thanks.
Greetings Eric Martens
***************************
* Eric Martens *
* .....emarKILLspam
.....knoware.nl *
**************************
----------
| From: eric naus <EraseMEbinespam_OUT
TakeThisOuTIDIRECT.COM>
| To: PICLIST
spam_OUTMITVMA.MIT.EDU
| Subject: Re: SERIAL COMMS...
| Date: zondag 1 juni 1997 18:50
|
| Hi, again
|
| Ignore that last attachment. That was something I thought had to do
| with a serial port comm. but turned out to be Ser #. I just haven't gotten
| around to clear some of the garbage out. Sorry.
| This attachment should work.
|
| Bye Now
|
| Eric
| At 07:13 PM 5/31/97 GMT, you wrote:
| >Hi everyone,
| >
| >I've just got a PIC program up and running to drive two RC servos and an
| >LCD display and talk to the PC via RS232. Question is, how the heck do
| >you talk to the serial port from the PC (eg. in Pascal). I know how to
| >read/write to the parallel port - just simply do a "Port[$***] :=
| >whatever". But how's about the serial port? Can anyone help me out on
| >this?
| >Thanks
| >-Dave
| > * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message
man
| >ger.
| >
|
1997\06\01@171935
by
eric naus
|
Hi,
Once again Sorry, it shouldn't have been posted.
Bye Now
Eric
At 08:40 PM 6/1/97 +0200, you wrote:
{Quote hidden}>Thanks for the serial numbers. it isn't the stuff we're used to on this mailing
> list, but
>is was a big help for me. There were a few serial numbers that i didn't have,
> Thanks.
>
>Greetings Eric Martens
>
>***************************
>* Eric Martens *
>*
@spam@emarKILLspam
knoware.nl *
>**************************
>
>----------
>| From: eric naus <
KILLspambineKILLspam
IDIRECT.COM>
>| To:
RemoveMEPICLISTTakeThisOuT
MITVMA.MIT.EDU
>| Subject: Re: SERIAL COMMS...
>| Date: zondag 1 juni 1997 18:50
>|
>| Hi, again
>|
>| Ignore that last attachment. That was something I thought had to do
>| with a serial port comm. but turned out to be Ser #. I just haven't gotten
>| around to clear some of the garbage out. Sorry.
>| This attachment should work.
>|
>| Bye Now
>|
>| Eric
>| At 07:13 PM 5/31/97 GMT, you wrote:
>| >Hi everyone,
>| >
>| >I've just got a PIC program up and running to drive two RC servos and an
>| >LCD display and talk to the PC via RS232. Question is, how the heck do
>| >you talk to the serial port from the PC (eg. in Pascal). I know how to
>| >read/write to the parallel port - just simply do a "Port[$***] :=
>| >whatever". But how's about the serial port? Can anyone help me out on
>| >this?
>| >Thanks
>| >-Dave
>| > * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible message
> man
>| >ger.
>| >
>|
>
1997\06\01@205203
by
Matt Calder
On serial comms,
I didn't see anybody else mention it so, under the Win32 API
serial ports are accessed using CreateFile(), ReadFile(), and WriteFile()
where the 'file' is COM1, COM2, etc... I've never done this mind you and
am just looking at "About Communications" in the Win32 SDK.
Matt
/*****************************************/
/* Matt Calder, Dept. of Statistics, CSU */
/* http://www.stat.colostate.edu/~calder */
/*****************************************/
1997\06\02@032929
by
STEENKAMP [M.ING E&E]
* This message contains the file 'SERIAL.TXT', which has been
* uuencoded. If you are using Pegasus Mail, then you can use
* the browser's eXtract function to lift the original contents
* out to a file, otherwise you will have to extract the message
* and uudecode it manually.
end
Attachment converted: wonderland:SERIAL.TXT (TEXT/CSOm) (00002446)
1997\06\02@032933
by
STEENKAMP [M.ING E&E]
|
Hi,
I have included a short text file that describes the ports of the UART on
the PC. It comes from a utility program called HelpPC.
The basic steps for using the UART in polled mode is to:
1. Set DLAB bit in LCR
2. Set Baud Rate divisor low byte and high byte (Divisor=115200/BRWanted)
3. Clear DLAB and set up other bits in LCR
Now simply write to the data register to transmit or look at the receive
flag in the lsr for receiving.
Ask if the above is a bit cryptic!
Niki
At 07:13 PM 5/31/97 GMT, you wrote:
{Quote hidden}>Hi everyone,
>
>I've just got a PIC program up and running to drive two RC servos and an
>LCD display and talk to the PC via RS232. Question is, how the heck do
>you talk to the serial port from the PC (eg. in Pascal). I know how to
>read/write to the parallel port - just simply do a "Port[$***] :=
>whatever". But how's about the serial port? Can anyone help me out on
>this?
>Thanks
>-Dave
> * RM 1.2 * Eval Day 558 * RoboMail -- The ultimate QWK compatible
message man
>ger.
1997\06\02@080855
by
Mike Smith
|
> From: Matt Calder <spamBeGonecalderspamBeGone
STAT.COLOSTATE.EDU>
> To: TakeThisOuTPICLISTEraseME
spam_OUTMITVMA.MIT.EDU
> Subject: Re: SERIAL COMMS...
> Date: Monday, 2 June 1997 10:21
>
> On serial comms,
>
> I didn't see anybody else mention it so, under the Win32 API
> serial ports are accessed using CreateFile(), ReadFile(), and WriteFile()
> where the 'file' is COM1, COM2, etc... I've never done this mind you and
> am just looking at "About Communications" in the Win32 SDK.
>
Thats one way of doing it - and it works well. I'm currently working on
some c++ classes that encapsulate all of the handles, DCB's and other junk
you need to track when going this route. If you don't need to send NULL's
down the line, you can use the OCX solution(MSCOMM16.OCX; MSCOMM32.OCX) -
it's really easy to implement, apart from that one glaring omission - if
you use ascii it isn't even a problem.
MikeS
<RemoveMEmikesmith_oz
TakeThisOuTrelaymail.net>
PS BTW that is *embedded* nulls - nulls at the end of a string are OK - in
fact, it's because it uses null-terminated strings as its input that its a
problem for binary.
1997\06\02@081227
by
mike
In message <97060107300835355EraseME
.....shades.nildram.co.uk> EraseMEPICLIST
MITVMA.MIT.EDU
writes:
> Hi everyone,
>
> I've just got a PIC program up and running to drive two RC servos and an
> LCD display and talk to the PC via RS232. Question is, how the heck do
> you talk to the serial port from the PC (eg. in Pascal). I know how to
> read/write to the parallel port - just simply do a "Port[$***] :=
> whatever". But how's about the serial port? Can anyone help me out on
> this?
Dave,
Check out the SWAG archives - available from many places including the
demon ftp site in the UK. (ftp.demon.co.uk)
I don't have the full URL to hand, but if you can't find it, e-mail me
and I'll dig it out for you.
Regards,
Mike Watson
1997\06\02@192219
by
Andy Kunz
part 0 641 bytes
Sorry it's taken so long.
Enjoy. This is something we did and have used in several apps under DOS.
There was a bug at one point when you had multiple ports open, but I think
this is the fixed version.
Also available in C.
Andy
Attachment converted: wonderland:Serialco.pas (TEXT/MSIE) (000024CB)
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\06\03@030151
by
David Howey
|
TT> This may not be the answer your looking for, but why not just use a
TT> comm program like Procomm or Crosstalk if your in DOS or one of the
TT> simple terminal programs that comes with Windows. After all your
TT> just testing, why write more code to debug.
Um, it's not the answer I was looking for.. I've already tried this.
Works fine as long as you're not trying to send b'00000000' [ie. <alt>-
0] which my terminal emulator seems to not like - must be a special
control code or something. I've programmed the PIC to recognize 0, 1,
and 2 incoming and branch to various servo test routines respectively..
I can get the "1" and "2" routines to work (they just drive the servos
to a specified position) but the "0" routine (which cycles the servos
back and forth between extremes) is just waiting to be sent a zero! I
tried running Microsoft Diagnostics (yes, an old program) which told me
the com port I was using was at $02F8 (I think), so I then wrote a
Pascal program to send a zero to this address, and it worked
intermittently, but I don't really know what I'm doing, so I'd better
find out exactly how the serial port works!
Thanks to everyone else who helped out.
-Dave
* RM 1.2 * Eval Day 559 * RoboMail -- Version 1.2 -- Available now!
1997\06\03@033542
by
Ross McKenzie
|
At 09:09 PM 6/1/97 GMT, you wrote:
{Quote hidden}>TT> This may not be the answer your looking for, but why not just use a
>TT> comm program like Procomm or Crosstalk if your in DOS or one of the
>TT> simple terminal programs that comes with Windows. After all your
>TT> just testing, why write more code to debug.
>
>Um, it's not the answer I was looking for.. I've already tried this.
>Works fine as long as you're not trying to send b'00000000' [ie. <alt>-
>0] which my terminal emulator seems to not like - must be a special
>control code or something. I've programmed the PIC to recognize 0, 1,
>and 2 incoming and branch to various servo test routines respectively..
>I can get the "1" and "2" routines to work (they just drive the servos
>to a specified position) but the "0" routine (which cycles the servos
>back and forth between extremes) is just waiting to be sent a zero! I
>tried running Microsoft Diagnostics (yes, an old program) which told me
>the com port I was using was at $02F8 (I think), so I then wrote a
>Pascal program to send a zero to this address, and it worked
>intermittently, but I don't really know what I'm doing, so I'd better
>find out exactly how the serial port works!
>
>Thanks to everyone else who helped out.
David,
I cannot claim any experience with PIC devices yet, but have programmed
serial comms in Clipper quite a bit. Could I suggest, even if it is late in
your development cycle, that you consider sending your commands in plain old
ASCII format instead of binary. The major reason is that during testing you
can type it at the port directly from your keyboard or via a file or even
the terminal programs like Telix, Procomm etc. Whats more you can capture
the command data stream later by evesdropping on the comms line with Telix
also.
What is the difference you say? Well, nothing really. You are still sending
an 8 bit command string. Your all zeros binary "0" ( 00Hex) is actually the
NULL character which most comms programs choke on. ASCII 0 is binary
00110000 or 30Hex. Same number of bits transmitted, but far less hassles
during trouble shooting. "1" is 31Hex etc, so should only involve a few
minor masking changes to your incoming data checking code.
Grab yourself a copy of the ASCII code table and have a look.
PS Sorry if you are already aware of the above but have good reasons for
doing what you are.
Regards,
Ross McKenzie
Melbourne Australia
1997\06\03@034157
by
David BALDWIN
Is it possible to have Serialco.pas in C please?
1997\06\03@082327
by
Andy Kunz
part 0 553 bytes
The missing parts are self-explanatory. I'd have to send you the whole
thing...
Andy
Attachment converted: wonderland:Rs232.c (TEXT/MSIE) (000024CF)
Attachment converted: wonderland:Rs232.h (TEXT/MSIE) (000024D0)
==================================================================
Andy Kunz - Montana Design - 409 S 6th St - Phillipsburg, NJ 08865
Hardware & Software for Industry & R/C Hobbies
"Go fast, turn right, and keep the wet side down!"
==================================================================
1997\06\03@111100
by
wterreb
|
In message <RemoveME97060107300835355EraseME
EraseMEshades.nildram.co.uk>
>
RemoveMEPICLISTspam_OUT
KILLspamMITVMA.MIT.EDU
writes:
> Hi everyone,
>
> I've just got a PIC program up and running to drive
> two RC servos and an LCD display and talk to the PC
> via RS232. Question is, how the heck do you talk to
> the serial port from the PC (eg. in Pascal). I know
> how to read/write to the parallel port - just simply
> do a "Port[$***] := whatever". But how's about the
> serial port? Can anyone help me out on this?
I always use a program library called RTK (Real Time Kernal) which
I just link in with my normal C programs. This kernel takes over all
the overheads and give you a nice clean interface to you serial
ports. To use it you only have to link in one small library, and
you've got easy access to the serial port. RTK also offers a whole
range of other usefull real time features.
Rgds
Werner
--
Werner Terreblanche http://www.aztec.co.za/users/werner
RemoveMEwterrebTakeThisOuT
spamplessey.co.za (work) OR EraseMEwernerspam
spamBeGoneaztec.co.za (home)
Plessey SA, PO Box 30451,Tokai 7966, Cape Town, South Africa
or at home : Suite 251, PostNet X5061, Stellenbosch, 7599
Tel +27 21 7102251 Fax +27 21 7102886 Home +27 21 8872196
------------------------------------------------------------
1997\06\04@133401
by
David Howey
|
NN> You just need to either write, or download (there are LOTS out
NN> there), a serial comms unit. Then its a simple matter to do serial
NN> comms from Turbo Pascal. If you can't find anything suitable, E-Mail
NN> me direct and I'll send you a suitable unit.
Yeah, loads of people have told me this (thanks to everyone else too)..
I'm gonna check out some stuff on the web as soon as I can.
NN> BTW, what exactly are you wanting to do at the PC end?.
.. well (sheepish grin) I'm actually just using the PC as a glorified
keypad <ha ha ha>.. since I couldn't be asked to add some switch inputs
to my PIC circuit and the credit card sized PIC board that I've built
already has a serial port..
But the stupid terminal emulation program that I was using (Norton
Commander's, I think) just WON'T send b'00000000'. Must be a special
control code or something. I tried a couple of other programmes too, but
to no avail.
See ya
-Dave
* RM 1.2 * Eval Day 560 * RoboMail -- Version 1.2 -- Available now!
1997\06\05@020808
by
nigelg
|
In message <RemoveME97060418003435555KILLspam
shades.nildram.co.uk> PICLISTSTOPspam
spam_OUTMITVMA.MIT.EDU
writes:
> NN> BTW, what exactly are you wanting to do at the PC end?.
> .. well (sheepish grin) I'm actually just using the PC as a glorified
> keypad <ha ha ha>.. since I couldn't be asked to add some switch inputs
> to my PIC circuit and the credit card sized PIC board that I've built
> already has a serial port..
> But the stupid terminal emulation program that I was using (Norton
> Commander's, I think) just WON'T send b'00000000'. Must be a special
> control code or something. I tried a couple of other programmes too, but
> to no avail.
A b'00000000' is an EOF (end of file) code, so in order to send it the output
must be opened as a binary file, as a normal text file it signifies the end
of the file. Any of the usual serial units overcomes this problem by driving
the hardware directly, bypassing the usual DOS routines.
Nigel.
/--------------------------------------------------------------\
| Nigel Goodwin | Internet : spamBeGonenigelgSTOPspam
EraseMElpilsley.demon.co.uk |
| Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk |
| Chesterfield | |
| England | |
\--------------------------------------------------------------/
1997\06\05@023255
by
Ross McKenzie
|
At 11:37 PM 6/4/97 GMT, you wrote:
>In message <KILLspam97060418003435555spamBeGone
shades.nildram.co.uk> EraseMEPICLIST
EraseMEMITVMA.MIT.EDU
> writes:
>> NN> BTW, what exactly are you wanting to do at the PC end?.
>> .. well (sheepish grin) I'm actually just using the PC as a glorified
>> keypad <ha ha ha>.. since I couldn't be asked to add some switch inputs
>> to my PIC circuit and the credit card sized PIC board that I've built
>> already has a serial port..
>> But the stupid terminal emulation program that I was using (Norton
>> Commander's, I think) just WON'T send b'00000000'. Must be a special
>> control code or something. I tried a couple of other programmes too, but
>> to no avail.
>
>A b'00000000' is an EOF (end of file) code,
Bzzzt. Wrong! The b'00000000' is the NULL. EOF is 1AHex, 26Dec, b'00011010'.
Refer to any Peter Norton book on DOS if you need to see it in another print
form.
If you have a file containing the NULL, it can be copied from the keyboard
via the DOS command COPY TEST.FIL /b > COM1 The /b invokes a binary copy
mode thereby allowing the NULL to be sent/copied where ever. The MODE
command will set up the com port for bits, baud etc.
Regards,
Ross McKenzie
Melbourne Australia
1997\06\05@103711
by
John Payson
> If you have a file containing the NULL, it can be copied from the keyboard
> via the DOS command COPY TEST.FIL /b > COM1 The /b invokes a binary copy
> mode thereby allowing the NULL to be sent/copied where ever. The MODE
> command will set up the com port for bits, baud etc.
On both the PC BIOS and DOS, a null character code is used to flag special
keys. In the case of the BIOS, a key such as an arrow will return a char-
acter code of 0 and a scan code indicating what key was pressed. DOS will
normally ignore scan codes, but if a key's character code is zero, the key
will be registered as a zero byte followed by the scancode byte.
The "null" key (ctrl-2) has a character code of 0 and a scan code of 3. A
terminal program which is specifically set to look for this key will be
able to process it, but without special coding the key will not work. DOS
copy CON: won't work with ^@ (it will be placed in the file as ^@^C).
1997\06\06@020940
by
nigelg
1997\06\06@133345
by
David Howey
|
Hi,
RR> What is the difference you say? Well, nothing really. You are still
RR> sending an 8 bit command string. Your all zeros binary "0" ( 00Hex)
RR> is actually the NULL character which most comms programs choke on.
RR> ASCII 0 is binary 00110000 or 30Hex. Same number of bits
RR> transmitted, but far less hassles during trouble shooting. "1" is
RR> 31Hex etc, so should only involve a few minor masking changes to
RR> your incoming data checking code.
Good idea to get around the comms program 'choking' (he he), although I
was just using a bit of 'quick and dirty' code on the PIC that simply
checked whether the file register where the inputted data byte (from the
PC) was stored equalled zero (this is really easy to do on the PIC). I
can modify the code to subtract 30hex off it first I guess :-)
However I've had loads of people send me useful snippets of Pascal (and
whole units..) which is great (thanks again to all) so I think I'll just
use that for now. Thanks for your suggestion though..
See ya
-Dave
* RM 1.2 * Eval Day 562 * RoboMail -- The ultimate QWK compatible message man
ger.
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- Today
- New search...