Pic lcd

Status
Not open for further replies.

Dreak

New Member
Here is my program
void delay(int);
#include<p18f452.h>
void main(void)
{
LATCbits.LATC4=0;
LATCbits.LATC5=0;
delay(100);
LATCbits.LATC5=1;
delay(100);
LATD=0x38;
LATCbits.LATC4=0;
LATCbits.LATC5=0;
delay(100);;
LATCbits.LATC5=1;
delay(100);
LATD=0x01;
LATCbits.LATC4=1;
LATCbits.LATC5=0;
delay(100);;
LATCbits.LATC5=1;
delay(100);
LATD='w';
}
void delay(int a)
{
int j;
for(j=0;j<a;j++)
{
}
}
& here is a schematic for reference
View attachment 63764
the program neither works on PIC Board, nor on Proteus sim
& this is not just about this particular program. no program (even as simple as led blinking didn't run). Any reasons? Ic does get programmed though.
 
This is interesting to me because I am a PIC newbie too!

In your program, I don't see a value being assigned to "a" - but I don't really know C. Does it get the value from the function call?

Have you checked that the power/gnd connections actually have voltage on them? It's strange not even an LED flasher will work. Can you run the program step by step in your IDE?

If no program will run, how can you tell it is being programmed? Is your IDE using the correct compiler? Does the chip get vcc,vpp and gnd when it's being programmed? Check voltages at the actual pins of the PIC.

Well, that's all I can think of. Good luck.
 
Dreak, you should always post code in between code tags (there's an icon for it in the bar about the text you enter when creating a post) this allows the white spacing (tabs and indentation) to appear correctly for code making it much more readable.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…