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 As LCD component is not well ???. I tried PWM, ADC,... all good.
Thank you for your help.
(dinhchithanh, fromt Vietnam)
Help me an example....
-
- Posts: 12
- Joined: Wed Oct 01, 2008 5:49 pm
- Location: Da Nang University of Technology-VietNam
- Contact:
- Steve
- Matrix Staff
- Posts: 3424
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: Help me an example....
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.
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.
-
- Posts: 12
- Joined: Wed Oct 01, 2008 5:49 pm
- Location: Da Nang University of Technology-VietNam
- Contact:
Re: Help me an example....
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.
The compiler issue warning (red), but i don't understand. Sorry for my English.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
- Attachments
-
- Flowcode2.fcf
- (4 KiB) Downloaded 309 times
Thank in advanced
- 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....
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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....
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- 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....
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.
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 377 times
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 12
- Joined: Wed Oct 01, 2008 5:49 pm
- Location: Da Nang University of Technology-VietNam
- Contact: