Searching \ for '[PIC]: uart asynchronous transmitter mode' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'uart asynchronous transmitter mode'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: uart asynchronous transmitter mode'
2007\07\30@091713 by ELKEJBOUT Mustapha

hi list,
I have a problem with the uart part of the pic16f628, I want to send some data, from RA0..3, on TX , here is the code:

list p=16f628
   include ""


tmp EQU 0x20
   org 0x00
   goto main

   org 0x04
   goto main
   ;; uart config:    asynchronous transmitter mode
   movlw 0x0        ; usrt initialization
   bsf STATUS, RP0     ;bank 1
   movlw 0x01f
   movwf TRISA
   movlw 0x19        ; X=25 to set baud rate for 9600bps
   movwf SPBRG
   bcf TXSTA,TX9
   bcf STATUS, RP0        ; bank 0
   clrf PORTA
   movf PORTA,W
   andlw 0x0f
   movwf TXREG
   goto mnloop


if I use a literal value the transmission occurs correctly but as I use a PORTA as input from which I should read the transmitted data, Only I got 0000000 on TX.
any help would be appreciate
thanks in advance

"Every one has to do what he can do according to how it can be truly done"
For whom the bell tolls, Ernest Hemingway.
Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail

2007\07\30@114611 by Dario Greggio

face picon face
ELKEJBOUT Mustapha wrote:

> mnloop
>     movf PORTA,W
>     andlw 0x0f
>     movwf TXREG
>     goto mnloop

You should wait for TRMT flag or TXIF flag, before (or after, it depends
on schools of thoughts...) sending a new char to TXREG...

Ciao, Dario

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