EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

UART0 LPC2148 - RBR Interrupt

Started by sb_gustavo September 27, 2007
On Wed, 10 Oct 2007 17:48:09 +0530 (IST), you wrote:

>Hi,
>
>Strange issue that I see is nothing gets written into the memory address provided to the UART1 THR regsiter in LPC2138.I have an example code that initialises the UART1 LCR,baud rate to 9600 and
>again disables the respective bits in LCR to access the U1THR regsiter.I am just writing a value of 65 in this regsiter.Though this gets displayed as "A" on the hyperterminal which is correct it indicates a value of 0x0 when i see the memory address issued to this regsiter and also in the peripherals regsiter window.
>I am not sure to what step I am missing that is not allowing me to write into this register.I request you all to provdie me help regarding this.

THR is a write-only register, so its value will not show correctly in a debugger memory display.
The address is shared with the RBR, so attempting to view in a debugger is also likely to mess up
any receive code due to side-effects of reading ( pulling bytes out of fifo etc.)
>
>Thanks,
>
>----- Original Message -----
>From: Shilpa Shilpa
>To: l...
>Sent: Tue, 9 Oct 2007 08:54:47 +0530 (IST)
>Subject: Re: [lpc2000] Re: UART0 LPC2148 - RBR Interrupt
>
>Hi All,
>
>I have an example code for UART0 in interrupt mode in LPC2138 processor and I am making use of the MCB2130 evaluation board.The code is such that it hits the ISR only when you type something on the hyperterminal but the problem here is the characters I type doesnot match with the one i.e. getting displayed on the terminal i.e. if I am typing as A B C D it receives as A # & etc... which clearly means that from the PC side I am unable to receive the proper characters.Hence I request you to tell me to what might be the reason behind the wrong receiving of the characters.
>
>Thanks,
>fasgfdgfs
>----- Original Message -----
>From: Shilpa Shilpa
>To: l...
>Sent: Fri, 5 Oct 2007 10:50:50 +0530 (IST)
>Subject: Re: [lpc2000] Re: UART0 LPC2148 - RBR Interrupt
>
>Hi Joel,
>
> I am also working on the same my application is that when I type some characters on the hyperterminal I should hit the receive interrupt ISR. I am working on MCB2130 board with LPC2138 controller and it would be great if you could provide me an example code for UART0 receive mode that genrates the interrupt.
>
>I am running short of time hence it woul be great if anyone can send me the code.
>
>Thx in advance,
>shilu
>----- Original Message -----
>From: Joel Winarske
>To: l...
>Sent: Fri, 5 Oct 2007 02:40:28 +0530 (IST)
>Subject: Re: [lpc2000] Re: UART0 LPC2148 - RBR Interrupt
>> Joel,
>>
>> I made the alteration what you recommended.
>> The interruption is happening, but it isn't executing the function
>> uart0.
>> What can be the problem?
>
>The flow goes as follows:
>You register your interrupt handler to the interrupt controller. You want
>to define your interrupt handler with
>__irq __arm void XXXXX (void)
>
>The __irq will surpress prolog/epilog ASM added to the ISR function.
>All interrupt handler code must be ARM, hence the __arm.
>
>In your startup code the interrupt vector for an IRQ can point to a couple
>of places. Direct to interrupt controller, or an ISR dispatcher.
>
>As long as your code is registered with interrupt controller and the
>actual interrupt vector is pointing to the right place, your interrupt
>code will fire.
>
>So it sounds like the path from interrupt vector is not making it to your
>ISR code - uart0.
>
>Review the example....
>Joel
>
>--
>My life has changed. What about yours?
>Log on to the new Indiatimes Mail and Live out of the Inbox!

An Engineer's Guide to the LPC2100 Series

--- In l..., Shilpa Shilpa wrote:
>
> Hi All,
>
> I have an example code for UART0 in interrupt mode in LPC2138
processor and I am making use of the MCB2130 evaluation board.The
code is such that it hits the ISR only when you type something on
the hyperterminal but the problem here is the characters I type
doesnot match with the one i.e. getting displayed on the terminal
i.e. if I am typing as A B C D it receives as A # & etc... which
clearly means that from the PC side I am unable to receive the
proper characters.Hence I request you to tell me to what might be
the reason behind the wrong receiving of the characters.
>
> Thanks,
> fasgfdgfs
> ----- Original Message -----
> From: Shilpa Shilpa
> To: l...
> Sent: Fri, 5 Oct 2007 10:50:50 +0530 (IST)
> Subject: Re: [lpc2000] Re: UART0 LPC2148 - RBR Interrupt
>
> Hi Joel,
>
> I am also working on the same my application is that when I type
some characters on the hyperterminal I should hit the receive
interrupt ISR. I am working on MCB2130 board with LPC2138 controller
and it would be great if you could provide me an example code for
UART0 receive mode that genrates the interrupt.
>
> I am running short of time hence it woul be great if anyone can
send me the code.
>
> Thx in advance,
> shilu
> ----- Original Message -----
> From: Joel Winarske
> To: l...
> Sent: Fri, 5 Oct 2007 02:40:28 +0530 (IST)
> Subject: Re: [lpc2000] Re: UART0 LPC2148 - RBR Interrupt
> > Joel,
> >
> > I made the alteration what you recommended.
> > The interruption is happening, but it isn't executing the
function
> > uart0.
> > What can be the problem?
>
> The flow goes as follows:
> You register your interrupt handler to the interrupt controller.
You want
> to define your interrupt handler with
> __irq __arm void XXXXX (void)
>
> The __irq will surpress prolog/epilog ASM added to the ISR
function.
> All interrupt handler code must be ARM, hence the __arm.
>
> In your startup code the interrupt vector for an IRQ can point to
a couple
> of places. Direct to interrupt controller, or an ISR dispatcher.
>
> As long as your code is registered with interrupt controller and
the
> actual interrupt vector is pointing to the right place, your
interrupt
> code will fire.
>
> So it sounds like the path from interrupt vector is not making it
to your
> ISR code - uart0.
>
> Review the example....
> Joel
> Hi all,
I think problem is timing...
first chracteris received propely but not second and third o on...

> Reason is that first you receiced first character and transmit
it , when you ar transmitting first character from your board to
hyperterminal, hyperterminal might also transmitting second charater
and your ARM is also busy with to transmit second character...after
finishing second character transmitting from PC ARM , you start to
receive another character at that time second transmitted chracter
from PC might reach some bit away from first bit ... so you are not
receiving false charater but you are not receiving full byte.
> ---
Tnanks,
Nirav
> --
> My life has changed. What about yours?
> Log on to the new Indiatimes Mail and Live out of the Inbox!
>

The 2024 Embedded Online Conference