Searching \ for 'UART Question' 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/index.htm?key=uart+question
Search entire site for: 'UART Question'.

Truncated match.
PICList Thread
'UART Question'
1999\10\19@170502 by Wittinger, Eric R

flavicon
face
HI, I am new to this list and to PIC's. My question is about using the UART.
What I need to do it talk from a computer to a PIC, and give this PIC commands.
Then have the PIC respond to these commands back to the computer after the PIC
has preformed some simple tasks based on what info the computer sent to the PIC.


An example is A user wished to open a valve.  So user clicks a button in the
computer interface to open valve #1.  The actions that follow :  The PIC opens
the valve #1 and responds to the computer letting the user know that valve #1 is
open, it was unable to open valve #1 for some unknown reason.

Okay, now the question, can I do this? I have a book I am reading, and learning
about PIC's with. I have made a test board up (my own design). The problem is I
have never done this before and am not quite grasping what has to happen in the
PIC for this to work.

Next is there a simple bit of code that will interface the PIC to a PC.
I can get this kind of thing to work with if pin 1 goes hi open valve #1,

I am doing my testing on a PIC16F84
I also have a C compiler for the PIC, I am trying to use, it seems simpler then
Assembly and a little quicker for a newbie.

Thanks for any suggestions or help.

Eric Wittinger

1999\10\19@171759 by Francisco Armenta

flavicon
face
part 0 2330 bytes content-type:text/x-vcard; charset=us-ascii; (decoded 7bit)

One way of make communication whit pic is:

Use a MAX232 IC, this IC drive the level voltage of RS-232 to TTL or CMOS level,
attach 1 input to pin RX of PIC an 1 output to TX.

for the software you need fix the format of your commands, example:

command for active a valve: O[CR][LF]
the letter "O" have a value in hex , so as, CR(CARRY RETURN) and LF(LINE FEED),
one
time that defined the format of you command, make a code for use
the USART module of the pic and for magnament the commands.

you can search in the MICROCHIP url in application note for details of the code

Francisco

"Wittinger, Eric R" wrote:

> HI, I am new to this list and to PIC's. My question is about using the UART.
> What I need to do it talk from a computer to a PIC, and give this PIC commands
.
> Then have the PIC respond to these commands back to the computer after the PIC
> has preformed some simple tasks based on what info the computer sent to the PI
C.
>
> An example is A user wished to open a valve.  So user clicks a button in the
> computer interface to open valve #1.  The actions that follow :  The PIC opens
> the valve #1 and responds to the computer letting the user know that valve #1
is
{Quote hidden}

Content-Type: text/x-vcard; charset=us-ascii;
name="briones.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Francisco Armenta
Content-Disposition: attachment;
filename="briones.vcf"

Attachment converted: wonderland:briones.vcf 1 (TEXT/CSOm) (0000E0D0)

1999\10\19@192805 by Dan Creagan

flavicon
face
Which version of C are you using?  I have some CCS C examples that let you
use built-in CCS routines to talk to an LCD (or PC).

You will have to invert your data to talk directly to the PC. You can use a
MAX232 or similar, or simply run it through an inverter if your cable is
short (I use a 74HCT04 on an 8 foot cable all the time). Be sure you buffer
the output of the PC back to the inverter with an appropriate resistor (the
possibility of exceeding the voltage limits of the PIC/inverter exists). 22K
is a popular choice, although just about anything in that region will do
fine.

Dan

{Original Message removed}


'UART Question'
2005\02\04@091913 by olin_piclist
face picon face
Shawn Tan Ser Ngiap wrote:
> The issue i'm thinking of is: if the pulse train doesn't shift
> positionally, from time to time, to cater to the async nature of the
> incoming signal,

But that's the point, it does.  The frequency may be fixed, but think of it
as the phase being reset to 0 at the leading edge of every start bit.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

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