Thank you for your suggestions. The reference Byron directed me
to will prove to be very useful and I noticed Tony's contributions
in that savme document as well. So if that won't be able to help me,
then nothing will. Thanks again guys.
davor
{Quote hidden}> Davor Tolja wrote:
> >
> > I'm a newbie using a PIC16F877 trying to develop serial
> > communications between the PIC and in this case, my PC.
> > I followed the instructions in section 10 in the manual and I
> > am pretty sure I have initialized the port properly as I do
> > receive some of the data sent. The problem is that I only
> > get a couple of the characters sent and lose most of the
> > message. This is what I have done below: any suggestions?
>
>
> Most likely, the data is being sent to the TXREG before it has a chance
> to send it out. It takes a certain amount of time to shift the data out,
> depending on the baud rate.
>
> This is a non interrupt method of waiting for all TX to finish.
>
> ;-------------------
> ; Display Message
> ;-------------------
> displaymsg
>
> clrf FSR
> loop
> movf FSR,w
> incf FSR,f
> call showmsg
> iorlw 0 ; check if end of message
> btfsc STATUS,Z
> return
> movwf TXREG ; send data to register
> call TransWt ; <<<<<<<<<<<<<<<<<<<<<<
> goto loop
>
> ;
> ; ------------------------------------
> ; WAIT UNTIL RS232 IS FINISHED SENDING
> ; ------------------------------------
> ;
> TransWt bsf STATUS,RP0
> WtHere btfss TXSTA,TRMT ; (1) transmission is complete if
hi
{Quote hidden}
--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
"[PIC]:" PIC only "[EE]:" engineering "[OT]:" off topic "[AD]:" ad's