Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Starting out with a PIC16f54

Not open for further replies.


Junior Member level 1
Mar 20, 2011
Reaction score
Trophy points
Activity points

I bought this PIC in a hurry and have found it's not very well supported.
But I'd like to get some use out of it, except I can't be sure if it's working okay.

I'm new to PICs - I bought the chip just really to test the programmer I got - a clone PicKit2 (from Piccircuit - PIC Circuit Design Expert - Complete PIC Solution) works okay.

The led on the programmer flashes as if it's communicating with the chip properly, but throws an error 'programming failed at program memory address 0x000000'. I think this because the HEX file I've given it is garbage (due to not really know what I'm doing!), but I want to make sure it's not due to faulty components, etc.

If someone can just point me to a dead simple ASM that will say toggle some ports - something I can test with a meter, then that'd be cool!

I'd rather program the device in C as I know it already, but the MPLab IDE suplied by microchip doesn't claim to support this PIC and so I've been compiling/making in MPlab and using 'piccircuit's HEX flasher to upload. Which is obviously a faff & gives no debugging potential, etc.

Anyway, in anticipation - Thanks!

**broken link removed**

Support Devices:
18 Pin: PIC16F54, PIC16F84A, ....

So at least the clone of the PicKit2 claims to work with it, and it comes up in the list of Baseline PICs in PICkit2 v2.61 (HEX loader only IDE).


What version of MPLAB IDE are you currently running? Update it regularly. Unfortunately, you are correct the MPLAB does not support programming the PIC16F57, the PICkit 2 Programmer utility or similar program must be used.

The PIC 16F54 has no built-in debugging capabilities, therefore neither the PICkit 2, PICkit 3, ICD2 nor ICD3 supports debugging the 16F54

The PICkit 2 does support the 16F54 for programming only using the PICkit 2 Programmer utility, if ever in doubt check:

**broken link removed**

This does not guarantee your clone supports the 16F84, check its supported device list.

Download and install the latest Hi-Tech C Compiler for 16F series:

**broken link removed**

Without a license it will run in "Lite Mode," which is more than sufficient for now.

I'll introduce you to some of the best PIC Tutorials I have found on the NET to date:

**broken link removed**

They cover both baseline and midrange PICs in both Assembly and C using the Hi-Tech C compiler.

I would suggest a good PIC to learn a wide range of capabilities would be 16F87XA series, either a 16F876A or 16F877A, which both the PICkit 2 and MPLAB offer debugging support.

Let me know if you need any additional help.
  • Like
Reactions: Err404


    Points: 2
    Helpful Answer Positive Rating
bigdogguru, thanks for your detailed answer. And your offer of ongoing support.

As I have the 16f54 sitting on my desk I would like to put it some use, as I'm pretty sure it can manage the simple projects I'll be starting out with. And until I get round to ordering something more user friendly it might teach me a thing or two.

I found this example of something to build with it:
**broken link removed**

It looks like it's an incrementing counter with 4 selectable inputs - importantly the code is supplied and when I set the programmer option in MPlab to none, it will assemble the ASM file. The odd thing (as a newbie) is it won't Build - so I can get an obj file but no HEX.

This is why I was keen to find THE most basic piece of code to load onto it. One that can give testable conditions without building a cct. From there I can learn more - and ideally on a better, more mainstream PIC!

I'm off to order one now!

When compiling or assembling code for the 16F54 make sure you have both debugger and programmer selected as NONE. You still however have to define the device you are compiling or assemblying. You can set the device under Configure -> Device. Having the IDE configured for the correct device with ensure proper compilation or assembly of the HEX file.

Also make sure the build configuration is set to "Release" not "Debug."

I can't stress enough the importance of having documentation and datasheets for all software and devices used in your design on hand. Documentation and datasheets have been shown to greatly reduce stress levels and aspirin intake rates during the design process.

PIC16F54 Datasheet

Always checkout the device's product page while grabbing the datasheet, they contain useful appnotes and errata:

PIC16F54 Product Page


MPLAB IDE User's Guide

As the 16F54 is considered a baseline device, I would recommend using the Gooligum PIC tutorials for baseline devices either in assembly or C which ever you feel most comfortable. Each tutorial chapter is in PDF form and includes either source or ASM files. You can modify the example circuit to fit the 16F54 and recompile or reassemble the code after you have set the configure device setting in the MPLAB IDE. The tutorials usually start out with flashing a LED, it doesn't get any simpler than that.

Checkout out the Gooligum basline tutorial, if you have any problems adapting it to the 16F54, please let me know.
Last edited:

Okay - going to attempt to adapt the Flash_LED tutorial as suggested.
Probably tomorrow now as it's evening time here in the UK and other things are vying for my time!

Will get back to you ppl tomorrow, but thanks again for the immediate help!

Actually, let me whip an example together for you. The HEX file will be precompiled for the 16F54, so you can use it to test your PICkit2 interface and programming of the 16F54.
  • Like
Reactions: Err404


    Points: 2
    Helpful Answer Positive Rating
I'm wondering if it's my breadboard wire-up now.
The (stand-alone) programmer registered that the configuration bits where not set - which I duly went back into MPlab and set. After that I thought it might work, but....

Basically the error code is, I think, saying that, on trying to program the PicKit is failing straight away (i.e. on address 0x0000).
THis could be down to the 12v used for programming (as I understand it) not being seen at the chip's Prog-pin. THat is
a) down to me not wiring it up properly (I followed the cct layout shown by piccircuit) but I am confused by reading (somewhere) that the 12v is internally produced for the prog-phase. ???
b) down to either the chip or the PicKit-clone being faulty.

[I'd bank a) !]

Maybe, once I get some more PICs to play with after the weekend I can start to work this one out!

BTW - I wrote a C program in HITech C - that just loops forever & inc's a counter.

Sorry to hear of your PICkit2 Clone problems,

I quit buying clone programmer/debuggers sometime ago, to many headaches. I usually keep my eye on eBay for genuine equipment. I've bought several Microchip ICD3s and ICD2s on eBay at a very reasonable prices.

By the way, there's a Microchip ICD2 on eBay right now:

**broken link removed**

It's in the UK and only up to $1.95 USD with four days left, you maybe able to pick it up for $60 USD or less. You might want to inquire about the shipping charges, it would probably be worth biding on.

If you get a chance post or upload the programming circuit, you're attempting to use. I'll look it over and see if there are any problems.


---------- Post added at 09:36 ---------- Previous post was at 09:31 ----------

down to me not wiring it up properly (I followed the cct layout shown by piccircuit) but I am confused by reading (somewhere) that the 12v is internally produced for the prog-phase. ???

P.S. The programming high voltage is delivered by the programmer, not internal produced by the PIC.

Well, I'm going to take an optimistic view and hope that the problem is with my misunderstanding rather than the equipment - although I would like to be able to confirm whether it does work, as I'm holding of leaving ebay feedback on it.

I had scan-read about the PICs producing their own internal programming voltage (and I guess this might be a legacy measure on the use of 12v for programming).

As I have wired up following the diagram supplied for the device:
!MCLR pin is connected on a pull-up 10k to 5v - with I assume the MCLR line sinking the current whilst programming.
The only other pins are the Data & Clock lines - & since the programmer is able to recognise that a PIC is connected (although the Baseline devices appear to require to be manually selected), I think I can assume that data is passing to-and-from the chip (it can read the memory state, or claims to be able to).

I am going to disconnect the MCLR line now & see if there is any change - re: 'Prog failed to write at address 0x00...', ie. can it even get that far?

Not open for further replies.

Part and Inventory Search

Welcome to