dspic not started

Status
Not open for further replies.

hansika

New Member
hi every one,
i am programmed dspic30f6014A using winpic800 the software saying code is dumped succesfully. but when i started the controller my led blinking program is not started below is my code

void main()
{

TRISG=0;//setting port G as output port for switches
TRISB=0;
LATGBITS.LATG15=0;
delay_ms(1000);
LATGBITS.LATG15=1;
delay_ms(1000);
LATGBITS.LATG15=0;
delay_ms(1000);

while(1)
{
//LATGBITS.LATG15=~LATGBITS.LATG15;
//delay_ms(100);
LATBBITS.LATB1=0;
delay_ms(1000);
LATBBITS.LATB0=0;
LATBBITS.LATB1=1;
delay_ms(1000);
LATBBITS.LATB0=1;
delay_ms(1000);
}
}
when i start the dspic the leds are in ON state only please suggest me why this is happening
 
You don't list CONFIG settings or what you have for an xtal.
Also, a pin being configured as Analog- the default- causes problems. There may be TWO ADCs and if either one has the pin as Analog, it's analog. Actually I don't know for sure what you get if it's listed as Analog and an OUTPUT, but there's no reason to engage in that question when you can just config it as digital.

On some PICs there are pins associated with modules which will default to things other than GPIO. Look in the spec at the pin definition and look up the associated hardware module.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…