SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By jonloveslou
#50663
Hi guys,

Does anybody have any working code for the LCD screen on the 2378-STK dev board from Olimex?

I've tried initialising the display using Jim Lynch's code and I *think* I've set the SSP0 peripheral up correctly and selected the various pins to do their required function.

The boards come with the Olimex symbol already on them when new so somebody, somewhere has got the displays working!

Regards,
Jon
By shraddha
#50743
facing the same problem will anybody share his working code
(LPC2378STK+OpenOCD+Wiggler)
By Sak1s
#51125
i am trying to make the LCD works with the eclipse IDE as the example of James P. Lynch ,but the code its a bit buggy ,but give it a look and post any fixes or any ideas.

download from here :
http://insane.homelinux.net/lpc2378stk.zip
By jonloveslou
#51559
I'm getting the following error message when trying to download that zip file:

Error - Bad Request
This web server is running in SSL mode. Try the URL https://10.17.132.126:80/ instead.
By Sak1s
#51583
ok....its fixed !
By jonloveslou
#51599
Ok, I've got a copy now.

I've left my version at home (with no internet!) so I have nothing to compare it to at the moment, but I will take a look through and see.

Cheers!
By jonloveslou
#51684
Brilliant. The code works great.

I've only tried the PutChar, PutStr, SetPixel, ClearScreen and Write130x130bmp functions and they seem to behave well.

Apart from the PutChar...
Any letters that require pixels in the bottom row (y, p, q, etc) get messed up and the bottom row is placed at the top of the character instead.

I fixed this by doing the following:
Code: Select all
// get pointer to the last byte of the desired character
pChar = pFont + (nBytes * (c - 0x1F)) + nBytes;
I removed "- 1" from the end of that line and also, further down:
Code: Select all
for (i = nRows; i >= 0; i--) {
// copy pixel row from font table and then decrement row
PixelRow = *pChar--;
I removed "- 1" from nRows.

If there any other bugs you can think of, let me know and I will take a look.

Jon
By Tactcom
#59749
Gus im in the same kinda boat as well lol...

Tried the link but both don't work :S anyone got a working link?

Thanks,

(another person called Jon... lol)
By Sak1s
#68958
...the source code is here...
http://insane.homelinux.net/lcd.rar

In the rar there are 2 projects.....i dont remember which is the working one !
Test and post any comment
By vickyfires
#70511
what compiler r u people using for this olimex lpc2378 sdk?
By jharvey
#81218
The above posted code works great on my 2378 board. However, I've attempted to modify it and now it no worky. I've been racking my head trying to figure out what's gone wonky.

I currently get error(s) similar to this, followed by a bunch of others messages, when I compile the project "LPC_LCD-ADC_Sample".

ADC.c:150: warning: implicit declaration of function 'InitSpi'
ADC.c:150: warning: nested extern declaration of 'InitSpi'

Eventually these warning turn into this.

c:/gccfd/yagarto/bin/../lib/gcc/arm-elf/4.2.2/../../../../arm-elf/bin/ld.exe: BFD
(GNU Binutils) 2.18 assertion fail ../../binutils-2.18/bfd/elf32-arm.c:6532
C:\gccfd\projects\LPC_LCD-ADC_merged/ADC.c:178: dangerous relocation: (null)
collect2: ld returned 1 exit status

Looks like I didn't do the declaration correctly. I see them in the .h files perhaps I don't call for the .h file in the correct location. Or perhaps I've buggered the make file some how and the .o files can't see each other or something. Not really sure what changed from the LCD file to this one and caused the problem. I also don't know how to fix it.

At the below link are three projects I'm working with.

http://jaredharvey.com/temp/projects_2009-08-29.zip

I'm compiling with the prepackage collection of windows based compiler tools that came with the 2378 board. This includes eclipse Version: 3.4.1 Build id: M20080911-1700, arm-elf-gcc (GCC) 4.2.2, and flash magic.

LPC_LCD_Sample is the slightly modified project from the above posted code and it displays a custom message on the LCD screen. This has been only slightly modified.

LPC_ADC_Sample is a modified copy of a project at a winarm page. It was orginally for a LPC21XX chips, I replaced the LPC21XX.h file with LPC23XX, and it appears to compile. I think it runs. It is to large for RAM so it runs from ROM. It also uses the Thumb mode compression. I found that code here and is also public domain.

http://www.siwawi.arubi.uni-kl.de/avr_p ... #gcc_stdio

LPC_LCD-ADC_Sample is a copy of LPC_ADC_Sample, with bits of the LCD code copied and pasted into the orginal sample code.

It does not compile. I have no need for the UART stuff. I seem to recall ADC is defined in there. So I have to keep it, but I'd be willing to remove it from the make file if I can.

My goal is to get the accelerometer displaying on the LCD.

Any help will be much appreciated, and thanks in advance.
By jharvey
#81526
Turns out make clean, then make all fixed my little red wagon on the above post. Appears when I copied the original file, there were some other files that needed updating that weren't being updated. Now I've got different issues.

I appear to have a clock issue, when I merge this LCD and ADC code together, if I enable the ADC or the PLL, it causes the LCD to fail. So I'm looking at the lower level bits now to confirm exactly what's going on. However, I can't find information about what the lower level bits do.

Is there is a better data sheet out there for the 2378? All I can find from NXP is this little 55 page doc that's really just an overview titled LPC2377_78_4.pdf Right now I'm looking for a break down of the memory. For example, I'm looking to learn exactly what this does.
Code: Select all
// --- enable and connect the PLL (Phase Locked Loop) ---
// a. set multiplier and divider
PLLCFG = MSEL | (0<<PSEL1) | (1<<PSEL0);
I see PLLCFG equates to 0xE01FC084, however, I don't know what the bits at this memory location will do, so I can't confirm if the above bit manipulation will work. Also from the ADC side I see this.
Code: Select all
// Setup A/D: 10-bit AIN0 @ 4,2MHz "Non-Burst"-Mode

PINSEL1  |=  (1UL<<22);  //  set function P0.27 as AIN0
In this case PINSEL1 equates to 0xE002C004, so what do the bits at this location do? I can't determine that with the data sheet I have. All I can determine is that this section of memory is the APB PERIPHERALS. Perhaps there is a generic ARM7 doc out there or something that I'm missing. Not sure.

Any help would be much appreciated.
By cfb
#81578
jharvey wrote:Is there is a better data sheet out there for the 2378? All I can find from NXP is this little 55 page doc that's really just an overview titled LPC2377_78_4.pdf
What you need is the 684 page LPC23xx User Manual (UM10211). You can download a copy from:

http://www.standardics.nxp.com/support/ ... ?type=user
By jharvey
#81630
That PDF has answered a great many questions. Thanks.
By jharvey
#81808
I got my above project working. I thought I'd post it here as it started from the I2C code found in this thread. The attached zip was compiled with winbloz XP using the prepackaged CD that came with the dev board.

This code will read the X and Y of the accelerometer, and display it on the LCD. There are some unfinished parts like the PLL, ect. It compiles with some complaint about implicit functions, but it works so I haven't paid it much concern. Here's a picture of it working.

Image

and a link to the larger larger version of this thumbnail.

http://i324.photobucket.com/albums/k352 ... ase1_1.jpg

Seems only fair to post what I've got, might be handy for someone else who is working with the ADC.

http://jaredharvey.com/temp/LPC_LCD-ADC ... orking.rar
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]