Continue to Site

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.

  • 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.

XLCD-18F4525 not working !!

Status
Not open for further replies.

loup-garou

New Member
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.
 

Attachments

  • XLCD-PIC18F.zip
    75.7 KB · Views: 580
  • PIC18F-LCD.JPG
    PIC18F-LCD.JPG
    57.1 KB · Views: 3,202
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
 

Attachments

  • RTC_LCD.jpg
    RTC_LCD.jpg
    39.2 KB · Views: 880
richard.c said:
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

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:
 
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
 
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:
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} }

}
 

Attachments

  • LCD - test.zip
    14 KB · Views: 386
Last edited:
richard.c said:
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

thank you for your advices richard.c :)
 
arhi said:
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:
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} }

}


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.
 
loup-garou said:
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.

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 )
 
arhi said:
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 )

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:
arhi said:
I do not have ULN2083 in ISIS, only ULN2001/2002/2003/2004 so I cannot try ... and those 4 simulate ok.

sorry, I mean ULN2803.

I'll be very pleased, if you send me the simulation file of one of those ULN !
 
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=-

loup-garou said:
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.
 
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.

**broken link removed**


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=-
 

Attachments

  • XLCD.zip
    75 KB · Views: 272
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.
 
Status
Not open for further replies.

Latest threads

Back
Top