dsPIC33EP256MC506 reset after power on

Discussion in 'Embedded Systems and Microcontrollers' started by Krzysztof Bieda, Jun 20, 2016.

  1. Krzysztof Bieda

    Thread Starter Member

    Jan 5, 2016
    32
    0
    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
     
  2. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    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.
     
  3. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,145
    203
  4. dannyf

    Well-Known Member

    Sep 13, 2015
    1,806
    361
    In those case, what's the voltage on the reset pin?

    And the pull up is way too big - check the datasheet.
     
  5. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,692
    901
    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
     
  6. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    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.
     
  7. Krzysztof Bieda

    Thread Starter Member

    Jan 5, 2016
    32
    0
    I have made like NorthGuy said and it has not solved the problem.

    I do not know what it is.

    Best,
    Chris
     
  8. Krzysztof Bieda

    Thread Starter Member

    Jan 5, 2016
    32
    0
    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
     
  9. jpanhalt

    AAC Fanatic!

    Jan 18, 2008
    5,692
    901
    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.
     
  10. dannyf

    Well-Known Member

    Sep 13, 2015
    1,806
    361
    Bugs are rarely where you think they are.
     
  11. Krzysztof Bieda

    Thread Starter Member

    Jan 5, 2016
    32
    0
    True;d

    I found that only because the guy in support told me that it is their fault and
    bug is in libraries.
     
  12. dannyf

    Well-Known Member

    Sep 13, 2015
    1,806
    361
    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.
     
  13. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,308
    884
    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.
     
  14. NorthGuy

    Active Member

    Jun 28, 2014
    604
    121
    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.
     
Loading...