Hey! I can finally contribute!
From the datasheet (I am looking at the sheet for the 18f242 that I just
finished the same type of project for):
<quote>
NOTE: TXIF is not cleared immediately upon loading data into the transmit
buffer TXREG. The flag bit becomes valid in the second instruction cycle
following the load instruction.
</quote>
therefore, your test at a1, which is the first instruction following the
load, is testing TXIF before it gets updated from loading TXREG.
Hope this helps!
--Joe Jansen
pic microcontroller discussion list <PICLIST
KILLspamMITVMA.MIT.EDU> wrote on
03/05/2004 08:46:19 AM:
> >> I'm experiencing strange behaviour with the 452 and the PLL enabled:
>
> >You do know that the PLL on/off setting takes its (new) effect only
> after a power down - power up?
>
> Yes I do, I found out the hard way the first time I tried to use it :-)
>
> Each time I enable or disable the PLL I remove power and then reaply...
>
> Also I discovered another problem I can't figure out. The following
code:
{Quote hidden}>
> movlw 'T'
> movwf TXREG
> a1: btfss PIR1, TXIF
> goto a1
> movlw 'e'
> movwf TXREG
> b1: btfss PIR1, TXIF
> goto b1
> movlw 's'
> movwf TXREG
> c1: btfss PIR1, TXIF
> goto c1
> movlw 't'
> movwf TXREG
> d1: btfss PIR1, TXIF
> goto d1
> movlw '-'
> movwf TXREG
> e1: btfss PIR1, TXIF
> goto e1
>
> That should give "Test-" as a UART output gives only "Ts-"! Baud
> rate is 19.2Kbps. Even if I put it at a continous loop it keeps
> displaying "Ts-Ts-Ts-Ts-". The same code with a 877 in place of the
> 452 works fine.
>
> Could it be that my micro is damaged? How could that happen?
>
> John Spiliotopoulos/Greece
>
> --
>
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
> email
.....listservKILLspam
.....mitvma.mit.edu with SET PICList DIGEST in the body
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUT
TakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body