Searching \ for '[PIC]: how to set up a software UART port?' 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/ios.htm?key=port
Search entire site for: 'how to set up a software UART port?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: how to set up a software UART port?'
2001\11\04@190234 by James Fitzsimons

flavicon
face
Hi all,
I am still trying to get serial coms working with my 16F84. I have my code
compiling now, and am trying to get my BASIC Stamp II to send a one byte
message to the PIC. The PIC then toggles and LED (if the message was received
correctly) and sends back the same byte to the stamp.

Unfortunately it's not working! I can tell that the stamp is sending the byte
through as a logic probe on that port of the PIC show me.

Question: Should I be connecting the Rx port of the PIC to VCC or GND? What
about the Tx port?

I am still a big PIC newbie, and haven't ever had to do anything like bit
bashed serial coms before (BASIC Stamps make this easy) so would appreciate any
pointers.

Thanks heaps,
regards
James Fitzsimons

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\04@204220 by Brent Brown

picon face
James wrote:
> Hi all,
> I am still trying to get serial coms working with my 16F84. I have my
> code compiling now, and am trying to get my BASIC Stamp II to send a
> one byte message to the PIC. The PIC then toggles and LED (if the
> message was received correctly) and sends back the same byte to the
> stamp.
>
> Unfortunately it's not working! I can tell that the stamp is sending
> the byte through as a logic probe on that port of the PIC show me.
>
> Question: Should I be connecting the Rx port of the PIC to VCC or GND?
> What about the Tx port?
>
> I am still a big PIC newbie, and haven't ever had to do anything like
> bit bashed serial coms before (BASIC Stamps make this easy) so would
> appreciate any pointers.

From what you say I think you need to put the data into the RxD line
on the PIC (it's an input) and leave the TxD line open circuit (it's an
output).

A good way of checking serial comms is to use a "dumb" terminal
program on your PC. You would need to use a MAX232 or similar to
shift the voltage levels from +5V to +/-10V though. This will let you
check that your basic stamp is outputting the data you are
expecting and at the correct baud rate.

Brent Brown
Electronic Design Solutions
16 English Street
Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/text: 025 334 069
eMail:  spam_OUTbrent.brownTakeThisOuTspamclear.net.nz

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\04@211843 by James Fitzsimons

flavicon
face
Hi Brent,
firstly thanks heaps for response. I think you are correct in that I am going
to have to put togeather a MAX232 connection to my PC to debug this part of my
project... it seems this might be the only way I am going to be able to "see"
what is going on.

I wrote:
<snip>
> > Question: Should I be connecting the Rx port of the PIC to VCC or
> GND?
> > What about the Tx port?
<snip>

I don't think I was very clear in my first email. The 16F84 has no hardware
UART, so I am using bit bashed UART done in software, written in Hi-Tech C
(sourced from http://www.workingtex.com/htpic). What I am unsure of is whether
I have to connect the PIC Rx pin (I am using RA2) to VCC or GND as well as to
the signal line from the Stamp/PC/whatever? Same question for the Tx pin
(RA1)...

Brent wrote:
<snip>
> A good way of checking serial comms is to use a "dumb" terminal
> program on your PC. You would need to use a MAX232 or similar to
> shift the voltage levels from +5V to +/-10V though. This will let you
> check that your basic stamp is outputting the data you are
> expecting and at the correct baud rate.
<snip>

Although I am 99% sure that the problem is with either the PIC software, or
hardware, or both, your suggestion above is a good idea. I will try this
tonight and double check that the Stamp is actually outputing what I think it
is!

Thanks again for all your help,
regards
James Fitzsimons

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\04@213932 by Brent Brown

picon face
> I don't think I was very clear in my first email. The 16F84 has no
> hardware UART, so I am using bit bashed UART done in software, written
> in Hi-Tech C (sourced from http://www.workingtex.com/htpic). What I am
> unsure of is whether I have to connect the PIC Rx pin (I am using RA2)
> to VCC or GND as well as to the signal line from the
> Stamp/PC/whatever? Same question for the Tx pin (RA1)...

Hi James,

Sorry - I think I might be with you now:- all you need to do is
connect the GND of the two devices together. That way the a
"+5V"has something to be relative to, ie. it is relative to 0V or GND.
Then Stamp Tx goes to PIC Rx and Stamp Rx goes to PIC Tx (or in
this case may be unused). Tell us when it goes!

Brent Brown
Electronic Design Solutions
16 English Street
Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/text: 025 334 069
eMail:  .....brent.brownKILLspamspam@spam@clear.net.nz

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\04@222454 by Andrew E. Kalman

flavicon
face
Re:

>firstly thanks heaps for response. I think you are correct in that I am going
>to have to put togeather a MAX232 connection to my PC to debug this part of my
>project... it seems this might be the only way I am going to be able to "see"

Our App Note AN-6 details a software UART (adapted from HI-TECH code)
on the 12C509A and 16C77. Complete schematics are included, as is all
source code. You may find it useful.

Regards,
--

 ______________________________________
Andrew E. Kalman, Ph.D.


Salvo(TM), The RTOS that runs in tiny places(TM)
Pumpkin, Inc.
750 Naples Street
San Francisco, CA 94112
tel: (415) 584-6360
fax: (415) 585-7948
web: http://www.pumpkininc.com
email: aekspamKILLspampumpkininc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\11\05@085651 by Olin Lathrop
face picon face
> Question: Should I be connecting the Rx port of the PIC to VCC or GND?

If you did that, how is it supposed to receive anything?  RX of the PIC goes
to the TX of the other chip, and vice versa for the PIC TX.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, .....olinKILLspamspam.....embedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\11\05@143443 by James Fitzsimons

flavicon
face
Hi Olin,

Quoting Olin Lathrop <EraseMEolin_piclistspam_OUTspamTakeThisOuTEMBEDINC.COM>:

> > Question: Should I be connecting the Rx port of the PIC to VCC or
> GND?
>
> If you did that, how is it supposed to receive anything? RX of the PIC
> goes to the TX of the other chip, and vice versa for the PIC TX.

I realise that, perhaps I wasn't very clear in my question.

I was asking if I needed to connect the Rx of the PIC to VCC (probably through
a 10k resistor) AS WELL AS to the Tx of the BSII.

Cheers,
James Fitzsimons

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\11\05@180739 by Olin Lathrop

face picon face
> I realise that, perhaps I wasn't very clear in my question.
>
> I was asking if I needed to connect the Rx of the PIC to VCC (probably
through
> a 10k resistor) AS WELL AS to the Tx of the BSII.

If the other chip is on the same board and has totem pole output, you don't
need to do anything except connect PIC RX to the other chip TX.  UART
outputs usualy are totem pole.  The PIC TX output is definitely totem pole.

If the RX line comes from a connector that goes off board, you should
consider what happens if the other board is not connected.  At the least you
want a weak pullup, like 10K ohms.  If RX comes from a user-accessible
connector then more elaborate protection may be in order.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, olinspamspam_OUTembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\11\06@014216 by Thet Naing Kyaw

picon face
I don't think you will need pull up resistor for RX
and TX unless you drive more than two or three ports.

Rgds,
Thet Naing

--- James Fitzsimons <@spam@jamesfitKILLspamspamPARADISE.NET.NZ> wrote:
{Quote hidden}

__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

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


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