Yahoo Groups archive

Lpc2000

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

Thread

LPC2124 Bootloader

LPC2124 Bootloader

2006-05-23 by phlpcmicro

Hi all,

I wanted to confirm the following operation of the LPC2124 on bootup.

1. The current Philips LPC2124 bootloader is Philips proprietary
- Please confirm

2. Bootloader operation
- Can you please confirm my interpretation of the power on reset and
bootloader action (This is what I have interpreted from the LPC2124
User Manual)

-Bootloader lives in the highest part of flash memory (8k size)
-On Reset.... The bootloader is remapped to the top of a 2Gbyte boundary
-64 bytes of the bootloader vectors are mapped in to 0x00000000 to
0x0000003f (the original interupt vectors).
-The bootloader is always mapped in to the same location (top of
2Gbyte) so, execution of bootloader address is always fixed.
-LPC2124 executes the  first instruction at 0x00000000 jumps to a
fixed address in the remapped 8k bootloader at the top of 2Gbyte.
-bootloader code executes and looks for a low on P0.14.
. ..... etc.... then follow the bootloader flow charts in the user
manuals.

3. Please confirm the bootloader s/w checks the status of P0.14 and is
not a fixed as a hardware test.


Does my executive summary of the start up of the boot loader seem
feasable?


Thanks.

Joe G

Re: [lpc2000] LPC2124 Bootloader

2006-05-23 by Dominic Rath

Hey,

1. yes, the bootloader is proprietary
2. everything happens exactly the way you describe it.
3. yes, reading P0.14 is done in software.

Regards,

Dominic
Show quoted textHide quoted text
On Tuesday 23 May 2006 16:09, phlpcmicro wrote:
> Hi all,
>
> I wanted to confirm the following operation of the LPC2124 on bootup.
>
> 1. The current Philips LPC2124 bootloader is Philips proprietary
> - Please confirm
>
> 2. Bootloader operation
> - Can you please confirm my interpretation of the power on reset and
> bootloader action (This is what I have interpreted from the LPC2124
> User Manual)
>
> -Bootloader lives in the highest part of flash memory (8k size)
> -On Reset.... The bootloader is remapped to the top of a 2Gbyte boundary
> -64 bytes of the bootloader vectors are mapped in to 0x00000000 to
> 0x0000003f (the original interupt vectors).
> -The bootloader is always mapped in to the same location (top of
> 2Gbyte) so, execution of bootloader address is always fixed.
> -LPC2124 executes the  first instruction at 0x00000000 jumps to a
> fixed address in the remapped 8k bootloader at the top of 2Gbyte.
> -bootloader code executes and looks for a low on P0.14.
> . ..... etc.... then follow the bootloader flow charts in the user
> manuals.
>
> 3. Please confirm the bootloader s/w checks the status of P0.14 and is
> not a fixed as a hardware test.
>
>
> Does my executive summary of the start up of the boot loader seem
> feasable?
>
>
> Thanks.
>
> Joe G
>
>
>
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>

Timer as counter...

2006-05-23 by Andrew Berney

Just a quick question to see if there's anyway of using the inbuilt timer
functionality of a LPC2119 as a counter. Ie to count the number pulses
(rising or falling edge) from an external source over a given time frame.
Basically we have a pot that changes a source input frequency from 36khz to
around 48khz and driving an IRQ for each pulse doesn't strike me as being a
good idea. All I need to realistically know is roughly what frequency it's
being driven at.

Ideas?

Andy

Re: [lpc2000] Timer as counter...

2006-05-23 by Karl Olsen

---- Original Message ----
Show quoted textHide quoted text
From: "Andrew Berney" <amb@...>
To: <lpc2000@yahoogroups.com>
Sent: Tuesday, May 23, 2006 5:26 PM
Subject: [lpc2000] Timer as counter...

> Just a quick question to see if there's anyway of using the inbuilt
> timer functionality of a LPC2119 as a counter. Ie to count the number
> pulses (rising or falling edge) from an external source over a given
> time frame. Basically we have a pot that changes a source input
> frequency from 36khz to around 48khz and driving an IRQ for each
> pulse doesn't strike me as being a good idea. All I need to
> realistically know is roughly what frequency it's being driven at.

Being able to count rising and/or falling edges on the CAPx.x pins was added
to LPC213x and newer.  The timer hardware of the LPC2119 cannot.

Connecting your signal to an interrupt pin, and incrementing a counter in
the interrupt handler will take a few percent performance.

You may be able to misuse some other peripherals to get a lower interrupt
rate.  For example, configure SPI to slave mode, and connect your signal to
SCKx, and you'll get an interrupt every eighth clock.

Or maybe configure a UART to a suitably high baudrate and FIFO with trigger
level 14, and connect your signal to RxD.  The UART should detect every
falling edge as the start of a new incoming byte, and at every 14th edge,
you should get a FIFO full interrupt.  The baudrate should not be so high
that you get character timeout interrupts.

You can also connect your signal to both a CAPx.0 and a CAPx.1 pin, and
capture CR0 on rising edges and CR1 on falling edges.  You can then always
check the half-period time by looking at CR0 and CR1.  This requires no
interrupts at all.

Karl Olsen

Re: Timer as counter...

2006-05-23 by brendanmurphy37

Hi,

If your processor clock speed is reasonably fast (e.g. 60 Mhz), 
you'd see little impact on performance if you configure an FIQ 
interrupt to increment a single counter whenever the rising or 
falling edge happens. 

By pre-loading the banked ragisters before you start (e.g. with the 
address of the counter etc.), you'd probably get the code down to 
less than about six assembler instructions in total, and you 
probably wouldn't even have to save any context. Even with the 
standard interrupt latency, you'd almost certainly be less than 
about 30 cycles on average (being generous).

At 48KHz interrupt rate and a clock of 60 Mhz, you have 1250 cycles 
to play with: 30 of these to handle the interrupt, or 2.4% of the 
available CPU.

A much slower timer interrupt could periodically read (and reset) 
the counter to calculate the frequency.

Although it's not particularly "clever" (being something of a 
sledgehammer) it would work, and has the virtue of simplicity.

We've used 40 Khz interrupts and an interpolating filter to output 
an 8KHz sampled data (to reduce noise), and it works very well.

Regards
Brendan


--- In lpc2000@yahoogroups.com, "Andrew Berney" <amb@...> wrote:
>
> 
> Just a quick question to see if there's anyway of using the 
inbuilt timer
> functionality of a LPC2119 as a counter. Ie to count the number 
pulses
> (rising or falling edge) from an external source over a given time 
frame.
> Basically we have a pot that changes a source input frequency from 
36khz to
> around 48khz and driving an IRQ for each pulse doesn't strike me 
as being a
> good idea. All I need to realistically know is roughly what 
frequency it's
Show quoted textHide quoted text
> being driven at.
> 
> Ideas?
> 
> Andy
>

Re: [lpc2000] Timer as counter...

2006-05-24 by Mukund Deshmukh

> > Just a quick question to see if there's anyway of using the inbuilt
> > timer functionality of a LPC2119 as a counter. Ie to count the number
> > pulses (rising or falling edge) from an external source over a given
> > time frame. Basically we have a pot

I too have a similar problem, but I want measure 4 channel low freq (about 1
Khz) signal.
Any idea how it could be implemented using one timer.
Earlier we were using C8051F040, which has five timers.

Best Regards,

Mukund Deshmukh.
Beta Computronics Pvt Ltd
10/1, IT Park, Parsodi,
Nagpur-440022
Cell - 9422113746

Re: Timer as counter...

2006-05-24 by brendanmurphy37

--- In lpc2000@yahoogroups.com, Mukund Deshmukh <betacomp_ngp@...> 
wrote:
> I too have a similar problem, but I want measure 4 channel low 
freq (about 1
> Khz) signal.
> Any idea how it could be implemented using one timer.
> Earlier we were using C8051F040, which has five timers.
> 

You don't say anything about the signals, e.g. whether they're 
analog or digital, or how stable they are in frequency.

If the frequency isn't changing much over a reasonable time frame, a 
very simple way to measure the frequency would be to have a single 
timer interrupt at a rate somewhat faster than the expected 
frequency (in this case, maybe 10 kHz or so). In the interrupt 
handler you can sample all channels and work out if each signal has 
changed phase since the last sample for that channel. After so many 
interrupts (the count depends on how often you need a reading), a 
simple sum will give you the frequency of each channel from the 
number of phase changes detected.

Obviously if the frequency is changing rapidly, this technique won't 
give very acurate results, as it's essentially averaging the 
measurement over a period.

There are many ways of measuring or detecting signal's frequency: if 
you give more details of exactly what you're trying to do, other 
techniques might be more appropriate.

Brendan.

Re: Timer as counter...

2006-05-24 by lpc2100_fan

--- In lpc2000@yahoogroups.com, Mukund Deshmukh <betacomp_ngp@...> wrote:
>
> > > Just a quick question to see if there's anyway of using the inbuilt
> > > timer functionality of a LPC2119 as a counter. Ie to count the
number
> > > pulses (rising or falling edge) from an external source over a given
> > > time frame. Basically we have a pot
> 
> I too have a similar problem, but I want measure 4 channel low freq
(about 1
> Khz) signal.
> Any idea how it could be implemented using one timer.
> Earlier we were using C8051F040, which has five timers.
> 
> Best Regards,
> 
> Mukund Deshmukh.
> Beta Computronics Pvt Ltd
> 10/1, IT Park, Parsodi,
> Nagpur-440022
> Cell - 9422113746
>

Hi,

if you do not need the CAN, using the LPC2136 instead of the LPC2129
or the 2134 instead of the 2119 could resolve your problem.
Nevertheless, the proposals from Karl apply here as well and as
Brendan pointed out CPU load will be very low. 
I guess the missing counter inputs were recognized as something to
improve and therefor implemented in newer derivatives. 

Another (little crazy) option would be to use a LPC2101 which uses the
same tools and is very code compatible to the LPC21x9, let it do
everything around counting and timers and have it communicate with the
LPC21x9 via SPI or UART once it has the job done.

Bob

Re: [lpc2000] Re: Timer as counter...

2006-05-25 by Mukund Deshmukh

> You don't say anything about the signals, e.g. whether they're
> analog or digital, or how stable they are in frequency.
>

I am sorry the message was hurriedly posted.
I am using 4 proximity switches with toothed wheel to determine the speed of
4 shafts. The shaft are driven by 4 different source and not linked.
The output from each proximity can vary from 0 to kHz.

Earlier we were using C8051F040 (CAN not used) with 5 timers. We had
allotted a timer/counter channel to each proximity and we could get speed
accurately.

Now same design is being shifted to LPC2136.
Any idea how this can be achieved with one timer, and yes I would like to
avoid interrupt.
 Brendan's idea looks simple, but....?

Best Regards,

Mukund Deshmukh.
Beta Computronics Pvt Ltd
10/1, IT Park, Parsodi,
Nagpur-440022
Cell - 9422113746

Re: Timer as counter...

2006-05-25 by brendanmurphy37

Mukund,

I would imagine the technique I proposed (sampling each channel at a 
rate higher than the maximum expected frequency) would work well in 
the setup you describe.

As regrads accuracy, it's the same as using a counter, as all I'm 
really suggesting is to use software rather than hardware to do the 
counting. The rate at which you read the counters is up to you in 
each case.

In terms of performance, I'd be surprised if you used up more than 2 
or 3% of the CPU to do the actual counting (assuming 10s of MHz as a 
clock rate for the processor). The counting can be done in a single 
timer interrupt, without interfering with anything else going on. 

It mightn't be that pretty, but there's a lot to be said for 
simplicity....

Brendan

--- In lpc2000@yahoogroups.com, Mukund Deshmukh <betacomp_ngp@...> 
wrote:
>
> > You don't say anything about the signals, e.g. whether they're
> > analog or digital, or how stable they are in frequency.
> >
> 
> I am sorry the message was hurriedly posted.
> I am using 4 proximity switches with toothed wheel to determine 
the speed of
> 4 shafts. The shaft are driven by 4 different source and not 
linked.
> The output from each proximity can vary from 0 to kHz.
> 
> Earlier we were using C8051F040 (CAN not used) with 5 timers. We 
had
> allotted a timer/counter channel to each proximity and we could 
get speed
> accurately.
> 
> Now same design is being shifted to LPC2136.
> Any idea how this can be achieved with one timer, and yes I would 
like to
Show quoted textHide quoted text
> avoid interrupt.
>  Brendan's idea looks simple, but....?
> 
> Best Regards,
> 
> Mukund Deshmukh.
> Beta Computronics Pvt Ltd
> 10/1, IT Park, Parsodi,
> Nagpur-440022
> Cell - 9422113746
>

Re: [lpc2000] Re: Timer as counter...

2006-05-25 by Mukund Deshmukh

>In terms of performance, I'd be surprised if you used up more than 2
>or 3% of the CPU to do the actual counting (assuming 10s of MHz as a
>clock rate for the processor). The counting can be done in a single
>timer interrupt, without interfering with anything else going on.

Well, my plan was to use the timer at 0.9 mil sec (max freq being 1Khz), and
average out the reading at 100 mil sec, so that I don't over flow the 8 bit
counter.
I will also count rising and falling edges so that accuracy would be still
better.
I can not increase 100 mil sec reading period, as the value is used in
another control loop
for controlling speed of variable freq. drive.

In short the application is 4 channel variable ratio electronic  gear box.


Best Regards,

Mukund Deshmukh.
Beta Computronics Pvt Ltd
10/1, IT Park, Parsodi,
Nagpur-440022
Cell - 9422113746

Re: Timer as counter...

2006-05-25 by brendanmurphy37

--- In lpc2000@yahoogroups.com, Mukund Deshmukh <betacomp_ngp@...> 
wrote:
> Well, my plan was to use the timer at 0.9 mil sec (max freq being 
1Khz), and
> average out the reading at 100 mil sec, so that I don't over flow 
the 8 bit
> counter.

Why not use 32-bit counters? 

If you use a 5 kHz timer, you can easily count both phase changes, 
with plenty of safety margin for a maximum 1 kHz signal.

Every 500 interrupts (i.e. 100 ms) the frequency of each channel is 
then:

F = (c / 2 * 10) or F = c * 5

where F is frequency in Hz, c is count of phase changes in the last 
100 ms period.

Brendan

Re: [lpc2000] Re: Timer as counter...

2006-05-25 by Mukund Deshmukh

> 
> Why not use 32-bit counters? 
> 

The mind set was for C51 ;-)

> If you use a 5 kHz timer, you can easily count both phase changes, 
> with plenty of safety margin for a maximum 1 kHz signal.
> 
> Every 500 interrupts (i.e. 100 ms) the frequency of each channel is 
> then:
> 
> F = (c / 2 * 10) or F = c * 5
> 
> where F is frequency in Hz, c is count of phase changes in the last 
> 100 ms period.

Thanks Brendan,

Yes this should be OK.


Best Regards,

Mukund Deshmukh.
Beta Computronics Pvt Ltd
10/1, IT Park, Parsodi,
Nagpur-440022
Cell - 9422113746

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.