Searching \ for '[PIC]: Handy Utility' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Handy Utility'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Handy Utility'
2000\08\16@165126 by Andrew Kunz

flavicon
face
part 1 674 bytes content-type:text/plain; charset=us-ascii

I know it's usually "bad" to attach source to a posting, but I think you'll like
this one.  Besides, it's only a small file.

It's a handy-dandy tool to tell you the correct SPBRG value(s) for your PIC
application.  It supports both BRGH values, and should run with any C compiler.
Instructions - compile & run.  Do what it tells you.  Print out the results.

It isn't the most efficient way to check if something is valid, but it was easy
to do and I'm pretty lazy.

If you need it in .EXE (for DOS) send me a private note (I'll ignore public ones
<G>).

If you need the MSVC .MAK file, I have that handy too.

Andy

(See attached file: baudrate.c)



part 2 1380 bytes content-type:application/octet-stream; (decode)

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

2000\08\18@110405 by Olin Lathrop

flavicon
face
part 1 1308 bytes content-type:text/plain; (decoded 7bit)

> It's a handy-dandy tool to tell you the correct SPBRG value(s) for your
PIC
> application.  It supports both BRGH values, and should run with any C
compiler.
> Instructions - compile & run.  Do what it tells you.  Print out the
results.
>
> It isn't the most efficient way to check if something is valid, but it was
easy
> to do and I'm pretty lazy.
>
> If you need it in .EXE (for DOS) send me a private note (I'll ignore
public ones
> <G>).
>
> If you need the MSVC .MAK file, I have that handy too.

While we're at it, here's something similar for assembly programmers.  It's
easier to use because it goes right into your source code.  The attached
file is a snippet from an include file containing a much larger collection
of macros and such, so you need to set up some assembler state before
calling the UART_BAUD macro.  It looks like it needs FREQ_OSC, which is the
oscillator frequency in Hz, and FAM_17 which is 1 on 17C family devices and
0 elsewhere.

I've used this a number of times with 16C devices successfully.  I've just
recently modified it to handle 17C devices but don't have target boards to
test yet.  I can't therefore absolutely promise I didn't introduce a bug,
but you can't complain for the price...


part 2 2785 bytes content-type:application/octet-stream; (decode)

part 3 337 bytes

*****************************************************************
Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, spam_OUTolinTakeThisOuTspamcognivis.com, http://www.cognivis.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\08\18@112528 by Andrew Kunz

flavicon
face
Not bad, Olin.

The reason I like the way I did it is because it allows me to pick from several
valid ones (common at low speeds) to get a match which meets other timing
requirements (ie, using the USART as a timer).  Sometimes it's like doing
character pacing (remember that!) and sometimes it's a free hardware timer
(using the TXIF interrupt , but not having a wire hooked to the pin).

Andy

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements

2000\08\21@134948 by jamesnewton

face picon face
I've taken the liberty of converting that to ASP code and making it
available at
www.piclist.com/techref/default.asp?url=microchip/rs232
under "SPBRG Calc"

I made a quick job of it and haven't really checked the results, please let
me know....

---
James Newton (PICList Admin #3)
.....jamesnewtonKILLspamspam@spam@piclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

2000\08\21@170927 by jamesnewton

face picon face
I've update the ASP page to also show the target baud rate and the percent
error from that target given the suggested spbrg and brgh values and I've
added 300 and 600 baud. (also fixed some bad formatting on my part)

---
James Newton (PICList Admin #3)
jamesnewtonspamKILLspampiclist.com 1-619-652-0593
PIC/PICList FAQ: http://www.piclist.com or .org

{Original Message removed}

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