Searching \ for 'RS232 at 38.4 kbps' 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/io/serials.htm?key=rs232
Search entire site for: 'RS232 at 38.4 kbps'.

Truncated match.
PICList Thread
'RS232 at 38.4 kbps'
1998\12\14@141555 by Toby Stensland

flavicon
face
I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC at high speed (my goal is 38.4 kbps).  The software uart given in AN555 from microchip says it can provide 4800 baud @ 4MHz or 19200 @ 10MHz.  I am wondering if I can buy a separate hardware uart (usart?) and get better performance (with simpler software)?  Any leads to where I can find examples/suggestions/help?


Toby Stensland                                                 spam_OUTtobyTakeThisOuTspamstensland.com
3112 South Independence Court
Lakewood, CO  80227

http://www.stensland.com

1998\12\14@144900 by Matt Bonner

flavicon
face
Toby Stensland wrote:
>
> I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC at high s
peed (my goal is 38.4 kbps).  The software uart given in AN555 from microchip sa
ys it can provide 4800 baud @ 4MHz or 19200 @ 10MHz.  I am wondering if I can bu
y a separate hardware uart (usart?) and get better performance (with simpler sof
tware)?  Any leads to where I can find examples/suggestions/help?

How about migrating to something like the PIC16C63 which has a USART?
Otherwise, I think Harris has a 20 pin UART.

--Matt

1998\12\14@151056 by Peter L. Peres

picon face
afaik a PIC can send back to back async serial (un-interrupted) with only
8T cycles per bit. Receiving without a UART is another matter.

Peter

1998\12\14@152920 by PIC development

flavicon
picon face
Try this for sending to the PC. If you want to receive on the
PIC, try this URL
http://www.beowulf.demon.co.uk/serial-stepper.html

It's for a 12c508 but you'll get the idea:
(Oh yes, SERIAL is the output pin I chose, bit 5 on the 12c508,
the timing is *very* critical. You may need to use a crystal
to keep the clock close enough - the internal RC oscillator
may drift too much)

; routine to write serial output at 38400 Baud
; (using 4MHz clock, 1uS/instruction)
; equals 26 clock cycles per bit

ser_out
       movwf   TX_BYTE
       call    bitout_1
;       nop
;       nop
       nop
       movlw   8
       movwf   TX_COUNT

ser_loop
       call    bitout
       rrf     TX_BYTE, f
       decfsz  TX_COUNT, f
       goto    ser_loop

       call    bitout_0
       nop
       nop
       nop
       nop
       return

; routine to output a bit with the correct timing for 38400Bd @ 4Mhz
; this bit-sense works with a MAX-232 (i.e. inverted)

bitout
       btfsc   TX_BYTE, 0
       goto    bitout_0
bitout_1
       nop
       nop
       bcf     GPIO, SERIAL
       goto    bit_done
bitout_0
       bsf     GPIO, SERIAL
bit_done
       movlw   4
       movwf   DELAY
bit_delay
       decfsz  DELAY, f
       goto    bit_delay
       return

All the best
Pete

..............................................................................
. Never trust a man who, when left alone in ....... Pete Lynch               .
. a room with a tea cosy, doesn't try it on ....... Marlow, England          .
..........Billy Connolly. ......................... .....picKILLspamspam@spam@beowulf.demon.co.uk ..


On Mon, 14 Dec 1998, Toby Stensland wrote:

> I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC at high s
peed (my goal is 38.4 kbps).  The software uart given in AN555 from microchip sa
ys it can provide 4800 baud @ 4MHz or 19200 @ 10MHz.  I am wondering if I can bu
y a separate hardware uart (usart?) and get better performance (with simpler sof
tware)?  Any leads to where I can find examples/suggestions/help?
>
>
> Toby Stensland                                                 toby@stensland.
com
> 3112 South Independence Court
> Lakewood, CO  80227
>
> http://www.stensland.com
>

1998\12\14@161225 by Andy Kunz

flavicon
face
Toby,

I take it that you are new to PICs.

You can send/receive 38400 just fine with a PIC, although it DOES take some
ingenuity on storing the data.

I have done just that, but unfortunately the storage routine is not
disclosable.  Suffice it to say that it's not especially easy.

Now, for the send/receive code.  Note that the code assumes the PC is
transmitting 8,n,2 (not 1 stop) to give time to save the data.  Also, data
is sent and receivd on the same pin in this project, although that is not
necessary.

;***************************************************************************
***********************************************
;
;       UART_TX
;
;       Transmit W at 38400 out XBIT, 8,N,1 protocol.
;
; INPUTS:
;       W
;
; OUTPUTS:
;       n/a
;
; USES:
;       Timer
;       temp1
;       temp2
;
UART_TX
:Speed_Delay_1  equ     9               ; 9 passes * 3uS per pass + 1
:Speed_Delay_2  equ     4               ; 26-14 overhead=38

       clrwdt
       movwf   temp1

       movlw   8
       movwf   temp2

       bsf     XBIT                    ; Force STOP BIT condition initially
       movlw   TRIS_RB_TX              ; Set port to transmit
       tris    RB                      ; Set as an output now

       movlw   :Speed_Delay_1
       movwf   Timer:LSB
       bcf     XBIT                    ; Send START bit
:Loop1  decfsz  Timer:LSB,F
       goto    :Loop1

:Loop   btfss   temp1.0                 ; Send DATA bits
       bcf     XBIT
       btfsc   temp1.0
       bsf     XBIT

       goto    $+1                     ; Waste four cycles to pad to exactly 13
       goto    $+1
       nop

       movlw   :Speed_Delay_2
       movwf   Timer:LSB
:Loop2  decfsz  Timer:LSB,F
       goto    :Loop2

       rrf     temp1,F                 ; Set up for next bit
       decfsz  temp2,F                 ; Done yet?
       goto    :Loop                   ;       No, repeat

       movlw   :Speed_Delay_1          ; Send STOP bit
       movwf   Timer:LSB
       bsf     XBIT
:Loop3  decfsz  Timer:LSB,F
       goto    :Loop3

       movlw   TRIS_RB_RX              ; Set port to receive now
       tris    RB
       retlw   0
;
;........................................
;
;       UART_RX
;
;       Receive char at 38400 in XBIT, 8,N,2 protocol.
;
;       NOTE:  We don't stick around for the stop bit!  We should therefore
;       have about 40uS to process the received character before the leading
;       edge of the next start bit.
;
; INPUTS:
;       none (but RB must be set for input on XBIT pin)
;
; OUTPUTS:
;       temp1 = character received
;
; USES:
;       Timer
;       temp1
;       temp2
;
UART_RX
:FullBitTime    equ     4               ; 26 uS

       clrf    temp1                   ; character received
       movlw   9                       ; bits to read in (start gets shifted ou
t)
       movwf   temp2

:WaitStart                              ; Wait for leading edge of start bit
       clrwdt
       btfsc   XBIT
       goto    :WaitStart
       goto    $+1
       goto    $+1
       btfsc   XBIT                    ; Start bit still there?
       goto    :WaitStart              ;       No, start over waiting - it was
noise
                                       ;       Yes...

:Loop   bcf     C
       rrf     temp1,F
       btfsc   XBIT                    ; Sample bit, stuff into character buffe
r
       bsf     temp1.7
       movlw   :FullBitTime
       movwf   Timer:LSB
       nop
       nop
:BitWt  nop
       decfsz  Timer:LSB,F             ; Wait 1 bit time (just a few instructio
ns short...)
       goto    :BitWt
       decfsz  temp2,F                 ; Dec bit counter
                                       ; Done?
       goto    :Loop                   ;       No, loop
       retlw   0                       ;       Yes, return with char in temp1
;
;........................................
;
;       UART_ChkIdle
;
;       Wait for 2 character times of idle on receiver pin
;
;       Character Time @ 38400 = 10x26 uS
;       --> we need to wait 520uS min.
;       520uS / 5uS per pass = 104 passes
UART_ChkIdle
       movlw   104
       movwf   Timer:LSB
:Loop   clrwdt
       btfss   XBIT                    ; Transmitter "idle" right now?
       goto    UART_ChkIdle            ; No, reset timer
       decfsz  Timer:LSB,F             ; Timer expired?
       goto    :Loop                   ;       No, check bit again
       retlw   0                       ;       Yes, back to caller
;
;........................................




At 12:14 PM 12/14/98 -0700, you wrote:
>I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC at
high speed (my goal is 38.4 kbps).  The software uart given in AN555 from
microchip says it can provide 4800 baud @ 4MHz or 19200 @ 10MHz.  I am
wondering if I can buy a separate hardware uart (usart?) and get better
performance (with simpler software)?  Any leads to where I can find
examples/suggestions/help?

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

1998\12\14@161915 by Harold Hallikainen

picon face
On Mon, 14 Dec 1998 12:48:44 -0700 Matt Bonner <mbonnerspamKILLspamSUNADA.COM>
writes:
>Toby Stensland wrote:
>>
>> I would like a 16F84@4MHz or a 12C671@10MHz to communicate with a PC
>at high speed (my goal is 38.4 kbps).  The software uart given in
>AN555 from microchip says it can provide 4800 baud @ 4MHz or 19200 @
>10MHz.  I am wondering if I can buy a separate hardware uart (usart?)
>and get better performance (with simpler software)?  Any leads to
>where I can find examples/suggestions/help?
>
>How about migrating to something like the PIC16C63 which has a USART?
>Otherwise, I think Harris has a 20 pin UART.
>

       Also, Maxim (I think it is) has a small UART that is driven with
an SPI port.  I'd perfer to get everything in the PIC, but this is an
alternative.

Harold


Harold Hallikainen
.....haroldKILLspamspam.....hallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
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/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

1998\12\14@165214 by dave vanhorn

flavicon
face
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


>        Also, Maxim (I think it is) has a small UART that is driven with
>an SPI port.  I'd perfer to get everything in the PIC, but this is an
>alternative.


MAX3100. needs a rock and 232 drivers.  It also speaks IRDA


-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.5
Comment: Trust them, they're from the government!  (NOT!)

iQA/AwUBNnWHT0t+LG8vnBoNEQJdZgCdHdi0lAK3PPoQ8Wf4NbwtDf2P0EMAoLAO
lMytNL8HacLNjxarWNB7RTpu
=jw1P
-----END PGP SIGNATURE-----

1998\12\20@104630 by White Horse Design

flavicon
face
At 21:16 14/12/98 , Harold Hallikainen wrote:

>        Also, Maxim (I think it is) has a small UART that is driven with
>an SPI port.  I'd perfer to get everything in the PIC, but this is an
>alternative.

Max3400 from memory, serial uart with fifo.

Regards

Adrian
---
WWW    WWW   Adrian Gothard
WWW WW WWW   White Horse Design
WWWWWWWWWW   +44-385-970009 (Mobile/SMS), +44-118-962-8913/4 (voice/fax)
WWWW  WWWW   EraseMEwhdspam_OUTspamTakeThisOuTzetnet.co.uk, http://www.users.zetnet.co.uk/whd
---
Developers of GPS satellite-based tracking systems for vehicles/helicopters

1998\12\20@120758 by dave vanhorn

flavicon
face
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 03:30 PM 12/20/98 +0000, White Horse Design wrote:
>At 21:16 14/12/98 , Harold Hallikainen wrote:
>
>>        Also, Maxim (I think it is) has a small UART that is driven with
>>an SPI port.  I'd perfer to get everything in the PIC, but this is an
>>alternative.
>
>Max3400 from memory, serial uart with fifo.


MAX3100


-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.5.5
Comment: Trust them, they're from the government!  (NOT!)

iQA/AwUBNn0t8Ut+LG8vnBoNEQJXSQCguFK2rjEUjUnxuqa06xliRbqg7kAAnj6W
3w77zMfhsupKODf95UlKUQxz
=pSmG
-----END PGP SIGNATURE-----

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