PIC18f4550 error

Discussion in 'Embedded Systems and Microcontrollers' started by will1, May 14, 2009.

  1. will1

    Thread Starter New Member

    May 14, 2009
    hi all

    i am currently trying to program a PIC18f4550 with a pickit 2, at the moment i am just trying to send Portd high, so my code is pretty simple, and i currently am useing a simulater called proteus to simulate my code and that works fine, so there is nothing wrong with my code. At the moment i have the 18f4550 set up on a bread board with its vdd pins at 5v and its vss pins at gnd. I am currety using the LVP for the pic, setting the PGM pin high to 5v, but it seems to work fine if you ground the PGM pin. I have tried unsucessfully tried to use HVP by setting MCLR to 10v whle grounding PGM, but that dosent work either

    I am using MPlab with the CC18 compler, but i have been using the Pickit 2 programmer as well.

    Mplab and the Pickit 2 programer can read and write to the pic, the hex file can be loaded, and it can be written to the pic, the problem is that nothing happens at the portd pins.........
    and here is where things get interesting, i have had it working on lvp where the program does what is expected, but it just stoped working, the only thing that may give some hints is that when i sent the program to the pic, instead of just making the portd pins 5v, it makes every pin 5v.
    i read in a post before that you need to set your lvp config bits, and i have done that by making a header file (PIC18f4550w.h) with all the config bits that i want. here is the code just to make sure i havent blown the obvious.

    #include <p18f4550.h>
    #include <PIC18f4550w.h>

    void main(void)

    TRISD = 0;
    PORTD = 0xff;
    while (1)

    and yes i do have a cap over the vdd and vss pins

    appreciate any help that can be given
    thanks will:eek:
  2. mik3

    Senior Member

    Feb 4, 2008
    • a.txt
      File size:
      2.4 KB