Searching \ for ' [pic] pic16f84 rs232 10Mhz crystal' 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=rs232
Search entire site for: 'pic16f84 rs232 10Mhz crystal'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] [pic] pic16f84 rs232 10Mhz crystal'
2001\04\19@080632 by sam woolf

flavicon
picon face
Does anyone have any simple subroutines for transmitting serial rs232 data
from a P16F84 with a 10 MHz crystal.. I'm a newbie and I've been having
endless problems with the code I've been using, and was hoping someone might
have something better..
cheers,
spam_OUTsamwTakeThisOuTspamcogs.susx.ac.uk

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


2001\04\19@160207 by uter van ooijen & floortje hanneman

picon face
> Does anyone have any simple subroutines for transmitting serial rs232 data
> from a P16F84 with a 10 MHz crystal.. I'm a newbie and I've been having
> endless problems with the code I've been using, and was hoping someone
might
> have something better..

Did you check the most obvious place?
(which is of course http://www.piclist.com)

Wouter

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


2001\04\19@183249 by Tony Nixon

flavicon
picon face
sam woolf wrote:
>
> Does anyone have any simple subroutines for transmitting serial rs232 data
> from a P16F84 with a 10 MHz crystal.. I'm a newbie and I've been having
> endless problems with the code I've been using, and was hoping someone might
> have something better..
> cheers,
> .....samwKILLspamspam@spam@cogs.susx.ac.uk
>
> --
> http://www.piclist.com hint: The PICList is archived three different
> ways.  See http://www.piclist.com/#archives for details.


This code is generated by ROMzap, it is at 19200 baud. Just pick your
port and pins for Rx and Tx. At the moment they are set for RX = RC7 and
TX = RC6.

To use it you could try this...


Loop    call RxRoutine      ; wait forever to receive a byte -> W reg

       call TxRoutine      ; echo it back to sender

       goto Loop


;
;
; ---------------
; RECEIVE ROUTINE
; ---------------
;
RxRoutine       btfsc PORTC,7           ; wait for start bit
       goto InRxRoutine
;
       call HBDelay2           ; wait 1/2 bit length - 2 cycles
       movlw 9h
       movwf BCount
;
RxLoop  btfsc PORTC,7           ; start bit is lost during routine
       goto RxHiBit
;
       bcf STATUS,C            ; receive start bit and 8 data bits
       goto RxLoBit
;
RxHiBit bsf STATUS,C
       nop
RxLoBit rrf RxHold,F
       call HBDelay4           ; wait 1/2 bit length - 4 cycles
       call HBDelay5           ; wait 1/2 bit length - 5 cycles
       decfsz BCount,F
       goto RxLoop
;
       movf RxHold,W
       return                  ; data returned in W Reg
;
; ----------------
; TRANSMIT ROUTINE
; ----------------
;
TxRoutine       movwf TxSend            ; temp store data to be sent
       bcf PORTC,6             ; do start bit
       call HBDelay5
       call HBDelay2
;
       movlw 8h                        ; 8 data bits to send
       movwf BCount
;
TxLoop  rrf TxSend,F
       btfsc STATUS,C
       goto TxHiBit
;
       nop
       bcf PORTC,6
       goto DoneBit
;
TxHiBit bsf PORTC,6
       goto $ + 1
;
DoneBit call HBDelay5           ; wait 1 bit length
       call HBDelay5
       decfsz BCount,F
       goto TxLoop
;
       call DoRet
       nop
       bsf PORTC,6             ; stop bit
       call HBDelay1
       call HBDelay
DoRet   return
;
; -----------------------------
; HALF BIT DELAY FOR 19200 BAUD
; -----------------------------
;
HBDelay nop
HBDelay1        nop
HBDelay2        goto $ + 1
HBDelay4        nop
HBDelay5        movlw 0x12
       movwf BitWait
BW      decfsz BitWait,F
       goto BW
       CLRWDT
       return
--
Best regards

Tony

mICros
http://www.bubblesoftonline.com
salesspamKILLspampicnpoke.com

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


2001\04\20@043620 by Vasile Surducan

flavicon
face
Jal

On Thu, 19 Apr 2001, sam woolf wrote:

{Quote hidden}

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


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