How to determine the restart cause of dsPIC30F micro?

Find out how to setup your programmer's software and how to solve many common problems.

Moderator: phalanx

Post Reply
Amyniuo
Posts: 1
Joined: Thu Sep 29, 2016 11:07 pm

How to determine the restart cause of dsPIC30F micro?

Post by Amyniuo » Thu Sep 29, 2016 11:33 pm

Hello, I would like to ask how to determine the restart cause of dsPIC30F microcontroller.
Greatings! I have a problem. I`m using dsPIC30F5015 and I have random CPU restarts. How can I determine the restart cause?
Thanks!

User avatar
phalanx
Non-SFE Guru
Posts: 1980
Joined: Sun Nov 30, 2003 8:57 am
Location: Candia, NH

Re: How to determine the restart cause of dsPIC30F micro?

Post by phalanx » Fri Sep 30, 2016 6:17 pm

There are many ways to get a dsPIC to reset and there are ways to get the dsPIC to start executing from instruction 0x000000h without actually resetting. You need to provide a lot more information about your setup, code, and development tools before we can start narrowing down where your problem may be.

-Bill

nbhhjj
Posts: 1
Joined: Thu Sep 29, 2016 2:56 am

Re: How to determine the restart cause of dsPIC30F micro?

Post by nbhhjj » Tue Oct 04, 2016 11:22 pm

Hi,

are you programming in C or in assembly language?
It might be that the code is trying a word access to a memory location with an odd address.
A stack overflow is also possible or a division by zero?
There are interrupts and traps - the latter are similar to exceptions, I guess. You could turn off/on an LED from a trap handler to see whether a trap occurs.
It could also be an electrical problem such as too low/fluctuating supply voltage.
If it's a software-related problem, in-circuit debugging (e.g. using PICkit3) might help.
A tedious way to tackle the problem (assuming it's software-related) is to comment out portions of the code, compile upload and check whether it's running.
If so, uncomment a bit, check again - repeat until the reset occur again.

Cheers,
nbhhjj.

User avatar
phalanx
Non-SFE Guru
Posts: 1980
Joined: Sun Nov 30, 2003 8:57 am
Location: Candia, NH

Re: How to determine the restart cause of dsPIC30F micro?

Post by phalanx » Mon Oct 10, 2016 8:56 am

I suspect this may be a one-and-done thread.

-Bill

Post Reply