Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 10th May 2008, 06:23 PM   (permalink)
Angry XLCD-18F4525 not working !!

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 !!!
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).

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

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




thanks in advance.
Attached Images
File Type: jpg PIC18F-LCD.JPG (57.1 KB, 14 views)
Attached Files
File Type: zip XLCD-PIC18F.zip (75.7 KB, 10 views)
loup-garou is offline   Reply With Quote
Old 10th May 2008, 07:41 PM   (permalink)
Default

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 Images
File Type: jpg RTC_LCD.jpg (39.2 KB, 10 views)
richard.c is offline   Reply With Quote
Old 10th May 2008, 07:47 PM   (permalink)
Default

Ops,

Should have said that the standard Isis lcd does include the HD44780 controller.
richard.c is offline   Reply With Quote
Old 10th May 2008, 07:54 PM   (permalink)
Default

Quote:
Originally Posted by richard.c
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 !!
loup-garou is offline   Reply With Quote
Old 10th May 2008, 08:24 PM   (permalink)
Default

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
richard.c is offline   Reply With Quote
Old 10th May 2008, 08:26 PM   (permalink)
Default

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

}
Attached Files
File Type: zip LCD - test.zip (14.0 KB, 8 views)
__________________
http://www.it4um.com

Last edited by arhi; 10th May 2008 at 08:28 PM.
arhi is offline   Reply With Quote
Old 10th May 2008, 08:44 PM   (permalink)
Default

Quote:
Originally Posted by richard.c
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
loup-garou is offline   Reply With Quote
Old 10th May 2008, 08:47 PM   (permalink)
Default

Quote:
Originally Posted by arhi
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 is offline   Reply With Quote
Old 10th May 2008, 08:57 PM   (permalink)
Default

Quote:
Originally Posted by loup-garou
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 )
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 10th May 2008, 09:11 PM   (permalink)
Default

Quote:
Originally Posted by arhi
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 by loup-garou; 10th May 2008 at 09:17 PM.
loup-garou is offline   Reply With Quote
Old 10th May 2008, 09:15 PM   (permalink)
Default

I do not have ULN2083 in ISIS, only ULN2001/2002/2003/2004 so I cannot try ... and those 4 simulate ok.
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 10th May 2008, 09:23 PM   (permalink)
Default

Quote:
Originally Posted by arhi
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 !
loup-garou is offline   Reply With Quote
Old 10th May 2008, 11:52 PM   (permalink)
Default

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

Quote:
Originally Posted by loup-garou
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 !!!
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).

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

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




thanks in advance.
bryan is offline   Reply With Quote
Old 11th May 2008, 12:01 AM   (permalink)
Default

Quote:
Originally Posted by loup-garou
sorry, I mean ULN2803.
I'll be very pleased, if you send me the simulation file of one of those ULN !
No ULN2803 neither in my ISIS
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Old 11th May 2008, 12:16 AM   (permalink)
Default

Quote:
Originally Posted by loup-garou
I'll be very pleased, if you send me the simulation file of one of those ULN !
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
File Type: zip nj.zip (12.2 KB, 3 views)
__________________
http://www.it4um.com
arhi is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
PWM on 18F4525 futz Micro Controllers 6 10th May 2008 04:49 AM
serial ports not working... simrantogether General Electronics Chat 23 22nd September 2007 06:29 PM
Working with household mains cables (not flex) SimonW General Electronics Chat 4 1st February 2007 01:11 AM
faulty digital components testing,checking walters General Electronics Chat 5 22nd August 2005 07:10 PM
Working Summing Amplifier Simulation? petesmc General Electronics Chat 2 25th November 2003 07:01 AM



All times are GMT. The time now is 01:42 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.