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.

mikroc/proteus problem

Status
Not open for further replies.

masab_ahmad

Member level 1
Joined
Jul 20, 2010
Messages
32
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
Pakistan
Activity points
1,564
Hi all,

I made a few codes on MikroC and used proteus to see the simulation. I am using a pic16f877a microcontroller. I firstly made this simple code, which didnt work in proteus:

void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
PWM1_Init(40000);
PWM1_Start();
while(1)
{


PWM1_Set_Duty(200);
}
}

Then I made this one, which gave me some strange waveforms( unwanted), at the CCP1 pin:

void main()
{
TRISC = 0 ; // PORTC as outputs
PORTC = 0 ;
while(1)
{
PWM1_Init(40000);
PWM1_Start();
PWM1_Set_Duty(200);
}
}


I don't understand what went wrong, the first code should have worked! I think proteus is the problem here, plz help....
 

Zip and upload your Proteus and MikroC files, so that one of us can examine it.

BigDog
 

ANSEL = 0; // Configure AN pins as digital
ANSELH = 0;
C1ON_bit = 0; // Disable comparators
C2ON_bit = 0;
ANSEL AGAIN!!!
 

files attached, i also simulated the attached stuff on another simulator, The RealPic Simulator, and it all works perfectly on it....
 

Attachments

  • pic16pwm.rar
    10.6 KB · Views: 51

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top