Click here to Skip to main content
15,881,681 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Chip is PIC24FJ256GB210

This happens 4 times okay...

CSS
Send_Byte_In_W1_To_UART_3:

Wait_On_UART_3_TXBF:

        Btst    U3STA, #UTXBF           ;Got space ?
        BRA     NZ, Wait_On_UART_3_TXBF ;No, wait some more

                                        ;*** Fourth time thru, never gets
                                        ;*** past the previous loop

        Mov     W1, U3TXREG             ;Byte to send out came in to this sub in W1
        Return                          ;That's all


Thereafter, the UTXBF bit stays stuck in the 1 position. It will never clear again.

Does anyone have any experience in what may cause this ?

It's a dual processor board with another PIC connected to the other side of the UART.

I'm initializing it to use no flow control, without RTS/CTS enabled.

The other two UARTs are working okay.

What could be keeping UTXBF stuck in the 1 position ?

Give it enough cycles, and that thing is supposed to be empty, whether or not the bytes make it to their final destination or not.

Duh.

Thanks if anybody has ever solved this.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900