CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

Problem interfacing 74LS48 with PIC16F877A [Solved]
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
temtronic



Joined: 01 Jul 2010
Posts: 8518
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 07, 2022 10:12 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 6:29 pm     Reply with quote

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: 316
Location: Montenegro

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:00 pm     Reply with quote

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: 316
Location: Montenegro

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:06 pm     Reply with quote

When referring to MPLAB, I mean the very last useful version, 8.92.
PCM programmer



Joined: 06 Sep 2003
Posts: 21647

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:16 pm     Reply with quote

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: 316
Location: Montenegro

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:19 pm     Reply with quote

For 5.95 EUR it's a steal.
PrinceNai



Joined: 31 Oct 2016
Posts: 316
Location: Montenegro

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:26 pm     Reply with quote

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: 21647

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 8:40 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Apr 08, 2022 10:36 pm     Reply with quote

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: 21647

View user's profile Send private message

PostPosted: Sun Apr 10, 2022 4:24 pm     Reply with quote

If you want to convert your 3M breadboard test setup into a safer
ICSP setup (no more inserting PICs off by 1 pin), you can use this cable:
https://www.ebay.com/itm/262869474752

Another way to get ICSP onto your 3M breadboard is shown on
this website. Plug the Pickit3 cable into your breadboard and use
jumper wires from there to your PIC:
https://www.lloydm.net/Demos/pickit3.html
You probably already have the cable to do that one.

Similar idea:
https://blog.waynejohnson.net/doku.php/pic32mx270f256b
temtronic



Joined: 01 Jul 2010
Posts: 8518
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Apr 10, 2022 4:39 pm     Reply with quote

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: 21647

View user's profile Send private message

PostPosted: Sun Apr 10, 2022 7:07 pm     Reply with quote

It is available in a USB version. It has a virtual COM port on it.
https://www.olimex.com/Products/PIC/Proto/PIC-P40-USB/
Ttelmah



Joined: 11 Mar 2010
Posts: 17988

View user's profile Send private message

PostPosted: Mon Apr 11, 2022 1:28 am     Reply with quote

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: 316
Location: Montenegro

View user's profile Send private message

PostPosted: Mon Apr 11, 2022 5:23 am     Reply with quote

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: 8518
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 11, 2022 5:38 am     Reply with quote

funny ... 'old enough'.... Very Happy
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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group