dsPIC33EP256MC506 reset after power on

Thread Starter

Krzysztof Bieda

Joined Jan 5, 2016
46
Hello Everyone,
I have difficulty with power-on on my dsPIC.

The problem is that after power-on dsPIC do not reset.
reset.PNG
MCLR is connected to dsPIC pin. Reset is connected to programmer pin.
I see that when the programmer is connected there it is more often that dsPIC do not start after
power-on.

Before that I had difficulty with PLL, but I have solved it replacing 8MHz crystal to 5MHz one.

Any suggestions?

Best regards,
Chris
 

OBW0549

Joined Mar 2, 2015
3,566
I suspect your problem may be that R93 is much too large, and therefore not able to pull MCLR up reliably. The datasheet recommends 10kΩ. Also, C72 might cause problems with programming; the datasheet shows this capacitor connected to MCLR through a jumper that can be removed for programming, as some programmers (e.g., a PICKIT3) cannot maintain short rise times on Vpp with a capacitor on MCLR.
 

jpanhalt

Joined Jan 18, 2008
11,087
Here's an alternative that has been discussed in depth on the Microchip forums:

upload_2016-6-20_6-37-20.png

The 47 Ω resistor is to protect the switch contacts. The two 10K resistors provide reliable pull-up, while the lower one isolates VPP from the capacitor. The upper 10K resistor slows the rise to an acceptable level. Values are not critical, but the values shown are common.

BTW, quite awhile back I tested programming with the capacitor directly connected to MCLR using an ICD3. I usually got reliable programming until the capacitor was 1 uF or greater. However, I do not know whether different devices might give different results. Adding the lower 10K resistor gives peace of mind, so to speak.

John
 

NorthGuy

Joined Jun 28, 2014
611
1. Disconnect the dsPIC MCLR pin from the place marked "MCLR" and connect it to the place marked "Reset".

2. Make R93 10K.

3. Make R108 470 Ohm. You may need to go even bigger depending on your programmer and your chip.
 

Thread Starter

Krzysztof Bieda

Joined Jan 5, 2016
46
SOLVED.

Problem was not with resistors, but in code.
I use CCS compiler and as I have spoken with their support it seems
that there is fault in PLL configuration.
I have reprogrammed clock switching and now it works without any problem.

Best regards,
Chris
 

jpanhalt

Joined Jan 18, 2008
11,087
This is the MC-recommended connection:
upload_2016-6-21_6-9-51.png

It suggests that one might need better isolation of the capacitor for ICSP, but that may not be a requirement based on you programmer. It is also not much different from what I showed. What you showed was only missing R1 and had way too high a pull-up resistor value.

Have you tried the version I posted? Or, the MC version?
John

Edit: I was typing while you posted.
 

dannyf

Joined Sep 13, 2015
2,197
I found that only because the guy in support told me that it is their fault
You would have found it on your own.

The reset question is easy to figure out, by measuring the voltage on the reset pin.

You would then shrink the code to a bare minimum and it would still not work.

At that point, you will start to question the initialization routines or compiler. You would then run the chip on the internal RC oscillator or external clock. And it would become obvious at that point.

Forr situations like this, being about to output the master clock would be very helpful.
 

OBW0549

Joined Mar 2, 2015
3,566
Forr situations like this, being about to output the master clock would be very helpful.
The dsPIC33EP256MC506 has this capability; there is a Reference Oscillator Output that can be assigned to a pin and will output the system clock divided by 1, 2, 4, 8, ... 16384, or 32768. Very handy.
 

NorthGuy

Joined Jun 28, 2014
611
You usually start from something really simple, such as blinking LED with internal oscillator, then you add on this in very little increments, as little increments as possible. Such way, you spot a problem right away and know where to look for a bug.

If you pile up ten little things together then you have to guess where the problem is, which may take hours, if not days.
 
Top