Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

microcontroller programming ?

Status
Not open for further replies.

hansika

Member level 2
Joined
Apr 13, 2010
Messages
53
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
hyderabad
Activity points
1,717
hi every one,
i am writing a led blink program in mikroC dspic compiler as shown below and i am dumping the program into the micro controller dspic30f6014A using winpic 800 software , i am able to dump the program into the controller the soft ware giving dumping is successful but the code is not executed correctly means led is not blinking can any one please tell me where i am doing wrong

void main()
{
TRISG=0;//setting port G as output port for switches
TRISB=1;
LATGBITS.LATG15=1;

while(1)
{
LATGBITS.LATG15=~LATGBITS.LATG15;
delay_ms(10);
}
}
 

Hi,
The problem is
Code:
delay_ms(10);
With a 10ms delay, the LED is blinking, but it's too fast for your eye to capture. Use
Code:
delay_ms(200);
and test, and I'm sure it will work.

Hope this helps.
Tahmid.
 

thanks for the reply but it is not working for that delay also. can you please tell me what are the crystal frequency values for the oscillator(i am using 20MHZ crystal osc) and reset circuit values. thanks in advance

Added after 3 hours 13 minutes:

hi ,
when i dump my code into the controller it exactly executing the code 5 times and after that ir restarting the execution . i have changed my my code is as shown below
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)
{
LATBBITS.LATB1=0;
delay_ms(1000);
LATBBITS.LATB0=0;
LATBBITS.LATB1=1;
delay_ms(1000);
LATBBITS.LATB0=1;
delay_ms(1000);

}
}
and i have set the project configuration as default settings in mikroC dspic IDE.i have used the winpic800 as my dumping software
 

it is not working for that delay also.

sentences of that kind convey zero information to any one other than yourself.

and i have set the project configuration as default settings in mikroC dspic IDE.

unless someone has a copy of microC dspic IDE, they have no clue what the "default settings" are.

You are the one looking for help so it is in YOUR interest to make it as easy as possible for OTHERS to help you.

That means providing as much relevant information as possible, and describing it as concisely as possible.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top