PIC programming

Go To Last Post
35 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I expect I'll be Blynched, but here goes anyway... It's all the same happy bunch of pals company now, right?

An old client of mine has a bunch of PCBs that I designed several hundred years ago(OK, 2004), before I saw the light, and they contain PIC16f84 chips.

 

He is hoping to slightly "repurpose" these. My problem is that I don't seem to have any tools for PIC programming(either "coding" or flashing), and wondered if someone could advise me on a low-budget way to progress.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doesn't this new $15 "Snap" thing from Microchip do "everything"? (and when you finished with it for PICs you could use it for sensible micros!)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

Doesn't this new $15 "Snap" thing from Microchip do "everything"? (and when you finished with it for PICs you could use it for sensible micros!)

Looks to be the very thing! I just need to find something else I need to bump the Farnell order up to free delivery amount!

I guess this would be a good opportunity to download the latest all-in-one PIC and AVR version of MPLAB-X.

 

This could be weird. It seems like a lifetime ago that I wrote this PIC16F84 code in assembler.

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You will need MPLAB X , a C compiler, and a pickit4 or a snap. 

MC is moving to include some AVR's in MPLAB X so may be a good time to get familiar with the IDE anyway. wink

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

You will need MPLAB X , a C compiler, and a pickit4 or a snap. 

MC is moving to include some AVR's in MPLAB X so may be a good time to get familiar with the IDE anyway. wink

 

Jim

 

The code will be short and simple enough that I can do it in assembly, I think. Don't really want to worry about a C compiler for PIC, when I doubt(hope?) I'll never use one again.

 

John

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
simple enough that I can do it in assembly

Isn't C just a macro assembler?  devil

 

Have fun with it!

 

Jim

 

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
You will need MPLAB X , a C compiler, and a pickit4 or a snap.
MPLAB X v5.15 device support

PIC16F84 :

Tested : MPLAB REAL ICE, MPLAB ICD 3, MPLAB PICkit 3, MPLAB X simulator, MPLAB XC8 v1

Beta : none

 

PIC16F84A :

Tested : same

Beta : MPLAB PICkit 4, MPLAB ICD 4

ki0bk wrote:
MC is moving to include some AVR's in MPLAB X so may be a good time to get familiar with the IDE anyway. wink
beta for most AVR, simulator is in state tested for approximately a third of the AVR range

 


MPLAB X IDE | Microchip Technology

Come Join Us (MPLAB Now Supports AVRs) | AVR Freaks

 

edit : PICkit™ 3 In-Circuit Debugger

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Fri. Mar 22, 2019 - 04:07 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:
MPLAB X v5.15 device support PIC16F84 : Tested : MPLAB REAL ICE, MPLAB ICD 3, MPLAB PICkit 3, MPLAB X simulator, MPLAB XC8 v1 Beta : none   PIC16F84A : Tested : same Beta : MPLAB PICkit 4, MPLAB ICD 4
"Snap" is notable for it's absence here??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

Last Edited: Fri. Mar 22, 2019 - 03:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
... a C compiler, ...
MPLAB XC8 v2 brought PIC up to C99 via Clang and added AVR via FSF AVR GCC.

on sale March'19 : MPLAB XC8 Compiler PRO Dongle License

MPLAB- XC Compilers | Microchip Technology

 

edit: What's New in MPLAB® XC8 v2.0 - Developer Help

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Fri. Mar 22, 2019 - 03:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
It's all the same happy bunch of pals company now, right?
Yes and hopefully happy!

Some USB PIC are an I/O improvement over USB megaAVR (no crystal for full-speed USB, auto-baud UART)

An instance :

Pololu USB AVR Programmer v2.1

 


PIC18F25K50 - Microcontrollers and Processors

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you can wait for slow shipping, cheap PICKIT3 clones from China will do the trick, they're about $12 last time I checked.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

(intention : contrast)

PIC-KIT3 Olimex Ltd. | Mouser

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks all.

I think I just threw out my MPLAB ICD 2 a month or so ago. Always the way!

 

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote this PIC16F84 code in assembler.

And do you still have hair?? devil

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is the verb "Blynched" anything to do with a former barmaid in the Rovers Return?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No. Bert Lynch from Z cars.

Actually it is a contraction of "Web lynched" to parallel "Web log" as in Blog. I only invented this word today, so your confusion is understandable.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Was Bert Lynch married to Bet Lynch?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Was Bert Lynch married to Bet Lynch?

Not to my knowledge, but then they're both fictitious, so anything's possible.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's a value if the PICkit 3 clone is of good quality as MPLAB PICkit 3 have significant hardware and software complexity.

MAKING A PICKIT 3 CLONE

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I've lost more hair since I started using C.

Here are my conclusions:

 Assember help hair growth on the scalp.

 C helps hair growth in ears and nostrils.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

gchapman wrote:

That's a value if the PICkit 3 clone is of good quality as MPLAB PICkit 3 have significant hardware and software complexity.

MAKING A PICKIT 3 CLONE

 

Yeah.

I won't be going that route.

Designing and building my own PicKit 3 for the sake of a few dozen old PCBs seems like overkill. And of course there's  no way I'd buy a clone, when the real thing is available for only 5 or 6 times as much...

 

I'm fairly certain we all used to program PIC16F84s with an LPT bit-banging process, back when.

 

Just googled it. I think LPT was the standard method.  Not sure I can be bothered this time around. Even though I do have a proper LPT port on a desktop and a laptop, the last time I tried to bit-bang either, I seem to remember it was not so easy with current Windows.

 

 

Four legs good, two legs bad, three legs stable.

Last Edited: Sun. Mar 24, 2019 - 10:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

 

I've got a couple of genuine PickKit 3s sitting here. You are welcome to borrow one for a couple of weeks if it helps.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:

Just googled it. I think LPT was the standard method.  Not sure I can be bothered this time around. Even though I do have a proper LPT port on a desktop and a laptop, the last time I tried to bit-bang either, I seem to remember it was not so easy with current Windows.

 

More common I think was an RS232 port.  The JDM programmer.  AFAIK it still works fine on Win 7 or 10 if you still have a real RS232 port.  Most motherboards still have them as a header - just not on the back panel.

 

I just recently got a paying gig for updating/fixing a huge ASM program on a PIC.  I had not done any PIC ASM since the early 90s.  It's pretty terrible but I still have most of my hair.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

andrewm1973 wrote:
The JDM programmer.
PIC-PG1 | Olimex

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
hair growth in ears
suddenly a major mystery of my life is revealed!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The first thing to do is ask yourself if these chips are worth it.   They have ONE - ONE - ONE K of flash, along with a whopping 64 bytes of SRAM and EEPROM. 

Unless you have =thousands= of these little bozos hanging around the shop, don't bother using them in any new or update design.  Write them off.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not a new design. It's a new firmware for an existing PCB. I don't know exact quantities, but I'll simply be charging for writing new code.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

andrewm1973 wrote:

John_A_Brown wrote:

Just googled it. I think LPT was the standard method.  Not sure I can be bothered this time around. Even though I do have a proper LPT port on a desktop and a laptop, the last time I tried to bit-bang either, I seem to remember it was not so easy with current Windows.

 

More common I think was an RS232 port.  The JDM programmer.  AFAIK it still works fine on Win 7 or 10 if you still have a real RS232 port.  Most motherboards still have them as a header - just not on the back panel.

 

I just recently got a paying gig for updating/fixing a huge ASM program on a PIC.  I had not done any PIC ASM since the early 90s.  It's pretty terrible but I still have most of my hair.


Yes, but I'm guessing you're 20 years younger than me.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's generous, but I'll probably buy one. I like to have the tools to hand.

John

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are a bunch of newer pics that I think are pin compatible with the 16f84. More memory, fancier peripherals, enhanced architectures, low voltage programming, support in the current programmers, and even cheaper...
PIC16F1826, for example (? I didn’t check very carefully.)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John,

 

Perhaps the SNAP will work well for PICs.

It is a nice little PCB, and is very inexpensive.

 

I think, however, it is still worthless for programming AVR's, in spite of what the MC web site would have one believe.

After using a clever work-around to get the MPLab X to connect to the SNAP, it is worthless for programming a Mega328P or 328PB as it resets the micro's Fuses to use the internal RC clock at 1 MHz.

One of the two, the IPE or the IDE, specifically states it can't program the Fuses, while the other one should be able to, but I can't make it work.

So any board I program, in spite of having the desired external Xtal on the board, and having set the Fuses with an AVR ISP mkII, is trashed back to 1 MHz when programmed with the SNAP, with no way to reset the Fuses correctly, (with the SNAP).

 

Anyway, your current need is to program a PIC.

 

Just be aware that until MC upgrades their MPLab X software it isn't a viable option for programming AVRs.

(Hijacked Rant Thread on this topic: Here.)

 

JC

 

Edit:Typo

Last Edited: Sun. Mar 24, 2019 - 04:08 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@ westfw
I'm sure you're right, but these PCBs have the chips soldered on.

Four legs good, two legs bad, three legs stable.

Last Edited: Sun. Mar 24, 2019 - 06:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

John,

 

Perhaps the SNAP will work well for PICs.

It is a nice little PCB, and is very inexpensive.

 

I think, however, it is still worthless for programming AVR's, in spite of what the MC web site would have one believe.

After using a clever work-around to get the MPLab X to connect to the SNAP, it is worthless for programming a Mega328P or 328PB as it resets the micro's Fuses to use the internal RC clock at 1 MHz.

One of the two, the IPE or the IDE, specifically states it can't program the Fuses, while the other one should be able to, but I can't make it work.

So any board I program, in spite of having the desired external Xtal on the board, and having set the Fuses with an AVR ISP mkII, is trashed back to 1 MHz when programmed with the SNAP, with no way to reset the Fuses correctly, (with the SNAP).

 

Anyway, your current need is to program a PIC.

 

Just be aware that until MC upgrades their MPLab X software it isn't a viable option for programming AVRs.

(Hijacked Rant Thread on this topic: Here.)

 

JC

 

Edit:Typo


I'll probably go the PicKit route. I have tools for AVR already. Not that I've used them much lately, been mostly using Cortex M things lately.

Four legs good, two legs bad, three legs stable.