Reply by "er.nirav" October 10, 20072007-10-10
--- 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!
>

An Engineer's Guide to the LPC2100 Series

Reply by Mike Harrison October 10, 20072007-10-10
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!
Reply by Shilpa Shilpa October 10, 20072007-10-10
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.

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!
--
My life has changed. What about yours?
Log on to the new Indiatimes Mail and Live out of the Inbox!
Reply by Doug Sutherland October 9, 20072007-10-09
If the terminal program on the PC has baud rate or other configuration
that does not match the microcontroller code, you will see A # & etc.
Check the baud rate, data bits, stop bits, flow control settings and
compare with the microcontroller configuration.

Shilpa Shilpa wrote:
> 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...
Doug Sutherland
Proficio Research
http://www.proficio.ca/
Reply by Shilpa Shilpa October 9, 20072007-10-09
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!
Reply by mjames_doveridge October 5, 20072007-10-05
--- In l..., "jcwren" wrote:
>
> Running short of time == class project due?
>
> And your FIRST mistake is using Hyperdoo-doo, er, I mean, Hyperterm.
> How they ever convinced Microsoft to ship that piece of junk with
> Windows is beyond me. My theory is they have some photographs of Bill
> Gates with a goat.

I heard it was Billy with a Jackass, but who knows?

On a more serious note, HT is er... 'not very good' and can lead you
to believe that there are problems with your UART driver when there
are none.

It is not an OS problem - STT software using ReadFile or ReadFileEx
returns the correct data.

That, and the miserable hoops you have to go through to get out of the
app - 'Are you sure?' , 'Do you want to save the connection' etc. Who
has time for that crap?

Is it so difficult for a serial terminal app to just start up with the
config. it was last shut down with? Rhetorical, because it just isn't.

Rgds,
Martin 'Windows developer saddled with an LPC/ARM project' James.
Reply by jcwren October 5, 20072007-10-05
Running short of time == class project due?

And your FIRST mistake is using Hyperdoo-doo, er, I mean, Hyperterm.
How they ever convinced Microsoft to ship that piece of junk with
Windows is beyond me. My theory is they have some photographs of Bill
Gates with a goat.

--jc

--- In l..., Shilpa Shilpa wrote:
>
> 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!
>
Reply by Shilpa Shilpa October 5, 20072007-10-05
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!
Reply by Joel Winarske October 5, 20072007-10-05
> 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
Reply by sb_gustavo October 4, 20072007-10-04
--- In l..., "Joel Winarske" wrote:
>
> sb_gustavo wrote:
> > Hi friends,
> >
> > I need to use the LPC2148 UART0 data RX interruption (RBR
interrupt
> > or RDA), however the interruption is not happening.
> > The software below doesn't work.
> > I'm using the compiler of the IAR Workbench.
> >
> > Please, help me!
> I don't see you enabling interrupts for starters.
>
> somewhere before your while(1) place:
> __enable_interrupt();
>
> It may require
> #include for IAR4
> #include for IAR5
> I have a IAR UART example here targeting LPC2148:
> http://www.indyelectronics.com/code.lpc214x.peripherals.iar.zip
> Joel
>

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?