View previous topic :: View next topic |
Author |
Message |
temtronic
Joined: 01 Jul 2010 Posts: 9283 Location: Greensville,Ontario
|
|
Posted: Thu Apr 07, 2022 10:12 am |
|
|
I agree with the Prince, USE ICSP !! Dedicate those 2 pins and 99% of programming 'problem' will disappear.
I've used MPLAB 8v92, PICKit3 for years. They're a safe, stable way to get code into PICs ! |
|
|
manusoftar
Joined: 19 Mar 2022 Posts: 46
|
|
Posted: Fri Apr 08, 2022 6:29 pm |
|
|
Thank you all for your feedback, I'm sorry I couldn't interact with you earlier.
Today I got three fresh new PIC16F877A and 10 fresh new 4Mhz crystals (It was a pack, I wish I could have found a smaller pack though)
I programmed one of those new PIC's, wired it up and it still won't work, this is really puzzling me, I tried changing the 22pF caps, changing the actual breadboard, changing the crystal... there is just no other hardware to change, I mean, the only other hardware involved in this simple led blinker is an led and two resistors which I tested with my multimeter and they are working and have the appropriate resistance, and the led I just plugged it with the 330 resistor to the 5v that I get from the usb port and GND and it lighted up so it is indeed working...
I even placed a 10uF electrolytic cap between VDD and GND to work as a decoupling cap (if I'm not wrong).
Honestly, at this point I'm just not sure what else to do, and I have done several circuits before with my PIC's... for example, I did a circuit with an LCD and a flat keypad with 12 keys to simulate a password electronic lock (oh, and some leds to represent the state of the lock) which is way more complex than this blinker... |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 482 Location: Montenegro
|
|
Posted: Fri Apr 08, 2022 8:00 pm |
|
|
Unless you are the unluckiest guy in the world (In which case I'd advise you to stay away from casinos), there is mathematically no way all of your PIC's and crystals are faulty. Is it possible you have some wrong setting in CCS IDE that creates HEX that doesn't work? I have it set to 8 bit hex object file, if that makes any difference at all. Do take two minutes and hook up those 5 wires to do the programming via ICSP. In MPLAB just import hex and shoot it to the PIC. If you take another ten minutes, create a dummy project in MPLAB and set language tool to CCS. That will enable you to import COFF and to use debugger mode. If I'm not mistaken, you can also remove the MCLR resistor, because PICKIT will hold it high for you. Lose the caps on the crystal, it should work without them. Try another programmer. |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 482 Location: Montenegro
|
|
Posted: Fri Apr 08, 2022 8:06 pm |
|
|
When referring to MPLAB, I mean the very last useful version, 8.92. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 08, 2022 8:16 pm |
|
|
You could buy the Olimex PIC-P40 development board.
https://www.olimex.com/Products/PIC/Proto/PIC-P40-20MHz/
It costs only 5.95 Euro ($6.47 USD). That's cheap.
It comes with a 20 MHz crystal (+ capacitors) built-in.
The caps are surface mount and are on the back side.
It does require a 9 to 12v (dc or ac) wall-transformer to run it.
It has an LED on Pin A0 that you can program to blink.
If your PICs don't run on that, they are dead PICs.
Or maybe your compiler doesn't work correctly.
If they do run, then something in your 3M breadboard
test setup is wrong. |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 482 Location: Montenegro
|
|
Posted: Fri Apr 08, 2022 8:19 pm |
|
|
For 5.95 EUR it's a steal. |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 482 Location: Montenegro
|
|
Posted: Fri Apr 08, 2022 8:26 pm |
|
|
I know you checked it a million times. Is the MCLR resistor going to 5V? I have made a mistake on a breadboard and plugged it to the GND. Is the PIC seated correctly with the wires? That's also one of the things ICSP does for you. Once set up, it works, no way to seat the chip a column up or down on the breadboard. No way to put it in the wrong way around. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 08, 2022 8:40 pm |
|
|
The Olimex PIC-P40 board has an ICSP connector with the standard
pinout that works with Pickit 3. The Pickit 3 clones sold on EBay come
with a 6-pin multi-colored wire cable that will plug into that connector.
The connector has a little bump in it, so it takes a little force to press it
on, but it does work. |
|
|
manusoftar
Joined: 19 Mar 2022 Posts: 46
|
|
Posted: Fri Apr 08, 2022 10:36 pm |
|
|
Guys, it works now, it's official, the other PIC's are dead. I finally was able to make the blinker work and now I got back to the original thing with the 74LS48 and it's working, thanks for all your help.
By the way, finally I used one of the new 4Mhz crystals and replaced the fuse HS for XT... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9283 Location: Greensville,Ontario
|
|
Posted: Sun Apr 10, 2022 4:39 pm |
|
|
I've done #2 of PCM P's post for decades and while everyone says those boards are bad, never had an issue. Heck if it works on 3M, it'll work on a real PCB !!
I found a spool of 10 conductor, 22 or 24 ga solid wire years ago...make GREAT jumpers..now though you can buy them in bundles....all 10 colours, makes life easier.
It'd be nice if that Olimex p40 board was updated a bit..really 'RS-232' ??
Sure can't be the price though !!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19605
|
|
Posted: Mon Apr 11, 2022 1:28 am |
|
|
It's quite funny.
I suspect Jay and PCM, are both 'old enough' to remember when chips
didn't offer ICSP. You had to take the chip out and use an external
programmer. When ICSP first appeared, programming like this was still
the 'standard way' to work. Then they each probably tried ICSP, and
found first, how convenient it was, and second the extra convenience
of ICD. After a very few projects using this, the 'norm' became to add
an ICSP connector, and avoid using the pins for anything else. Quite
quickly this way of working became the 'standard'.
I must admt I went thorough exctly these stages. Now, for anything more
complex than a very basic unit, I'll always fit an ICSP connector. The
only problem comes when you are working on multiple boards at once,
when the operation becomes rather complex!. A simple SIL connector
is one of the easiest, and can even be done on breadboard projects. |
|
|
PrinceNai
Joined: 31 Oct 2016 Posts: 482 Location: Montenegro
|
|
Posted: Mon Apr 11, 2022 5:23 am |
|
|
I have all of it mounted and glued on a piece of wooden plank. ICD SIL connector is glued on a breadboard, too. It adds some weight, prevents the cables to dance around and I can move the whole thing out of the way in one piece without worrying that I'll pull something out in a process. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9283 Location: Greensville,Ontario
|
|
Posted: Mon Apr 11, 2022 5:38 am |
|
|
funny ... 'old enough'....
I also remember having lots of coffee breaks while the 'pretty purple light in a box' erased the PICs.
One 'trick' I PICked up is to use a short(3"+-) extension cable to connect PICkit3 to ICSP pins. It keeps the PK3 connection from getting loose. I use ,shh, Ardunio '6 pin header' sockets. |
|
|
|