Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

CAN and UART1 troubles

CAN and UART1 troubles

2005-07-22 by gerhard_uttenthaler

Hello!

I am working on a project using the LPC2119.

My main loop observes, whether a message has been received by the CAN
interrupt and if so, sends it on the other CAN channel.

Now, if i put a:

// wait for free UART
while( (UART1_LSR & 0x60) == 0x00){;}
// send a character
UART1_THR = 0x32;

into this main loop and have a heavy CAN load on one channel the
programm gets locked up after some period of time and the (external)
watchdog triggers a reboot.

Without the UART accesses the programm works just fine.

Does anyone has any idea about that?

Thank you!

Gerhard

Re: CAN and UART1 troubles

2005-07-25 by genie_23432

--- In lpc2000@yahoogroups.com, "gerhard_uttenthaler" 
<gerhard.uttenthaler@g...> wrote:
> Hello!
> 
> I am working on a project using the LPC2119.
> 
> My main loop observes, whether a message has been received by the 
CAN
> interrupt and if so, sends it on the other CAN channel.
> 
> Now, if i put a:
> 
> // wait for free UART
> while( (UART1_LSR & 0x60) == 0x00){;}
> // send a character
> UART1_THR = 0x32;
> 
> into this main loop and have a heavy CAN load on one channel the
> programm gets locked up after some period of time and the (external)
> watchdog triggers a reboot.
> 
> Without the UART accesses the programm works just fine.
> 
> Does anyone has any idea about that?
> 
> Thank you!
> 
> Gerhard

I am having an almost identical type of problem using the LPC2119.  
Its in previous posts and I have since been told by Phillips that if 
I was using IAR to contact IAR for this issue.  Not much in the way 
of details other then to the finger to the IAR compiler/debugger.

I am waiting to hear from IAR now but its a big issue since I cannot 
seem to predict this erratic behavior.  Are you currently using IAR?  
Might help rule out the compiler or not...

PS If you do find the reason I wouldn't mind knowing since I am going 
around in circles with this issue myself.

Re: CAN and UART1 troubles

2005-07-26 by gerhard_uttenthaler

--- In lpc2000@yahoogroups.com, "genie_23432" <pascal_poirier@h...>
wrote:
> --- In lpc2000@yahoogroups.com, "gerhard_uttenthaler" 
> <gerhard.uttenthaler@g...> wrote:
> > Hello!
> > 
> > I am working on a project using the LPC2119.
> > 
> > My main loop observes, whether a message has been received by the 
> CAN
> > interrupt and if so, sends it on the other CAN channel.
> > 
> > Now, if i put a:
> > 
> > // wait for free UART
> > while( (UART1_LSR & 0x60) == 0x00){;}
> > // send a character
> > UART1_THR = 0x32;
> > 
> > into this main loop and have a heavy CAN load on one channel the
> > programm gets locked up after some period of time and the
(external)
> > watchdog triggers a reboot.
> > 
> > Without the UART accesses the programm works just fine.
> > 
> > Does anyone has any idea about that?
> > 
> > Thank you!
> > 
> > Gerhard
> 
> I am having an almost identical type of problem using the LPC2119.  
> Its in previous posts and I have since been told by Phillips that
> if 
> I was using IAR to contact IAR for this issue.  Not much in the way 
> of details other then to the finger to the IAR compiler/debugger.
> 
> I am waiting to hear from IAR now but its a big issue since I
> cannot 
> seem to predict this erratic behavior.  Are you currently using
> IAR?  
> Might help rule out the compiler or not...
> 
> PS If you do find the reason I wouldn't mind knowing since I am
> going 
> around in circles with this issue myself.

No, I am not using IAR, but the gnuarm toolchain (arm-elf-gcc version
3.3.3).

If I find out something helpful I will post it here.

Re: CAN and UART1 troubles

2005-07-28 by gerhard_uttenthaler

--- In lpc2000@yahoogroups.com, "gerhard_uttenthaler"
<gerhard.uttenthaler@g...> wrote:
> --- In lpc2000@yahoogroups.com, "genie_23432" <pascal_poirier@h...>
> wrote:
> > --- In lpc2000@yahoogroups.com, "gerhard_uttenthaler" 
> > <gerhard.uttenthaler@g...> wrote:
> > > Hello!
> > > 
> > > I am working on a project using the LPC2119.
> > > 
> > > My main loop observes, whether a message has been received by
> > > the 
> > > CAN
> > > interrupt and if so, sends it on the other CAN channel.
> > > 
> > > Now, if i put a:
> > > 
> > > // wait for free UART
> > > while( (UART1_LSR & 0x60) == 0x00){;}
> > > // send a character
> > > UART1_THR = 0x32;
> > > 
> > > into this main loop and have a heavy CAN load on one channel the
> > > programm gets locked up after some period of time and the
> > > (external)
> > > watchdog triggers a reboot.
> > > 
> > > Without the UART accesses the programm works just fine.
> > > 
> > > Does anyone has any idea about that?
> > > 
> > > Thank you!
> > > 
> > > Gerhard
> > 
> > I am having an almost identical type of problem using the
> > LPC2119.  
> > Its in previous posts and I have since been told by Phillips that
> > if 
> > I was using IAR to contact IAR for this issue.  Not much in the
> > way 
> > of details other then to the finger to the IAR compiler/debugger.
> > 
> > I am waiting to hear from IAR now but its a big issue since I
> > cannot 
> > seem to predict this erratic behavior.  Are you currently using
> > IAR?  
> > Might help rule out the compiler or not...
> > 
> > PS If you do find the reason I wouldn't mind knowing since I am
> > going 
> > around in circles with this issue myself.
> 
> No, I am not using IAR, but the gnuarm toolchain (arm-elf-gcc
> version
> 3.3.3).
> 
> If I find out something helpful I will post it here.

Sincw I declared my buffer variables, where the received messages are
stored in the CAN interrupt routine as volatile and put a
disableIRQ/restoreIRQ around the buffer decrement in my CAN send
routine the reboots have gone away.

Sorry foe the noise.

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.