[P2020] DUART and FIFO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[P2020] DUART and FIFO

2,352 Views
clémentcgr
Contributor I

Hi,

 

I'm currently using the P2020 and I have some problems about DUART and FIFO.

When I try to use the FIFO mode and I write few characters in DUART_UTHR0, I did not see all characters.
Why ?

How can I be sure that FIFO mode is correctly configured? (FIFO Control Registers are write-only registrer)

NOTE: My code work well in step by step but not in real time

Best Regards,

Clement

Labels (1)
0 Kudos
Reply
5 Replies

2,062 Views
clémentcgr
Contributor I

Hi,

In fact, in my code we set the FIFO register (UFCR) but after we set the UAFR register. But.. these two register are in the same address and we overwrite our FIFO configuration. So the FIFO was not enable...

....my bad !

But Thanks for your example Pavel Chubakov !

0 Kudos
Reply

2,062 Views
alexander_yakov
NXP Employee
NXP Employee

I'm quite sure, if the code works properly under debugger in "step by step" mode, but does not work in free run, than this is not a FIFO related problem. Please confirm that you are using UDSR[TXRDY] to monitor FIFO level when placing data to FIFO.


Have a great day,
Alexander

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

2,062 Views
clémentcgr
Contributor I

So far we only have a test application which initializes DUART and try to send few caracters.

 

When we are configuring FIFO mode, we reset the Transmitter FIFO with UFCR[TFR]. As fifo is empty, we are guessing that first time we write

in UTHR register we can write up to 16 bytes without doing any control at all on UDSR[TXRDY].

But It doesn't work well : When we try to print 16 characteres, some characteres are not present (the last has always been present).

 

Of course we will add control later.

0 Kudos
Reply

2,062 Views
alexander_yakov
NXP Employee
NXP Employee
But It doesn't work well : When we try to print 16 characteres, some characteres are not present (the last has always been present).

Ok, so - how many characters you can print without corruption?

0 Kudos
Reply

2,062 Views
Pavel
NXP Employee
NXP Employee

Look at attached file. It is simple DUART FIFO example for the MPC8548. Use similar code on your P2020 board.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply