• AVR Freaks

Looking for LCD source code

Author
minimii
New Member
  • Total Posts : 18
  • Reward points : 0
  • Joined: 2009/02/26 11:35:59
  • Location: 0
  • Status: offline
2009/11/12 13:59:18 (permalink)
0

Looking for LCD source code

Hi,


Im using PIC24F series A PIC24F16KA102
Iv got 2 LCD-s, 1 with HD44780 and the other one is KS6600 controlled 
Also im using C30 as compiler (for PIC24F no software modules for lcd :S)

grin


Im looking for a sample code  ... a routines .... anything i could use to get stared with LCD.
I appreciate every suggestion, reply, thought ... on this subject.


Some questions i like to get answered  sad

1-How universal are the routines for char LCDs (Different PIC series...)
2-Can i use very simple LCD initializing program for a complex project, any problems or difficulties i may face later ? 
3-Iv seen a LCD source code with print function, WOW :D really nice. Do i really need it ?
4-Iv tried to display something on LCD... nothing shows up. If contrast pin is equal to a LCD voltage is it OK ?
5-If ill try to write a LCD initializing code by myself instead of using sample. Will it benefit ? Time ... result... knowledge. 
6-Is there a useful tutorial You know, ebook maybe... i could use.
7-What is the difference between 8 bit and 4 bit data interface ? How complicated is the in code configuration ?
8-Any problems i may face later ?



Thank You !
post edited by minimii - 2009/11/12 14:10:21
#1

5 Replies Related Threads

    icserny
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2008/09/07 13:27:08
    • Location: Debrecen, Hungary
    • Status: offline
    RE: Looking for LCD source code 2009/11/13 00:25:54 (permalink)
    0
    Look around here and here!
    You may be interested in the lecture notes, the textbook, and the downloadable software package as well. Only the latest version of the software (released in Octobre, 2009.) supports directly the PIC24FK family, especially the PIC24F16K102 type. You will find an example for the LCD in Chapter 8. (lcd4bit.c)
    #2
    minimii
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2009/02/26 11:35:59
    • Location: 0
    • Status: offline
    RE: Looking for LCD source code 2009/11/13 03:19:32 (permalink)
    0
    Thank you for a reply. grin


    Iv seen this already ... It is a great source to find things im looking for.

    I already tried to compile a lcd4bit code but there were no success.
    There are many include files, since im not very unexperienced * C30 user,I  believe i did something wrong at the point when  had to add  Library support files.... include-s.  I just dragged and dropped all include files to a MPLAB United Workspace window.  Compiler output does not show the "file missing" message but many messages are like :
      Executing: "C:\Program Files\Microchip\MPLAB C30\bin\pic30-gcc.exe" -mcpu=24F16KA102 -x c -c   "..\common\pic24_uart.c" -o"pic24_uart.o" -I"..\include" -D__DEBUG -g -Wall -O1
    ..\common\pic24_uart.c:534:2: warning: #warning UART2 pin mappings not defined!!! For simplicity,
    ..\common\pic24_uart.c:535:2: warning: #warning pin mappings are identical for UARTS 1-4. If your device has more than
    ..\common\pic24_uart.c:536:2: warning: #warning one UART, ****** CHANGE THE MAPPING ****** since
    ..\common\pic24_uart.c:537:2: warning: #warning multiple UARTs can not share the same pins.
    ..\common\pic24_uart.c:538:2: warning: #warning In particular:


    Maybe the    reesemicro - a books   include files are interfering with C30 own library files in a bad way ... somehow [&:]


    Can you point out some actions i may want to take to fix problem im having.
    Maybe it is a better choice to rewrite this code to use a c30 own library files.


    Again thank you very much for a reply.  wink
    post edited by minimii - 2009/11/13 06:44:44
    #3
    rbreesems
    Super Member
    • Total Posts : 472
    • Reward points : 0
    • Joined: 2005/02/07 15:08:08
    • Status: offline
    RE: Looking for LCD source code 2009/11/13 10:18:21 (permalink)
    0
    Thanks for using the code library.

    Those compiler messages you are seeing about UART2 are just warnings you get when you compile our code library with any PIC that has multiple UARTs --  our library code has the pin configuration functions for UART2 and above commented out and is a reminder to the user that should check these functions and edit them to match what they want to do if you want to use these UARTs.

    If you are not using any UARTS other than UART1, then just ignore these warnings.

    If you don't like these warnings appearing at all, then just edit the functions in common/pic24_uart.c and get rid of them or do whatever you wish to do. 

    Our library also outputs informational warnings about the currently select clock option and whatnot --these are information messages and not errors. 

    These warnings will not prevent the code from compiling.

    The chap8/lcd4bit.c code is fairly generic and we have had our students use it successfully with various 24H and 24F micros.  If it does not work, it is usually due to some initialization idiosynchrosy with the LCD and the initLCD() function has to be changed slightly. I have not personally tested it with a 24FK device, but I don't see why it should not work.

    I would suggest that you test the library with your 24FK device using the chap8/reset.c example - this is a generic example that only uses the UART1 for communication.  If you can get this successfully compile/load/run on your processor, then you are on your way in terms of using these examples.

    We have not tested many examples with the 24FK device and only recently added support for them, so let me know of any problems via this google groups site:
    http://groups.google.com/group/pic24-assembly-to-c-book


    post edited by rbreesems - 2009/11/13 10:22:22

    PIC24 code examples at http://www.reesemicro.com
    #4
    icserny
    Super Member
    • Total Posts : 258
    • Reward points : 0
    • Joined: 2008/09/07 13:27:08
    • Location: Debrecen, Hungary
    • Status: offline
    RE: Looking for LCD source code 2009/11/13 12:47:02 (permalink)
    5 (1)
    Can you point out some actions i may want to take to fix problem im having.

    It is not a "problem" at all. You were warned only that UART2 has no valid pin mapping. I guess, that you don't need it at all, so you don't have to do anything.
    Maybe it is a better choice to rewrite this code to use a c30 own library files.

    There are several choices:
    1. You can use the PIC24 support libraries downloaded from www.reesemicro.com
    2. Since the lcd4bit.c is a quite self-containing code (from the point of view of handling the LCD), you can rewrite it to a code which doesn't use _any_ library. (Of course, you should provide the clock setup code and few delay routines).
    3. It is also possible to use the "factory" C30 library functions (OpenXLCD, BusyXLCD, PutsXLCD,etc.).


    1-How universal are the routines for char LCDs (Different PIC series...)
    Theoretically it can be witten in a portable way, but who care it?
    2-Can i use very simple LCD initializing program for a complex project... ? 
    Why not?
    3-Iv seen a LCD source code with print function, WOW :D really nice. Do i really need it ?
    You may need it if you make complex formatting or conversion.
    4-Iv tried to display something on LCD... nothing shows up. If contrast pin is equal to a LCD voltage is it OK ?
    Not at all. It should be somewhere near to ground (in my case the data sheet says tha Vdd= 5 V, VO= Vdd-4.4 V, so VO is about 0.6V)

    5-If ill try to write a LCD initializing code by myself instead of using sample. Will it benefit ?
    You may have  different intention  (say need blinking cursor, special characters) which may be a good reason to change the sample code. You may also want to reset the LCD in special cases, which is missing from the usual example programs).
    6-Is there a useful tutorial You know, ebook maybe... i could use.

    HD44780 datasheet
    On-line LCD simulator
    tutorial part 1.
    tutorial part 2.
    7-What is the difference between 8 bit and 4 bit data interface ? How complicated is the in code configuration ?
    The 4-bit mode moves data in a half byte pieces.  It requres fewer pins, bits and wires, but more time.
    8-Any problems i may face later?

    Who knows the future? :-)

    #5
    minimii
    New Member
    • Total Posts : 18
    • Reward points : 0
    • Joined: 2009/02/26 11:35:59
    • Location: 0
    • Status: offline
    RE: Looking for LCD source code 2009/11/13 14:29:52 (permalink)
    0
    Thank You icserny  and Thank You rbreesems !

    Id consider Your replies and threat them with the highest priority wink
    Things unknown were presented as forgotten. The questions, i had, got answered, answered by You.



    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5