I am running a dsPIC33FJ32MC304 at 79-80MHz using the internal oscillator with PLL.
The controller is driving a pair of brushed DC motors under PID control through some motor-driving circuitry. Occasionally, after the motors have reached their setpoint, the systems resets. I used the following code to turn on LEDs depending on the particular reset.
Code:
if(RCONbits.POR == 1)
{
_LATB4 = 0; //LED 1 cathode to RB4
RCONbits.POR = 0;
}
if(RCONbits.BOR == 1)
{
_LATB9 = 0; //LED 2 cathode to RB9
RCONbits.BOR = 0;
}
DELAY_MS(2000); //Delay for 2 seconds
LATB = 0xFFFF; //Turn off all LEDs
When I switch the system on for the first time, both LEDs glow, in accordance with the datasheet. However, whenever the system resets automatically, LED 2 glows which indicates a brown out reset.
I think the resaon for the reset is that the VDDCORE capacitor has a value of 1uF which is the minimum specified in the datasheet. Also, it is located around 2 cm away from the pins of the controller.
I am considering replacing the 1uF capacitor with a 10uF one, which I hope will give me more reliable performance. Is there anything else that I should really really look out for?[/code]