How to simulate PWM code in IDE v5.22 ?

Status
Not open for further replies.

wakaka

Full Member level 4
Joined
Dec 7, 2005
Messages
237
Helped
10
Reputation
20
Reaction score
6
Trophy points
1,298
Activity points
2,931
PIC simulation

I dunno how to simulate my PWM code in Ide simulator v5.22....this is my simple code :

#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=20000000)

void main() {

setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_1, 127, 1);

while(1)
set_pwm1_duty(520);
}

I've set the oscilloscope input to CCP1, but still dun get any output, can anyone of u help? or suggest other simulators.....with user guide : )
 

Re: PIC simulation

#include <16F877a.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay (clock=20000000)


void main()
{
setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_1, 127, 1);
set_pwm1_duty(520);
do{
} while(TRUE);
}

TRY THIS CODE i am surprised the compiler allowed you to compile it

it must have a dumb rules engine if you dont have no do
then you dont get a loop and it will just end and move of from main routine to air...
TRY THIS CODE i am surprised the compiler allowed you to compile it

it must have a dumb rules engine if you dont have no do
then you dont get a loop and it will just end and move of from main routine to air...
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…