Searching \ for 'UART examples needed' 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+examples+needed
Search entire site for: 'UART examples needed'.

Truncated match.
PICList Thread
'UART examples needed'
1998\08\27@004404 by Ralph Landry

flavicon
face
Hello, I'm developing a device to track movement of animals
(deer as an example)  I've got a PIC16C65A with a DS1307
RTC and the 24C65 e2 along with an optrex 16x2 LCD and
a motion detector.  A four button keypad allows the user to
change the date/time.  The unit will be placed in the field
(naturally) and when movement is detected it will store the
HH:MM  MM/DD to the e2.  I've got it almost completed in
just a week and a half (morning till morning though!)  Anyway
I'd like to make it so that I can bring it back and plug it into
my PC and dump the data so it can be graphed out, this
would plot out the movement times.  Can someone point me
to some UART routines that might be applicable?  I really
only need to send data and not receive, and 9600 8/n/1
would be an adaquate speed to deal with.  Any help or
links would be appreciated!

-Ralph
spam_OUTrlandryTakeThisOuTspamhaywood.main.nc.us
"If they call it Tourist Season why can't we shoot 'em?"

1998\08\27@091057 by Andy Kunz

flavicon
face
>would plot out the movement times.  Can someone point me
>to some UART routines that might be applicable?  I really
>only need to send data and not receive, and 9600 8/n/1
>would be an adaquate speed to deal with.  Any help or
>links would be appreciated!

Ralph,

I have the code you're looking for in both C and assembly.  The speeds
possible are dependent upon the xtal frequency you are using.

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\08\27@102636 by Ralph Landry

flavicon
face
Andy,
I'd like to look at the assembler code if possible.  Although I might
have the key under my nose.  I was looking at the data sheet for the
16C65A, it has a built in async UART.  From what I can tell, and I'll
have to experiment with it some.  I only need to select the baud rate
generator, set a couple of registers and by virtual of writing the
output byte to a register it will bit shift and send it out.  If this is the
case it should be extremly ease to send out the data.  I'm not
concerned with RX just TX.  I also hope to make this a battery driven
unit.  I understand that I'll still have to use a TTL to 232 converter.
I have a bunch of LT1081 from Linear.  Any experience with using
some low power devices that would meet my application?

-Ralph
.....rlandryKILLspamspam@spam@haywood.main.nc.us
"If they call it Tourist Season why can't we shoot 'em?"

1998\08\28@005618 by Mike Keitz

picon face
On Thu, 27 Aug 1998 09:57:49 -0700 Ralph Landry
<rlandryspamKILLspamHAYWOOD.MAIN.NC.US> writes:
>  Although I might
>have the key under my nose.  I was looking at the data sheet for the
>16C65A, it has a built in async UART.  From what I can tell, and I'll
>have to experiment with it some.  I only need to select the baud rate
>generator, set a couple of registers and by virtual of writing the
>output byte to a register it will bit shift and send it out.

Yes, the built in UART hardware will do most of the work for you.  You
may need to change the crystal to one that makes the baud rate work out
with BRGH = 0.  The chip has a bug when the BRGH bit is set, though it
affects the receiver so it may not be a problem for you.

On the other hand, it wouldn't be hard to use a standard software
"bit-bang" output in this case since the PIC doesn't need to do anything
else while outputting data.  The advantage to that is that you can move
down to a less expensive PIC that doesn't have a UART.  A 65 is probably
overkill for your application.

 receiver does not work properly with the BRGH bit set, so
>  I understand that I'll still have to use a TTL to 232
>converter.
>I have a bunch of LT1081 from Linear.  Any experience with using
>some low power devices that would meet my application?

See if the 1081 has a power down control pin.  Or use the PIC to switch
power to the converter chip off when it's not in use.  That may be as
simple as connecting the power supply pin to an output of the PIC, which
can supply 20 mA.  A low power chip isn't really needed, since it will be
active so infrequently.



_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\08\28@082358 by Ralph Landry

flavicon
face
Mike,
Thanks for the hints re:uart.  I did get it to work, I'm sending data out
to another PC that is hooked to my breadboard.  It was rather shocking
considering how easy it really was to implement.  I did use the high
speed bit as it had the least +ACU- of error. At 10Mhz and BRGH+AD0-0 the
chart listed a +-1.73 +ACU- error where as the BRGH+AD0-1 was +-0.16 +ACU-.

The LT1081 does not have a shutdown pin, (boo hoo), but the data
sheet says supply current is 12mA typ and 22mA max.  Would I be
wiser to perhaps be able to control the power to the LT1081 via
a transistor and the PIC rather than having the PIC try and power it
directly through an output pin?  The only reason I'm using the LT1081
at this point is I have about 100 of them laying around (c:  I also have
quite a few 2N4401 that I could use if that is recommended.

As for overkill, I looked at some of the other PIC's and the 65A
seemed to have a little more I/O, but it had the UART and I2C that
I wanted.  Later I found the I2C is not what I thought and ended up
bit banging to talk to the E2 and RTC.

Appreciate the comments and help+ACE-
-Ralph
rlandry+AEA-haywood.main.nc.us
+ACI-If they call it Tourist Season why can't we shoot 'em?+ACI-

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