Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

?? PC control of PIC via Series COM port ??

Status
Not open for further replies.

hawk2eye

New Member
?? How can a Windows XP computer control the <Series COM port> ??

Electronics external to the computer are controlled via
<Series COM port>. There are numerous articles on the connection, speed, etc, but ...

NOwhere have I found a detailed description of the program within the computer that does this output/input function.

Question:
1. MUST the controlling program be purchased ??

please give details.

The price should reflect the need for a program with only say 64 bytes
to control 64 subroutines in a PIC micro controller.

marty
 
?? Windows XP computer control <Series COM port > ??

Mike,
I have a Windows XP computer with a BASIC program < Liberty Basic >
which can input/output on the <Series COM port>> , though I have never done this.

QUESTION:
1. Is there a simple way to input/output 64 x 8bit data to a PIC micro controller from the computer through the < Series COM port> ??

2. Is there another way that you can suggest ??

Thanks for your reply,

marty
------
 
Re: ?? Windows XP computer control <Series COM port >

hawk2eye said:
Mike,
I have a Windows XP computer with a BASIC program < Liberty Basic >
which can input/output on the <Series COM port>> , though I have never done this.

QUESTION:
1. Is there a simple way to input/output 64 x 8bit data to a PIC micro controller from the computer through the < Series COM port> ??

Just send 64 bytes of data out the serial port to write to the PIC, and send 64 bytes back to write to the PC.

2. Is there another way that you can suggest ??

Not without knowing more about what you are trying to do?.
 
PC control of PIC micro controller

Mike,
< Just send 64 bytes of data out the serial port to write to the PIC, and
< send 64 bytes back to write to the PC.

Yes of course: but I do not know how to input/output from the PC to the
PIC ! That is exactly what I am asking.

My intention is to send/ receive to the PIC micro controller which will in
turn operate a robot device.

marty
 
Re: PC control of PIC micro controller

hawk2eye said:
Mike,
< Just send 64 bytes of data out the serial port to write to the PIC, and
< send 64 bytes back to write to the PC.

Yes of course: but I do not know how to input/output from the PC to the
PIC ! That is exactly what I am asking.

That's more a PC programming question than an electronics question, as has already been suggested it depends entirely on what language you program your application in - personally I've never heard of the one you mentioned?.

But assuming you have (or write yourself) a procedure that outputs a byte via the serial port (called Ser_Out), and a 64 byte array storing the data (called RobotOut), then it simply goes something like this:

Code:
For x = 0 to 63 Then
Begin
   Ser_Out(RobotOut[x]);
End;

Likewise for the input routine, with a function called Ser_In that reads a byte from the serial port, and an array called Robot_In:

Code:
For x = 0 to 63 Then
Begin
   Robot_In[x] := Ser_In;
End;
 
Window XP output/input via SER COM port

Nigel Goodwin,

I understand your explanation as to the output data from Windows XP
to the external PIC.

My question relates to: WHICH computer program that must be used to
send this output data.

QUESTION:
What computer program do you suggest to send /receive data to the
PIC?

before you answer: I have looked at your site, but I have NOT found
any suggestion as to which program to use for this purpose. VB is far too expensive for me to even consider.

Please be patient with me: I have been searching for an answer for some time.

Thanks !

marty
 
Re: Window XP output/input via SER COM port

hawk2eye said:
My question relates to: WHICH computer program that must be used to send this output data.

There isn't a specific one that you must use. But you can use Hyperterminal, which comes with all (?) Microsoft OS's. You could also write something yourself, which is why I asked about what compilers you have for your computer. I'm assuming you don't have much experience here, though?

hawk2eye said:
What computer program do you suggest to send /receive data to the PIC?

Hyperterminal. Just set the COM port specs. PIC developers often use this for communicating with PICs. Data is displayed and transmitted as ASCII, though, so you won't see anything meaningful when the PIC sends, for example, an 0x08 (which is a backspace).

Mike
 
Re: Window XP output/input via SER COM port

hawk2eye said:
Nigel Goodwin,

I understand your explanation as to the output data from Windows XP
to the external PIC.

My question relates to: WHICH computer program that must be used to
send this output data.

As you've already been told, WHICH program you use is up to you, HyperTerminal is a comms program which comes included with Windows, and is what I've used with my tutorials. It allows you to both send and receive data out the serial port.

QUESTION:
What computer program do you suggest to send /receive data to the
PIC?

before you answer: I have looked at your site, but I have NOT found
any suggestion as to which program to use for this purpose. VB is far too expensive for me to even consider.

Please be patient with me: I have been searching for an answer for some time.

As you're doing a custom job, you really need a custom program, which means you have to write it yourself, to do that you need some kind of suitable programming language. If you don't have a suitable language then you don't have much hope, personally I use Delphi, but C, C+ or VB are equally as suitable. In another thread people have suggested Python, and given links to where you could download it, perhaps you might try that?.

You should also enter your location in your profile, that way we have an idea where you might be, as it is we can only assume English is your first language?, which might not be the case.
 
?? How can a Windows XP computer control the <Series COM

?? How can a Windows XP computer control the <Series COM port> ??

Mike , Nigel Goodwin;

Thank you for your advice.

I am a retired electronics engineer with a lot of experience in fibre optics, electro-optics , but NO experienc with programming or using computer control.

I have already learned how to program the PIC micro controller, now
with the information that you have given me I can try the next stage:
Using the computer to control /receive feedback with the PIC.

My Last QUESTION
Do you think that learning , say, the C language is a bit too complicated for my appication ?

I will look into <Python> .

By the way I am aware of the danger to the computer , so I will use electro-optic coupling to input/output to external electronics.

Thank you both for your patience!

If and when I can hook up to external electronics from my computer , I will come back to you.

marty

PS: I was born in the USA, so English is my native language.
 
Greetings Marty,

If you have enough memory and your application permits, I think you'll find you can create some pretty nifty PIC based menu/control systems using Hyperterminal as the 'front end' on the PC... There are several ANSI command sequences like; GotoXY, Home_Cursor, Clear_Screen, to name a few, that come in very handy for formatting the Hyperterminal screen... Here's one example;

Code:
;******************************************************************
;
;  _Title macro - home cursor, clear screen, print a string
;
_Title  macro   str             ;
        local   String, Print
        movlw   low String      ;
        movwf   PTRL            ;
        movlw   high String     ;
        movwf   PTRH            ;
        goto    Print           ;
String  dt      h'1B',"[2J"     ; <esc>[2J ansi sequence
        dt      str,0
Print   call    PutString       ; print string
        endm

;******************************************************************
Support routines;
Code:
;******************************************************************
;
;  PutString - enter with string address in PTRL & PTRH
;            - string must be terminated with a '0' byte
;
PutString
        call    GetTable        ; get a table character           |B0
        andlw   b'11111111'     ;                                 |B0
        btfsc   STATUS,Z        ; last character?                 |B0
        return                  ; yes, return                     |B0
        call    Put232          ; output char                     |B0
        incfsz  PTRL,F          ; increment pointer               |B0
        goto    PutString       ;                                 |B0
        incf    PTRH,F          ;                                 |B0
        goto    PutString       ;                                 |B0
;
GetTable
        movf    PTRH,W          ;                                 |B0
        movwf   PCLATH          ;                                 |B0
        movf    PTRL,W          ;                                 |B0
        movwf   PCL             ;                                 |B0

;******************************************************************
Example macro usage in main program;
Code:
;
Menu4   _Title  "K8LH Sat Track Az/El Controller"
        _GotoXY 00, 04          ; htab 00, vtab 04
        _Print  "[1] Set Defaults     \r\n"
        _Print  "[2] Set Clock/Cal    \r\n"
        _Print  "[3] Calibrate Rotor  \r\n"
        _Print  "[?]"
        _GotoXY 01, 07          ; htab 01, vtab 07

Good luck... Have fun... Regards, Mike
 
mike, that little pic menu idea is frikkin awesome, i think i'll go fiddle around with something like that now... :eek:

by the way, if ii'm a linux person, what do i use instead of hyperterminal
i run ubuntu and suse and whatever else i need to, but it's just too inconvenient to run windows right now. Note: I hold no grudges and don't feel like being prejudice right now...
 
?? where on Internet can I learn about <Hypertext> ??

Mike,

Beleive it or not I was not aware of < Hypertext > .

QUESTION:
Where on the Internet can I learn how to use it ?

I feel uncomfortable if I don't know ALL the details involved.

Thanks for the information !

marty
 
Hi Marty,

Hyperterminal is included with Windows... Documentation is found in the Help menu...

It's not really difficult to set up... Just make a "new connection" and configure it for a particular COM port with 9600 baud (or whatever speed you use), 8 data bits, 1 stop bit, no parity, and no handshaking... Save this new connection as "PIC Terminal" or some such thing and put a shortcut on the desktop and/or quick launch bar...

Here are the ANSI control sequences I've discovered so far (the <esc> character is h'1B');

Code:
;
;  <esc><"["><"A"> = up-arrow
;  <esc><"["><"B"> = down-arrow
;  <esc><"["><"C"> = right-arrow
;  <esc><"["><"D"> = left-arrow
;
;  <esc><"["><"H"> = home cursor
;  <esc><"["><"J"> = clear screen from cursor
;  <esc><"["><"2"><"J"> = home cursor & clear screen
; 
;  <esc><"["><"YY"><";"><"XX"><"f"> = goto yy (00-23),xx (00-79) 
;

Take care... Have fun... Regards, Mike
 
know of any linux hyperterminal equivalents???
 
Clyd3 said:
know of any linux hyperterminal equivalents???

I don't 'know' of any, because I don't use Linux, but it's just a standard comms program, there will be many available for Linux, and I would imagine a number are included in every Linux distribution.
 
i didn't play with linux in a long time but there should be something called minicom, xterm, rxvt etc.
 
i should really know the answer, but thanks a lot for the replies
i'll try what you listed...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top