1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Stack allocation and size

Discussion in 'Microcontrollers' started by elecLear78, Aug 10, 2017.

  1. elecLear78

    elecLear78 Member

    Joined:
    Jul 16, 2013
    Messages:
    227
    Likes:
    1
    Location:
    india
    I am trying to build a project using mplabx for micro chip ddpic33ev family. But i am not sure of where to give stack size and starting location. There is a coloumn for minimum stack size. Should i give there? I am finding an softrap reset that is 0x40 in rcon register. I am really trying to figure out how to resolve, but not able to solve it. After flashing it works for 6 seconds and resets. Any call trace feature available in mplabx? Please advice.
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,302
    Likes:
    914
    Location:
    Rochdale UK
    Why do you assume its a stack issue... The stack will be large enough for any program you send it..

    It seems to me to be a watchdog problem The watchdog is denoted by 0x04 of the Rcon... 0x40 isn't a valid error..
     
  3. elecLear78

    elecLear78 Member

    Joined:
    Jul 16, 2013
    Messages:
    227
    Likes:
    1
    Location:
    india
    upload_2017-8-10_23-38-9.png

    The Bit 14 was set 0x4000. Do not know what to do? Can you suggest some methods to solve. The micro chip family is dspic33ev256gm106.
     

    Attached Files:

  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,302
    Likes:
    914
    Location:
    Rochdale UK

    If you are using C, then these issues should not be a problem.... Uninitialized W reg flag or an unrecognised instruction will not ever be a problem in C unless you are selecting the wrong device.... If you compile for a slightly different chip than the one you are simulating, then this will happen..

    It would take some rubbish programming to use up the entire stack... I have also noticed that some of the new micro learners cannot distinguish between a hardware stack and a software stack!!! You need to read up!!
     
  6. elecLear78

    elecLear78 Member

    Joined:
    Jul 16, 2013
    Messages:
    227
    Likes:
    1
    Location:
    india
    No it may not be because of stack i thought about it once. Could you please tell me how to find out the actual reason. I want to see the call trace but mplabx does not seem to support. What are the methods i can use? Please help. If it is different chip how to find out?
     
  7. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,302
    Likes:
    914
    Location:
    Rochdale UK
    I need your MPLABX project.
     
  8. elecLear78

    elecLear78 Member

    Joined:
    Jul 16, 2013
    Messages:
    227
    Likes:
    1
    Location:
    india
    I found that Dead Man Timer to be disabled. When i did it is not resetting. What exactly is this? I never heard about it.
     
  9. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,302
    Likes:
    914
    Location:
    Rochdale UK
    Its just another name for Watchdog timer.... The watchdog timer is smaller, the deadman can be programmed to larger delays!!
     
    • Like Like x 1
  10. elecLear78

    elecLear78 Member

    Joined:
    Jul 16, 2013
    Messages:
    227
    Likes:
    1
    Location:
    india
    One of the really sad thing is that none of the register told me it is Dead Time reset. I have spent huge effort resolving it and that too purely out of luck.
     

Share This Page