EmbDev.net

Forum: ARM programming with GCC/GNU tools AT91SAM7X256 + LCD Driver


von Flying A. (flying)


Rate this post
useful
not useful
Hi

I am using the Olimex SAM7-EX256 board.

I would like to know where i can find the lcd driver to display
characters.

The olimex site has one sample code ie., LCD Write but i want a driver
to display characters and this is missing in that.

If anyone of you have any idea, please reply.

The board has Nokia 6100 TFT LCD with GE12 controller.

Regards
Flying

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Rajitha Dandu wrote:
> Hi
>
> I am using the Olimex SAM7-EX256 board.
>
> I would like to know where i can find the lcd driver to display
> characters.
>
> The olimex site has one sample code ie., LCD Write but i want a driver
> to display characters and this is missing in that.
>
> If anyone of you have any idea, please reply.
>
> The board has Nokia 6100 TFT LCD with GE12 controller.

See http://www.sparkfun.com/commerce/product_info.php?products_id=569
for an AT91SAM7S64 code which should be easily portable to AT91SAM7X256.

Also interesting code for an MSP430 board from Olimex:
http://www.olimex.com/dev/msp-4619lcd.html and code for AVR from Jesper
Hansen's  yampp project:
http://www.myplace.nu/mp3/download/files/yampp7_usb_color_v353.zip

In the software-package for the Olimex LPC-2378-STK
(http://www.olimex.com/dev/lpc-2378stk.html) there is well written
driver for the Nokia6100 compatible LCDs incl. some character functions.
Porting the low-level communication SPI-code from LPC2k to AT91SAM7
should be easy. Sorry, so far I have not requested a permission to
publish a GNU-port (for LPC2k not AT91SAM7) of this driver so it's not
available from my side.

Martin Thomas

von Flying A. (flying)


Rate this post
useful
not useful
Martin Thomas wrote:
> Rajitha Dandu wrote:
>> Hi
>>
>> I am using the Olimex SAM7-EX256 board.
>>
>> I would like to know where i can find the lcd driver to display
>> characters.
>>
>> The olimex site has one sample code ie., LCD Write but i want a driver
>> to display characters and this is missing in that.
>>
>> If anyone of you have any idea, please reply.
>>
>> The board has Nokia 6100 TFT LCD with GE12 controller.
>
> See http://www.sparkfun.com/commerce/product_info.php?products_id=569
> for an AT91SAM7S64 code which should be easily portable to AT91SAM7X256.
>
> Also interesting code for an MSP430 board from Olimex:
> http://www.olimex.com/dev/msp-4619lcd.html and code for AVR from Jespen
> Hansen's  yampp project:
> http://www.myplace.nu/mp3/download/files/yampp7_usb_color_v353.zip
>
> In the software-package for the Olimex LPC-2378-STK
> (http://www.olimex.com/dev/lpc-2378stk.html) there is well written
> driver for the Nokia6100 compatible LCDs incl. some character functions.
> Porting the low-level communication SPI-code from LPC2k to AT91SAM7
> should be easy. Sorry, so far I have not requested a permission to
> publish a GNU-port (for LPC2k not AT91SAM7) of this driver so it's not
> available from my side.
>
> Martin Thomas

Hi Thomas

Thank you for the response and the information.

I will go through the links you mentioned and try to fix things in
order.

Have a nice weekend ahead.

Regards
Rajitha

von Flying A. (flying)


Rate this post
useful
not useful
Hi

I am trying to display characters on lcd using the following functions:

void LCD_PixelPut(unsigned char x, unsigned char y, unsigned char
color);

void LCD_String(char *lcd_string, const char *font_style, unsigned char
x, unsigned char y, unsigned char fcolor, unsigned char bcolor);

The main function is as follows:

int main() {

   init();

   LCD_Fill(0,0,200,200,Black);
  sprintf(somestring,"Test");

  LCD_String(somestring,&FONT8x8F[0][0],5,10,LightGreen,Black);


}//main

It gives me error in sprintf statement:

undefined reference to `memcpy'

How can print the string?

Even i tried just LCD_PixelPut function but i cant see any pixel at the
position specified, is it due to some color definition.

Also LCD_Fill function works with only two colors Black and white when i
use other colors it doesn't display the color.

I am using the color definitions (RRRGGGBB) from a sample code from
Sparkfun as below:

#define DarkBlue    0x02
#define LightBlue   0x03
#define DarkGreen   0x14
#define LightGreen  0x1c
#define DarkRed     0x60
#define LightRed    0xe0
#define White       0xff
#define Black       0x00
#define Yellow      0xdd
#define Purple      0x62

Are these definitions standard or do i need to change for my controller,
if yes where i can find these color definitions.

Anyone of you have any ideas?

Have a nice day.

Regards
Flying

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Rajitha Dandu wrote:

> ...
> undefined reference to `memcpy'

string.h included? Linked with lib?

> How can print the string?

Not enough information. First check that low-level functions (lcd-init,
set/clear pixel).

> ...
> Also LCD_Fill function works with only two colors Black and white when i
> use other colors it doesn't display the color.

The "Nokia-lcd" can be configured for different color schemes.

> I am using the color definitions (RRRGGGBB) from a sample code from
> Sparkfun as below:
> ...
> Are these definitions standard or do i need to change for my controller,
> if yes where i can find these color definitions.

There are different lcd-controllers available on the "Nokia modules"
which use a slightly different command set. In the LPC2368-example from
IAR/Olimex two command sets are implemented and the controller-type gets
detected.

> Anyone of you have any ideas?

Just these few hints. I do not know enought about these LCDs but I have
seen various discussions about the different controllers ("Philips" and
"Epson" IRC) maybe one of the differences is the initialisation for the
color handling.

There is a sparkfun-forum which might be a better place to ask questions
on code provided on sparkfun-pages.

von Flying A. (flying)


Rate this post
useful
not useful
Thank you for the information.

Martin Thomas wrote:
>
> Rajitha Dandu wrote:
>
>> ...
>> undefined reference to `memcpy'
>
> string.h included? Linked with lib?
I included the string.h header file, i dont undertstand linking to
Library.
It's a standard header file so all the functions declared in that can be
accessible. How can i link that to the library. Can you clarify it more
clearly?

>> How can print the string?
>
> Not enough information. First check that low-level functions (lcd-init,
> set/clear pixel).

I mean in the sample code from sparkfun to print strings on lcd it's
written something like this:

sprintf(somestring,"Thanks SparkFun");
LCD_String(somestring,&FONT8x8F[0][0],5,10,LightGreen,Black);

so how it prints this string, usually we use print functions to print on
the output screen, so here the output screen is lcd or first its taken
into display RAM and why it's giving undefined reference to memcpy?

lcd init and put_pixel functions are defined.

>> Also LCD_Fill function works with only two colors Black and white when i
>> use other colors it doesn't display the color.
>
> The "Nokia-lcd" can be configured for different color schemes.

Ya i have seen that it can be configured for different colors but i
don't know whether the color definitions i am using are correct.
>
>> I am using the color definitions (RRRGGGBB) from a sample code from
>> Sparkfun as below:
>> ...
>> Are these definitions standard or do i need to change for my controller,
>> if yes where i can find these color definitions.
>
> There are different lcd-controllers available on the "Nokia modules"
> which use a slightly different command set. In the LPC2368-example from
> IAR/Olimex two command sets are implemented and the controller-type gets
> detected.

I didnt find the LPC2368 example neither on Olimex nor on IAR site.
>
>> Anyone of you have any ideas?
>
> Just these few hints. I do not know enought about these LCDs but I have
> seen various discussions about the different controllers ("Philips" and
> "Epson" IRC) maybe one of the differences is the initialisation for the
> color handling.

> There is a sparkfun-forum which might be a better place to ask questions
> on code provided on sparkfun-pages.

I have gone through the sparkfun lcd forum discussions as well but as
you said the discussions were mostly on Epson or Philips controllers,
and I dont know what controller my board has becuase i have checked the
commands in both controller data sheets and the code which olimex
provided, some commands do match but with different names and some
commands are additional, using that command mapping so far i have
written the basic commands.

I also post my problem on the sparkfun lcd forum maybe i will get some
help.

I can go to certain position on lcd and also the lcd fill function works
that means i can clear the display with black and white color but when i
try to draw a circle using put_pixle the same goto function and write
data function doesn't work, i cant see anything on the display, i dont
understand where its going wrong, i dont get any errors and the
functions are correctly declared, maybe due to some color definition
problems or setting up of color lookup table.


Have a nice weekend.

Regards
Rajitha

von Martin T. (mthomas) (Moderator)


Rate this post
useful
not useful
Rajitha Dandu wrote:

>> string.h included? Linked with lib?
> I included the string.h header file, i dont undertstand linking to
> Library.
> It's a standard header file so all the functions declared in that can be
> accessible. How can i link that to the library. Can you clarify it more
> clearly?

Verify that the libc get linked by passing -lc to the linker (either
directly to arm-elf-ld or thru the arm-elf-gcc frontend, depends on your
makefile/IDE-settings.

>>> How can print the string?
>>
>> Not enough information. First check that low-level functions (lcd-init,
>> set/clear pixel).
>
> I mean in the sample code from sparkfun to print strings on lcd it's
> written something like this:
>
> sprintf(somestring,"Thanks SparkFun");
> LCD_String(somestring,&FONT8x8F[0][0],5,10,LightGreen,Black);
>
> so how it prints this string, usually we use print functions to print on
> the output screen, so here the output screen is lcd or first its taken
> into display RAM and why it's giving undefined reference to memcpy?

Maybe because memcpy is needed implicitly by sprinf but I'm not sure.
Paste the output created during the build-process in a message(add -lc
first).
(Side-note: You could use strcpy instead of sprintf for your example so
you do not need stdio-functions.)

>...
> I didnt find the LPC2368 example neither on Olimex nor on IAR site.

As far as I know you can not find it since it's not available for
download.

von Flying A. (flying)


Rate this post
useful
not useful
> Verify that the libc get linked by passing -lc to the linker (either
> directly to arm-elf-ld or thru the arm-elf-gcc frontend, depends on your
> makefile/IDE-settings.

I made changes in make file to link the libc file, now it's not giving
any error.
>
> Maybe because memcpy is needed implicitly by sprinf but I'm not sure.
> Paste the output created during the build-process in a message(add -lc
> first).
> (Side-note: You could use strcpy instead of sprintf for your example so
> you do not need stdio-functions.)
>
>> Thank you for the information i will try both ways.
>> I didnt find the LPC2368 example neither on Olimex nor on IAR site.
>
> As far as I know you can not find it since it's not available for
> download.

ok

Thank you for the guidance and the information.

Have a nice evening.

Regards
Flying

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.