MCF8252 UART using interrupts for Rx

View: New views
4 Messages — Rating Filter:   Alert me  

MCF8252 UART using interrupts for Rx

by Victor Remete :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--------------------------------------------------------------
       From: Victor Remete <vremete@...>
         To: coldfire@...
    Subject: MCF8252 UART using interrupts for Rx

    I would like to use the UARTs in the MCF8252 using interrupts.
    How do I program the UART for reception so that I get an interrupt
    1. when the Rx FIFO is 3/4 full (trigger level), or
    2. if no character is received for N character times (timeout,
          where N=4 in the National Semiconduction NS16550, but I am
        not picky on the value of N as long as it is 2 or more).

 -------------------------------------


---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Re: MCF8252 UART using interrupts for Rx

by Marc Vincent-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Victor.

The MCF5282 UARTs don't have a 16-deep FIFO like the 16550; you don't
get interrupts based on FIFO 3/4 full. If you enable RX ints, you get
an IRQ as soon as the first incoming character is transfered from the
shift register to the receive data buffer. The receive FIFO is 4-deep,
so your interrupt latency has to be less than 4 x (#bits/char) /
baudrate.

You also don't get a "receive timeout" interrupt, this is not a 68302
or a QUICC :-(  On the other hand, if you know the expected receive
buffer length, you can program a DMA channel to retrieve characters
from the UART's receive data buffer on a RX event and get interrupted
at the end of the DMA transfer.

Hope this helps.

Marc Vincent

PS: I'm assuming you're at siamtec. If so, pls say SALUT to Pierre M.
for me and have him give me a shout if any of this does not make
sense. You may remember me or not, I'm a STAS and NTC alumni...



On Mon, Jun 30, 2008 at 2:57 PM, Victor Remete <vremete@...> wrote:

> --------------------------------------------------------------
>       From: Victor Remete <vremete@...>
>         To: coldfire@...
>    Subject: MCF8252 UART using interrupts for Rx
>
>    I would like to use the UARTs in the MCF8252 using interrupts.
>    How do I program the UART for reception so that I get an interrupt
>    1. when the Rx FIFO is 3/4 full (trigger level), or
>    2. if no character is received for N character times (timeout,
>          where N=4 in the National Semiconduction NS16550, but I am
>        not picky on the value of N as long as it is 2 or more).
>
>  -------------------------------------
>
>
> ---
> coldfire@...              Send a post to the list.
> coldfire-join@...        Join the list.
> coldfire-digest@...    Join the list in digest mode.
> coldfire-leave@...     Leave the list.
>
>
---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Parent Message unknown MCF5482 UART using interrupts for Rx

by Victor Remete :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry,

I had the wrong processor number in my original post.
It should be MCF5482 not MCF8252.

Thanks
Victor


-----Original Message-----
From: coldfire-bounce@...
[mailto:coldfire-bounce@...]On Behalf Of Victor Remete
Sent: Monday, 30 June, 2008 14:58
To: Victor Remete
Subject: [ColdFire] MCF5482 UART using interrupts for Rx


--------------------------------------------------------------
       From: Victor Remete <vremete@...>
         To: coldfire@...
    Subject: MCF5482 UART using interrupts for Rx

    I would like to use the UARTs in the MCF5482 using interrupts.
    How do I program the UART for reception so that I get an interrupt
    1. when the Rx FIFO is 3/4 full (trigger level), or
    2. if no character is received for N character times (timeout,
          where N=4 in the National Semiconduction NS16550, but I am
        not picky on the value of N as long as it is 2 or more).

 -------------------------------------


---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.

---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.


Re: MCF5482 UART using interrupts for Rx

by Marc Vincent-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Jul 2, 2008 at 2:05 PM, Victor Remete <vremete@...> wrote:
> Sorry,
>
> I had the wrong processor number in my original post.
> It should be MCF5482 not MCF8252.

Ok, I thought you meant the MCF5282. The serial ports are completely
different on the 548x.


>    How do I program the UART for reception so that I get an interrupt
>    1. when the Rx FIFO is 3/4 full (trigger level), or

1- Set PSCMR1n bit 6 (FU) to get interrupted when RxFIFO count > threshold
2- Set the RxFIFO alarm in PSCRFARn bits 0-8. For 3/4 full:  512 - 512*3/4 = 128


>    2. if no character is received for N character times (timeout,
>          where N=4 in the National Semiconduction NS16550, but I am
>        not picky on the value of N as long as it is 2 or more).

The PSC does not do that.
You need to use a soft or hard timer and poll RXRDY (PSCSR bit 8).


Marc
---
coldfire@...              Send a post to the list.
coldfire-join@...        Join the list.
coldfire-digest@...    Join the list in digest mode.
coldfire-leave@...     Leave the list.

LightInTheBox - Buy quality products at wholesale price!