Help me an example....

Forum for problems or queries regarding other Flowcode Components. Eg LEDs, Switches, LCD, Gfx LCD etc

Moderators: Benj, Mods

Post Reply
dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Help me an example....

Post by dinhchithanh »

Hello Matrix Multimedia's team.
Can you help me an example to display LCD 16x2 with atemega8 (i have only one). I I have tried it but do not have to successfully on my chip :idea: As LCD component is not well ???. I tried PWM, ADC,... all good.
Thank you for your help.

(dinhchithanh, fromt Vietnam)
Thank in advanced

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Help me an example....

Post by Steve »

When using the LCD component, always remember to first call the LCD::Start macro (this will initialize the component into the proper mode).

If it is still not working, make sure the connections are correct and that the clock speed you have selected within Flowcode is the same as the clock speed of the chip itself. The LCD component is a bit sensitive to timing.

dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Re: Help me an example....

Post by dinhchithanh »

Yes, i doing as you say, then burning to PIC16f877A on PICDEM 2 PLUS KIT but LCD did not display true. I attachment my example below. Please help me.
File name: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
Generated by: Flowcode v3.4.7.48
Date: Thursday, November 13, 2008 20:21:18
Licence: Demo

***DEMO VERSION***


NOT FOR COMMERCIAL USE

http://www.matrixmultimedia.com



Launching the compiler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC16F877A "Flowcode2.c"

BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday

Single user Lite License (Unregistered) for 0 node(s)
Limitations: PIC12,PIC16 max code size:2048 words, max RAM banks:2, Non commercial use only


Flowcode2.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" "C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c" -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o Flowcode2.pp -v -d _BOOSTC -d _PIC16


.......

Flowcode2.c success

success

...............
Return code = 0

Launching the linker/assembler...

C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostlink.pic.exe -ld "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\lib" libc.pic16.lib flowcode.pic16.lib "Flowcode2.obj" -t PIC16F877A -d "C:\Documents and Settings\Dinh Chi Thanh\My Documents" -p "Flowcode2"

BoostLink Optimizing Linker Version 6.70
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday


Caution: argument of 'delay_10us' calls must have a value of 1 or more
Warning unreferenced functions removed:
FCD_LCDDisplay0_GetDefines in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_Clear in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_PrintASCII in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_Command in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_RawSend in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_Cursor in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
FCD_LCDDisplay0_PrintNumber in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c
LCD_524922_Dummy_Function in: C:\Documents and Settings\Dinh Chi Thanh\My Documents\Flowcode2.c


Building CASM file

Memory Usage Report
===================
RAM available:368 bytes, used:28 bytes (7.7%), free:340 bytes (92.3%),
Heap size:148 bytes, Heap max single alloc:94 bytes
ROM available:8192 words, used:292 words (3.6%), free:7900 words (96.4%)


success

......................
Return code = 0

FINISHED




The compiler issue warning (red), but i don't understand. Sorry for my English.
Attachments
Flowcode2.fcf
(4 KiB) Downloaded 307 times
Thank in advanced

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help me an example....

Post by Benj »

Hello

The compiler warnings are simply optimizations that remove code you are not using. Note the LCD Start and LCD Print functions are not in the list.

Are you sure that you have assigned the connections of the LCD correctly using the Flowcode component connections settings. The PICDEM 2 board may allow access to the Read/Write line which may shift the enable pin up to the next pin.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help me an example....

Post by Benj »

Hello

Looking at the PICDEM schematic it is clear that the LCD uses a section of PortA for the control and PortD for the Data. Flowcode is not currently capable of using split ports without editing the component code by hand. If you need help doing this then let me know.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Help me an example....

Post by Benj »

Hello

Ok I have hard wired the LCD connections in this code file. Please make a backup of your LCDDisplay_Code.c file located in your Flowcode V3/Components folder and then replace with the file attached to this posting. Once you have done this restart Flowcode and your LCD on the PICDEM board should now work correctly. Also you will have to output a 0 to pin RA2 before you call any of the LCD commands to set the LCD into Write mode.
Attachments
LCDDisplay_Code.c
(7.56 KiB) Downloaded 375 times

dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Re: Help me an example....

Post by dinhchithanh »

OK, thanks you very much.
:lol: :lol: :lol:
Thank in advanced

Post Reply