Tuesday, March 4, 2008

ARM7TDMI: RealView Compiler LCD and DELAY Headers

My Own LCD and Delay Headers
For the RealView Compiler for ARM


(Above: Usage Demonstrated on a NXP LPC2138 ARM7TDMI uC)


Keil's RealView Microcontroller Development Kit (a.k.a The RealView MDK) is a (Pardon the expression ;) ) really Phat piece of software. Considering the results from this Benchmark(PDF), Keil produces object code which is no less then 15% smaller and 10% faster then its closest competitor, It's a whopping 1.5 times better code generation then the GNU (think WinARM) compiler.

So whats wrong with it? (I mean, I'm sure that this post has got to have some meaning and conclusion right? Lol!) Well for starters the lack af a good library. Yes, It does contain all the ANSI/ISO - C libraries, and yes it contains a really kick-ass RTX-Kernel library, but it misses out on many simple libraries like the basic Character LCD library, the basic Delay libraries, and the simple things in life that we miss, like chocolate milk, and white roses, like the smell of dry leaves on green grass, the twitter of bir. . . . . . . . erm ....... you get the point.

So what did I do? I made a library for all to use. Well not strictly speaking. I took Martin Thomas's LCD Library for WinARM, fully dissected it, and remade it for the RealView MDK. This was no easy task, since the RealView MDK uses different notations for the same Registers (which is quite irritating, especially if you constantly need to move back and forth from the GNU compiler). Any ways, the task is done. The file is available for downloading, from this link, and thats that.

To test the headers, I used a LPC2138, you can see the Header board that I used below. I used a simple character LCD (the 162A variants).




You can modify the code to suit your hardware, when you make a project. I suppose you will not need to change anything but the following lines in LCD.h


Like this post? Leave a comment, it always makes my day. :)


4 comments:

OmkarCK said...

Have you made that board on your own ?

I want to work on ARM controllers. I will need some help, can I mail you directly ?

Devesh Rai said...

@OmkarCK: Yes, I can provide you with any assistance you may need. Just send me an E-Mail, with a short, rough description of the project. My Email ID is:
[my first name].[my surname]@gmail.com

Regards,

Debu :)

Anonymous said...

well i changed the pins to P0.8,9,10,11 for LCD data. i left rs,rw and en pins the same as urs.
i changed the masks for the data pins.

in my main program, i called
lcd_init();
lcd_putchar('H');

but nothing is appearing on the lcd. pls help

Devesh Rai said...

@Sanketh: Unfortunately, the information is not sufficient for me to discern the cause of the problem. If possible paste the code that you are compiling, also a link to the schematic of your board will simplify the solution.

Regards,

Debu