Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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,933
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 : )
 

VSMVDD

Banned
Joined
Jun 12, 2005
Messages
646
Helped
92
Reputation
184
Reaction score
34
Trophy points
1,308
Location
scotland uk
Activity points
0
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top