Click here to Skip to main content
15,886,518 members

PIC24 UART TX Buffer Full Bit Is Stuck

C-P-User-3 asked:

Open original thread
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.
Tags: Serial port, PIC

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



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