Searching \ for 'Working PIC serial routine. Anyone?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/ios.htm?key=serial
Search entire site for: 'Working PIC serial routine. Anyone?'.

Truncated match.
PICList Thread
'Working PIC serial routine. Anyone?'
1998\06\02@185121 by

picon face
Hello

Does anyone have a working serial routine for a 16F84. I can't get mine to
work. I'd like to compare mine with a working routine. I want to run 9600 or
19200, inverted. I have 5 bytes to send. Or point me in the direction where I
can find such a routine.

Thanks in advance


Jon

1998\06\02@192257 by WF AUTOMACAO

flavicon
face
Nichole, spam_OUTPettyTakeThisOuTspamambiente.com.br wrote:
>
> Hello
>
> Does anyone have a working serial routine for a 16F84. I can't get mine to
> work. I'd like to compare mine with a working routine. I want to run 9600 or
> 19200, inverted. I have 5 bytes to send. Or point me in the direction where I
> can find such a routine.
>
> Thanks in advance
>
> Jon

Application note 555.

Miguel. (16 Family)

1998\06\03@005310 by Mike Keitz

picon face
On Tue, 2 Jun 1998 19:55:43 -0700 WF AUTOMACAO <.....wfKILLspamspam@spam@AMBIENTE.COM.BR>
writes:
>Nichole, PettyspamKILLspamambiente.com.br wrote:
>>
>> Hello
>>
>> Does anyone have a working serial routine for a 16F84. I can't get
>mine to
>> work. I'd like to compare mine with a working routine. I want to run
>9600 or
>> 19200, inverted.

Here's one I know works from a recent project of mine.  With a 3.6864 MHz
crystal, it sends at 9600 baud.  You can change the timing constant to
get other rates.  It sends what I would call "non-inverted"; the levels
at the PIC pin are high for start bits and zeros, and low for stop bits
and ones.  This signal can be connected directly to most PC's which
happen to accept TTL levels on the RS-232 port.  If you want the other
polarity of data to use with a line driver, just reverse the bsf and bcf
on _rsout.   It needs two RAM locations and a #define for _rsout such as
this one:

#define _rsout  PORTB,0


;----------------
serout
; Outputs a byte in RS-232 (8N1) to the '_rsout' pin.
; With 3.6864 MHz PIC xtal, baud rate will be 9600.
; Polarity is correct to connect the pin directly to the RS-232 line.
;  If inverting line transmitter is used, need to modify for opposite
;  polarity.
; Input with byte to send in W.  Uses bitct, sreg.
       movwf   sreg            ;Save W to shift later.
       movlw   .10
       movwf   bitct
       clrc                    ;Start bit is a 0.
serout_l
       skpc                    ;Sending 1?
       bsf     _rsout          ;No, send 0.
       skpnc                   ;Sending 0?
       bcf     _rsout          ;No, send 1.
       movlw   .255 - .21      ;Setup for delay.
serout_d
       addlw   1               ;Keep increasing W
       skpc                    ;until it overflows.
       goto    serout_d
;(C must be 1 here, so proper stop bits are placed in sreg.)
       rrf     sreg,f          ;Get another bit out.
       decfsz  bitct,f         ;Send another bit?
       goto    serout_l        ;Yes.
       return                  ;Done.


_____________________________________________________________________
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\06\03@025418 by Dean

flavicon
face
2 code examples with explinations:

www.access.digex.net/~pha/PIC/16C84/serial_output.html
Linked from:
http://www.access.digex.net/~pha/PIC/index.html

Dean.


> Hello
>
> Does anyone have a working serial routine for a 16F84. I can't get mine
to
> work. I'd like to compare mine with a working routine. I want to run 9600
or
> 19200, inverted. I have 5 bytes to send. Or point me in the direction
where I
> can find such a routine.
>
> Thanks in advance
>
>
> Jon

1998\06\03@191338 by )

flavicon
face
Nichole (Jon?) Petty asks:

> Does anyone have a working serial routine for a 16F84. I can't get mine to
> work. I'd like to compare mine with a working routine. I want to run 9600
> or
> 19200, inverted. I have 5 bytes to send. Or point me in the direction
> where I
> can find such a routine.
>
       I found some time ago a very decent pair of send and receive
routines on Parallax's FTP site (ftp.parallaxinc.com, I think). They were in
Parallax assembly format, so I had to convert them to Microchip so I could
use them. They were set up so that you could change a few minor things in
the program and use them either direct or with a MAX232 type driver.
Routines were named XMIT232.SRC and RCV232.SRC. Personally never had much
luck with the Microchip app note on RS232 routines. Hope this is of some
help.

1998\06\03@191348 by Eric Naus

picon face
Check out my  homepage at:

http://webhome.idirect.com/~bine


Click on the robotics project robot and download my pic code to run rc
servos.

A working serial routine is in the code.

Hope this helps.

Eric

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