EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

PIC18F2620 sample code in a sample project in MPLAB

Started by ssylee September 6, 2007
I'm currently using MPLAB's C18 compiler to build a hex file from a
simple "hello world" program to flash onto the program memory of a
PIC18F2620 in order to see if I can perhaps create a program to toggle
a pin to get started. However, I have been getting the following error
in the pastebin link from the Build window: http://www.pastebin.ca/684463.
I'm using a PICKIT 2 programmer from Microchip, which is preliminarily
supported in MPLAB v7.62.

Below is my sample code modified from the C18 compiler example files.
I have remembered to include a linker file for building the hex file,
although I couldn't find the output hex file.

<code>
/* Compile options:  -ml (Large code model) */

#include <stdio.h>
#include <p18f2620.h>

#pragma config WDT = OFF

void main (void)
{
  printf ("Hello, world!\n");

  while (1)
    ;
}
</code>

I have also ensured that the pins are connected properly, matching
every pin of the programmer header to the corresponding pins on the
microcontroller. Does anyone have any idea where should I start
looking?

ssylee wrote:
> I'm currently using MPLAB's C18 compiler to build a hex file from a > simple "hello world" program to flash onto the program memory of a > PIC18F2620 in order to see if I can perhaps create a program to toggle > a pin to get started. However, I have been getting the following error > in the pastebin link from the Build window: http://www.pastebin.ca/684463. > I'm using a PICKIT 2 programmer from Microchip, which is preliminarily > supported in MPLAB v7.62.
The initial message indicates that you have a power supply problem. Is your processor on a target board? Try supplying external power to the processor before programming. -- Thad
On Sep 6, 8:00 pm, Thad Smith <ThadSm...@acm.org> wrote:
> ssylee wrote: > > I'm currently using MPLAB's C18 compiler to build a hex file from a > > simple "hello world" program to flash onto the program memory of a > > PIC18F2620 in order to see if I can perhaps create a program to toggle > > a pin to get started. However, I have been getting the following error > > in the pastebin link from the Build window:http://www.pastebin.ca/684463. > > I'm using a PICKIT 2 programmer from Microchip, which is preliminarily > > supported in MPLAB v7.62. > > The initial message indicates that you have a power supply problem. Is > your processor on a target board? Try supplying external power to the > processor before programming. > > -- > Thad
Hi Thad, My processor is on a breadboard, with its MCLR_bar, Vss, Vdd, PGD and PGC pins connected to the programming header. I later found out that my problems lies within the Vss and Vdd connection being reversed. After I fixed that (shown at line 6 shown on the pastebin), I later have a problem of not being able to write on the program memory of my processor. Hope this helps clarify my question. Stanley
ssylee wrote:
> On Sep 6, 8:00 pm, Thad Smith <ThadSm...@acm.org> wrote: > >>ssylee wrote: >> >>>I'm currently using MPLAB's C18 compiler to build a hex file from a >>>simple "hello world" program to flash onto the program memory of a >>>PIC18F2620 in order to see if I can perhaps create a program to toggle >>>a pin to get started. However, I have been getting the following error >>>in the pastebin link from the Build window:http://www.pastebin.ca/684463. >>>I'm using a PICKIT 2 programmer from Microchip, which is preliminarily >>>supported in MPLAB v7.62. >> >>The initial message indicates that you have a power supply problem. Is >>your processor on a target board? Try supplying external power to the >>processor before programming. >> >>-- >>Thad > > > Hi Thad, > > My processor is on a breadboard, with its MCLR_bar, Vss, Vdd, PGD and > PGC pins connected to the programming header. I later found out that > my problems lies within the Vss and Vdd connection being reversed. > After I fixed that (shown at line 6 shown on the pastebin), I later > have a problem of not being able to write on the program memory of my > processor. > > Hope this helps clarify my question. > > Stanley >
So You have destroyed Your PIC by reversing the power supply. Get a new chip. -- Micke
On Sep 7, 3:13 pm, deadbeef <d...@be.ef> wrote:
> ssylee wrote: > > On Sep 6, 8:00 pm, Thad Smith <ThadSm...@acm.org> wrote: > > >>ssylee wrote: > > >>>I'm currently using MPLAB's C18 compiler to build a hex file from a > >>>simple "hello world" program to flash onto the program memory of a > >>>PIC18F2620 in order to see if I can perhaps create a program to toggle > >>>a pin to get started. However, I have been getting the following error > >>>in the pastebin link from the Build window:http://www.pastebin.ca/684463. > >>>I'm using a PICKIT 2 programmer from Microchip, which is preliminarily > >>>supported in MPLAB v7.62. > > >>The initial message indicates that you have a power supply problem. Is > >>your processor on a target board? Try supplying external power to the > >>processor before programming. > > >>-- > >>Thad > > > Hi Thad, > > > My processor is on a breadboard, with its MCLR_bar, Vss, Vdd, PGD and > > PGC pins connected to the programming header. I later found out that > > my problems lies within the Vss and Vdd connection being reversed. > > After I fixed that (shown at line 6 shown on the pastebin), I later > > have a problem of not being able to write on the program memory of my > > processor. > > > Hope this helps clarify my question. > > > Stanley > > So You have destroyed Your PIC by reversing the power supply. > Get a new chip. > > -- Micke
Hey Micke, I'm apparently still able to program and erase the current chip after correcting the connections. Just having some trouble getting started now with looking at printf() commands after programming the chip. Cheers, Stanley

The 2024 Embedded Online Conference