piclist 2001\01\23\152917a >
Thread: PIC Xmit to Serial Port
face picon face BY : Olin Lathrop email (remove spam text)

> The author of the TX routine did not have _c defined. I defined it as
> #define _c      STATUS,C  ;Carry Flag  since I am doing a RRF.
> Also his baudrate is a constant value which he calculates to 67 for a 2mhz
>  He uses
> clockrate       equ             .2000000   ;Xtal value (2Mhz in this case)
> fclk            equ             clockrate/4
> baudrate        equ             ((fclk/.2400)/3-2) ;2400
> I calculated 33 for 9600 baudrate, I am using a 4mhz on a F84.
> Any help would be greatly appreciated,

I use a macro for doing the UART baud rate calculation.  See
http://www.embedinc.com/pic and look at the macro UART_BAUD in
STD.INS.ASPIC.  I've used this macro accross different projects using
different PICs, including 16xxx and 17xxx parts.

Olin Lathrop, embedded systems consultant in Devens Massachusetts
(978) 772-3129, olinspamembedinc.com, http://www.embedinc.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

<000f01c0857a$d1723100$260bf6cd@pc> 7bit

See also: www.piclist.com/techref/microchip/ios.htm?key=serial
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) PIC Xmit to Serial Port

month overview.

new search...