1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

XLCD-18F4525 not working !!

Discussion in 'Microcontrollers' started by loup-garou, May 10, 2008.

  1. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta
    Hi there,

    I used XLCD library in my C code, to display a message on LCD Display (2x16, with HD44780 LCD controller) using the PIC18F4525, I compilled the programm successfully, and made a schematic on ISIS in order to simulte it but, I failed to get anything to display !!! :confused:
    besides the PORTA0 which is configurated as DATA PORT remaind in low level during simulation, on the other hand PORTB (which is not used in my application) had varied level in its outputs (see joined picture).:confused:

    what is the resaon of this abnormality ?
    I have another question, does the ISIS LCD display include the HD44780 LCD controller , or should I add it from the libray the scheme?, if it's the cas how will I display ?? :confused:

    I joined my project compiled+ISIS simulation file+ a prints screen of ISIS schematic.




    thanks in advance.
     

    Attached Files:

  2. richard.c

    richard.c New Member

    Joined:
    May 28, 2007
    Messages:
    168
    Likes:
    4
    Location:
    England
    Hi,

    Not into C so cannot help you with the code, but the attached file does display correctly.

    No need to connect pins 1,2,3 - lcd pin5 R/W, if unused, is taken directly to 0v and not connected to the Pic.

    The display is the standard Isis library item.

    hth
     

    Attached Files:

  3. richard.c

    richard.c New Member

    Joined:
    May 28, 2007
    Messages:
    168
    Likes:
    4
    Location:
    England
    Ops,

    Should have said that the standard Isis lcd does include the HD44780 controller.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta

    Hi Richard.c

    thanks for answering me,

    I disconnected pins 1, 2, 3 (why doing this ?) and R/W from PIC, but nothing has changed !! :confused:
     
  6. richard.c

    richard.c New Member

    Joined:
    May 28, 2007
    Messages:
    168
    Likes:
    4
    Location:
    England
    Hi,

    Pins 1,2,3 are taken care of by Isis as a standard connection.

    The Isis design should work - but not knowing C cannot help directly.
    From my experiences with assembler LCD code, the slightest error and nothing works - its always a difficult routine to set up.

    Do a search on this forum for 'C and LCD' for previous similar questions.

    Also, give it a few more hours for the Earth to spin around - sure others will soon help you with this problem
     
  7. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    here is the isis schematic with hex file that works

    it is standard text lcd

    as for the code .. I use mikroC mostly and it has libraries for lcd etc..
    Code (text):

    void main(){

      Lcd_Init(&PORTD);

      Lcd_Cmd(Lcd_CLEAR);

      Lcd_Cmd(Lcd_CURSOR_OFF);

      Lcd_Out(1, 1, "LCD Test");

      Lcd_Out(2, 1, "1234567890123456");

      while(1){ asm {nop} }

    }
     
     

    Attached Files:

    Last edited: May 10, 2008
  8. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta
    thank you for your advices richard.c :)
     
  9. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta

    hi arth,

    firstly, thank tou for helping me with this code + simulation file ;)
    secondly, it seems to be much less complicated than XLCD library and files, but I can't change from it cause I'm using MPLAB enviorement and hence C18 compiler of Microchip for beter compatibilty.
     
  10. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    I believe C18 might be better in many ways (not only compatibility) then other compilers, but as I usually have to work with 12(F|C)* and 16F* so I use PICC and mikroC .. Never tried C18 so cannot compare it to others.

    Look for some LCD examples in C18, and get them to work first. ISIS is a big help there as it can simulate the whole circuit .. attach a graph to whole PORTD and run your software, maybe you connected it wrong (maybe you should use D4-D7 and not D0-D3 )
     
  11. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta
    thank you for advices arth, but the problem is somewhere else I think.

    Concerning ISIS, this soft does not simulate corretly with some components/circuits, here is an exemple I've faced and you can try it by yourself:

    the ULN2083 seems to be a faulty component, I tried several times to command relays with it, but despite the circuits were correct I wasn't able to excite the coil and turn on the relay.
     
    Last edited: May 10, 2008
  12. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    I do not have ULN2083 in ISIS, only ULN2001/2002/2003/2004 so I cannot try ... and those 4 simulate ok.
     
  13. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta
    sorry, I mean ULN2803.

    I'll be very pleased, if you send me the simulation file of one of those ULN !
     
  14. bryan

    bryan Member

    Joined:
    Jun 21, 2003
    Messages:
    416
    Likes:
    3
    Location:
    Vancouver, Canada
    Hello;

    I had the same problems, I will upload a C18 LCD project that should get you back on track , but can't do it right know. Check back later or tomorrow.

    -=Bryan=-

     
  15. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    No ULN2803 neither in my ISIS :(
     
  16. arhi

    arhi Member

    Joined:
    Apr 17, 2008
    Messages:
    887
    Likes:
    12
    Location:
    Belgrade, .rs
    Attached circuit with ULN2004A, but we are going too much off topic. If you have further problems with ULN2* please open separate thread for them (and not in uC section)
     

    Attached Files:

    • nj.zip
      File size:
      12.2 KB
      Views:
      133
  17. bryan

    bryan Member

    Joined:
    Jun 21, 2003
    Messages:
    416
    Likes:
    3
    Location:
    Vancouver, Canada
    Hello loup-garou

    Here is a very basic example with a VSM enclosed as well, it's been a bit since I used C so excuse me if there is any programming foopahs. The example works and should get you going.

    http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1411


    The easiest thing to do is download the utility called Application Maestro from MicroChip. This utility allows you to create the code for a LCD dependant on the setting you provide.

    -=Bryan=-
     

    Attached Files:

  18. loup-garou

    loup-garou New Member

    Joined:
    Mar 28, 2008
    Messages:
    86
    Likes:
    0
    Location:
    Malta
    hi Bryan and arhi,


    thank you very much for your answers,advices and "attatched" helps ;)

    it's really nice to find persons ready to help like you.


    I'll bring my results later.
     

Share This Page