Question about daPIC30f4013 - Page 1
Forum section: electronics / projects

author: smithe42
author_rank: Contributor
timestamp: January 16, 2015, 09:04:54 pm
content: I recently got a dsPIC30f4013 and hooked it up to my PICKIT 3. I got all the right pins hooked up, but I always get a wrong ID error. I don't know why this is happening. Please help.

author: Kalvin
author_rank: Super Contributor
timestamp: January 16, 2015, 09:10:29 pm
content: Check you compiler settings that the target CPU is correct. If the compiler's target CPU is different from the processor you try to download the binary, you will see this error.

author: smithe42
author_rank: Contributor
timestamp: January 16, 2015, 09:21:54 pm
content: I do have the target CPU correct, and I am using the correct 16 bit compiler.

author: dannyf
author_rank: Super Contributor
timestamp: January 16, 2015, 09:31:19 pm
content: QuoteA picture is worth a 1000 words,

author: Lunasix
author_rank: Regular Contributor
timestamp: January 16, 2015, 10:07:11 pm
content: Verify pin AVdd is powererd, even if analog section is not used. If this pin is not powered, result is as described.

author: Howardlong
author_rank: Super Contributor
timestamp: January 16, 2015, 10:08:00 pm
content: Quote from: dannyf on January 16, 2015, 09:31:19 pmAgreed, screen print please!

author: smithe42
author_rank: Contributor
timestamp: January 16, 2015, 11:06:47 pm
content: Here are a couple pics tyres of my setup

author: amyk
author_rank: Super Contributor
timestamp: January 16, 2015, 11:33:02 pm
content: A clear, direct, overhead view would be far better to discern how you're connecting things...

author: dannyf
author_rank: Super Contributor
timestamp: January 16, 2015, 11:37:21 pm
content: QuoteGive you a hint: assume that you have no prior knowledge of your projects. Someone asked you the same questions you asked here. What would you say to him in order to help him?

author: Kalvin
author_rank: Super Contributor
timestamp: January 16, 2015, 11:54:54 pm
content: Can you get a screenshot / printscreen of the error message dialog box?

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 17, 2015, 03:22:19 am
content: Try adding bypass caps.

author: 22swg
author_rank: Frequent Contributor
timestamp: January 17, 2015, 12:39:53 pm
content: There is usually a diagram in the PIC data sheet for all the Voltage etc etc requirements don't leave anything out. ( ED not that good but page 135 )

author: BlueBill
author_rank: Regular Contributor
timestamp: January 17, 2015, 07:42:07 pm
content: 10K pullup on MCLR, 0.1µF caps across power pins.Plus breadboards can be iffy, check your connections with a multimeter.Don't have a multimeter? Buy a multimeter.

author: Howardlong
author_rank: Super Contributor
timestamp: January 17, 2015, 08:12:32 pm
content: PGC/PGD do not look right on the 6 pin ICSP connector, they look like they're on the middle pins 3 & 4 in the photo.Should be:1 MCLR2 VDD3 VSS (ground)4 PGD5 PGC6 No connectionIf I had a penny for every time I've messed up that darned ICSP connector...Agreed also regarding decoupling caps and 10k MCLR to VDD.

author: Howardlong
author_rank: Super Contributor
timestamp: January 17, 2015, 08:53:53 pm
content: In fact, on closer inspection it looks like that 6 pin header is one out on all pins.I don't have a dsPIC30F4013 in stock, but I do have a dsPIC30F2012. I just breadboarded one up, here it is and a screen shot of MPLAB X (I'm assuming you're using MPLAB X, if not, I'll do you a screen shot of MPLAB 8.92, it works there too).Note the decoupling caps close to all of the device's pins, and on the supply rails. There's also a small bulk 10uF on the supply rail. Possibly overkill, but it's difficult to be accused of using too much decoupling. Usually when breadboarding, I'd also have an on board regulator, but I didn't want to complicate things. I assume that your PSU is nice and stable by the way.The small demo program in the second pic is about the minimum you can get away with that actually does something, i.e. it toggles a pin (RD9). It does not set up anything specific in the oscillator block so it will be running quite slowly. I also specifically chose the RD9 pin because it has no associated analogue function on that pin on your chip, again I didn't want to complicate matters.

author: hugo
author_rank: Regular Contributor
timestamp: January 17, 2015, 09:15:21 pm
content: Quote from: smithe42 on January 16, 2015, 09:04:54 pmMove the 6 pin header one position to the right and try again ...

author: smithe42
author_rank: Contributor
timestamp: January 20, 2015, 08:57:32 pm
content: Thanks HowardLong and hugo. I didn't realize that, I guess i was really confused and I thought it was a messed up connection to the chip. I didn't think that I was my header was just in the wrong spot.

author: smithe42
author_rank: Contributor
timestamp: January 20, 2015, 11:43:22 pm
content: I added the 10k resistor and the decoupling caps, but it is still not working. I am powering it with the pick it, so the voltage should be stable. I can't tell what is wrong, I got a top picture of it now too.

author: vaualbus
author_rank: Frequent Contributor
timestamp: January 21, 2015, 12:14:25 am
content: If I see right you have not vonnect the pickit power pin to the board.

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 02:03:23 am
content: I did connect power to the board.

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 02:58:50 pm
content: When I try to program it, I get about a 5 second delay before I get the wrong Id error. It was coming immediately before I added the decoupling caps and the resistor on the MCLR pin. Is this progress?

author: bktemp
author_rank: Super Contributor
timestamp: January 21, 2015, 03:00:49 pm
content: MCLR needs a pullup, not a pulldown.

author: dannyf
author_rank: Super Contributor
timestamp: January 21, 2015, 03:47:43 pm
content: "MCLR needs a pullup, not a pulldown."Perils of not reading the datasheet.

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 05:46:10 pm
content: Do I connect the resistor to the ground for a pull up? Or do I connect it to power?

author: Howardlong
author_rank: Super Contributor
timestamp: January 21, 2015, 05:47:56 pm
content: 10k from MCLR to VDD.

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 05:53:06 pm
content: Oh, I hooked that up wrong...

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 08:08:04 pm
content: I tried that and it still doesn't work. I am going to just try rebuilding it. If you know another reason why it might not be working. ANy suggestions would be appreciated.

author: smithe42
author_rank: Contributor
timestamp: January 21, 2015, 08:54:34 pm
content: If someone could provide a schematic on a proven way on how to connect it that would be great. I have tried looking but cannot find one.

author: voja
author_rank: Contributor
timestamp: January 21, 2015, 11:48:00 pm
content: PGC/PGD pins are 8 and 9, not 9 and 10

author: smithe42
author_rank: Contributor
timestamp: January 22, 2015, 02:39:00 am
content: Thank you voja. I do not know why I could not figure that out. It works now.

author: BlueBill
author_rank: Regular Contributor
timestamp: January 22, 2015, 03:34:56 am
content: 33pF is too small for decoupling caps. Try 0.01µF or 0.1µF

author: 22swg
author_rank: Frequent Contributor
timestamp: January 22, 2015, 09:50:59 am
content: These wrong pin connection may have had an impact on the 'health' of your PIC , good idea to double check before applying power.as my previous post check data sheet page 135 ...