PDA

View Full Version : LPC2138 anyone?



anilmaddala
01-06-2009, 12:49 AM
Hi, im looking for a good on board processor for my UAV. It has an accelerometer, two gyros, compass and Xbee module.

I have already posted this question and got Gumstix for answer. Unfortunately its out of my budget. I have been looking into LPC2138, haven't worked with it yet.

http://robokits.co.in/shop/index.php?main_page=product_info&cPath=19_22&products_id=174

http://robokits.co.in/shop/index.php?main_page=product_info&cPath=6&products_id=173

Is it good enough? Do you guys have any other suggestion for processor?

debu
01-07-2009, 11:33 PM
@anilmaddala: Are you looking to do much calculation on-board?

Regards,

Debu :)

vikas
01-07-2009, 11:40 PM
Board is a good one , But are you shore you can mount all the required stuff on a UAV ?

For a UAV its not suited , as it too big and power hungry ... not really optimized for really small app's where Gumstix excel.

If you have even seen a gumstix in real life ull know why they are the preffered choice.

anilmaddala
01-09-2009, 01:06 AM
If i had won a lottery, i would go for Gumstix. :(

I do accept that gumstix is cool, but i already crossed my budget limit.

Yes it does involve more calculation. :(

debu
01-09-2009, 08:02 AM
@anilmaddla: In that case use a LPC2138. The idea is to get your calculations done, and fast. The advantage that an ARM7TDMI would have over any traditional 8-bit processor is the ability to perform calculations on 32-bit numbers in single cycle.

Typically a simple code in C such as:


int sum, num1, num2;
sum = num1 + num2;

Would be translated by the compiler, for an 8-bit uC as:


MOV _NUM1_H, ACC
ADDC _SUM_H, ACC
MOV _NUM2_H, ACC
ADDC _SUM_H, ACC
MOV _NUM1_L, ACC
ADDC _SUM_L, ACC
MOV _NUM2_L, ACC
ADDC _SUM_L, ACC
SHT LC_BIT, _SUM_H

That is 9 instructions!! If you use an LPC2138, or any other ARM for that matter, the compiler would simply translate the above code to:


ADC _SUM, _NUM1, _NUM2, #3


Also, considering that the LPC2138 runs at 60Mips at 60MHz, and requires only a 12 MHz crystal to run at 60MHz (internal PLL). It should be great if you need to perform many calculations.

As far as cost is concerned, the LPC2138 costs as much as high end 8-bit uC's.

Hope this helps,

Regards,

Debu :)

anilmaddala
01-10-2009, 02:38 AM
Thanks Debu, thats some good news to hear :D I was worried if LPC2138 does not meet my requirements.

I am new to ARM. Could you please tell me where to start? what to read?
Just started to use Keil C.

debu
01-10-2009, 11:03 AM
@anilmaddala: I personally use WinARM (clickie) (http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/#winarm) for most projects. Since arm-gcc supports C++ as well as C, its great. As for Keil RealView compiler, its also very good, it produces the most optimized output code. However it lacks a good libray of basic things. If you plan to use Keil, I have made an Open Source library of some of the basic things you will need, its available for download here (clickie) (http://debusinnovations.blogspot.com/2008/03/arm7tdmi-realview-compiler-lcd-and.html).

Best of luck :)

Regards,

Debu :)

anilmaddala
01-20-2009, 03:21 AM
Hi Debu,
In LPC2138, is it possible to run two or more programs in parallel?

I mean, i will be running a main program, which takes some values from another secondary program, which should also be running at the same time?

debu
01-20-2009, 07:19 AM
Hi Debu,
In LPC2138, is it possible to run two or more programs in parallel?

I mean, i will be running a main program, which takes some values from another secondary program, which should also be running at the same time?

@anilmaddla: Yes, it is possible, and very common. You would need to use an OS like uC-OS (clickie) (http://www.micrium.com/) , uC Linux (clickie) (http://www.uclinux.org/)(the latter being free, and not real-time) or FreeRTOS (clickie) (http://www.freertos.org/).

Apart from the above, if you are using Keil MDK, it ships with a RTX kernel, you could directly use that.

Hope this helps,

Regards,

Debu :)

anilmaddala
02-25-2009, 06:07 PM
Hi debu,
Im having prob with PWM in ARM. Could uoy explain how to update PWMMR! register during the program itself?

Thanking you,
Anil

emb_sys_dev
03-05-2009, 05:13 PM
"I mean, i will be running a main program, which takes some values from another secondary program, which should also be running at the same time?"

Hi Debu,
"Running at the same time" is a bit of a misnomer. As you doubtless know, on a single core an RTOS does not have all its tasks running simultaneously,there is always context switching.
Maybe Anil's project might not need an RTOS,just a timer interrupt based call to a function which reads the info and shares it with MAIN.

BTW nice blog of yours , always great to see a techie enjoying his job. Which IDE are you using with WinARM ? Try Eclipse and YAGARTO/WinARM ? I recently had a problem with USB (LPC2148) under WinARM, "partially resolved" :)