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.

this programme working in proteous simulator, but not in pic

Status
Not open for further replies.

thivanka321

Newbie level 5
Joined
Mar 10, 2010
Messages
8
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Sri Lanka
Activity points
1,338
i wrote a ccs c code to switch on some led's. that programme work with proteous simulator. but when i put this programme in to pic 18f452, it is not working.
i'm sure that it's not a problem with pic control board, because, other programmes written in mikroc software, is working.
but only the programmes written in ccs c , are not working.

tell me the reason why this is happening.any problem with ccs c ,hex files. or what?
Code:
#include "G:\ccsfiles\ledblinking.h"


#int_RB
RB_isr() 
{

//printf("hello ");
}






#int_TIMER0
TIMER0_isr() 
{

}

#int_EXT
EXT_isr() 
{

}

#int_AD
AD_isr() 
{

}

#int_RDA
RDA_isr() 
{

}



void main()
{

   setup_adc_ports(AN0_AN1_AN3);
   setup_adc(ADC_CLOCK_DIV_4);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   enable_interrupts(INT_TIMER0);
   enable_interrupts(INT_EXT);
   enable_interrupts(INT_AD);
   enable_interrupts(INT_RDA);
   enable_interrupts(GLOBAL);
   setup_oscillator(False);
    enable_interrupts(INT_RB);
   enable_interrupts(GLOBAL);

//SET_TRIS_B(0xFF );  // TODO: USER CODE!!
//Output_B(0X00);
SET_TRIS_D(0);
output_D(0);
   while(1)
{

output_D(255);
//printf("hello");
Delay_ms(500);
output_D(0);
Delay_ms(500);

}
}


please ,reply me soon enogh.
 

Re: this programme working in proteous simulator, but not in

hello,

I have almost the same problem with one of my circuit...


the simulation works well, the hardware is known to be good, but the program in the real hardware does not work.
something get stucks in the interrupt mecanism and I can't explain why...

I know my hardware is good because I have done the program without interrupts and it works well but for me it cannot go fast enough

so I rewrote it with interrupts, the simulation is full ok, but nothing happens in the real hardware...

your problem seems the same as mine. I am almost sure the solution is somewhere in the interrupt system, but I havent found where (for now ..)

regards,
 

Re: this programme working in proteous simulator, but not in

thank a lot .

what you say is right. i checked that programme without interrupt and it worked well.

:D
 

ok so we are counting points ...
you have the same problem as mine, and it comes from the interrupts
simulated under proteus it works completely fine
and not on a known good hardware.

I really wonder what is not correctly simulated under proteus...
if anybody knows ...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top