Electronic Circuits and Projects Forum



Pic lcd

  1. #1
    Dreak Dreak is offline

    Pic lcd

    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
    k.png
    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.
    Attached Images
    • File Type: jpg k.jpg (75.4 KB, 15 views)

  2. #2
    throbscottle throbscottle is offline
    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.
    0
    ~~o0o~~Knowledge is like plaster on a wall. Start picking at any small holes in it, you quickly find they are actually big holes in disguise.~~o0o~~

  3. #3
    Sceadwian Sceadwian is offline
    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.
    0

Tags
Similar Threads
Thread Starter Forum Replies Last Post
PIC LCD fun! Mike, K8LH Microcontrollers 10 21st June 2010, 04:05 PM
PIC LCD driver - need some advice Futterama Electronic Projects Design/Ideas/Reviews 12 1st November 2005, 11:48 AM
Hey Nigel, help with your PIC LCD tutorial NewGeek Microcontrollers 11 29th August 2004, 03:02 PM
Using 12v from car to power PIC LCD application NewGeek Microcontrollers 5 20th August 2004, 11:19 PM
4-bit PIC-LCD assembler-tutorial egh01 Microcontrollers 1 19th September 2003, 10:07 PM
Electronic Circuits  |  Learning Electronics

Join our community with over 100,000 Members! It's free, easy and when you're logged in you have many more features! Click to register.
Page Time: 0.05572 seconds      Memory: 7,251 KB      Queries: 17      Templates: 0