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.

[SOLVED] pwm is not working in proteus7.6 simulation

Status
Not open for further replies.

Mithun_K_Das

Advanced Member level 3
Joined
Apr 24, 2010
Messages
899
Helped
24
Reputation
48
Reaction score
26
Trophy points
1,318
Location
Dhaka, Bangladesh, Bangladesh
Activity points
8,254
For few days I've been noticed that, pwm is not working in proteus simulation. I use proteus 7.6 sp0. It was working before. But I don't know what is happening, even when proteus is running, it is taking so much processor speed(>97%) and ram(>82%) where it took processor speed(22~56%) and ram (~38%).

what is the wrong, need help!!!
 

Dear Mithun
Hi
Can you show me the schematic that you are referring to , please ?
Best Wishes
Goldsmith
 

This problem is not for any specific schematic, but for all, any type. Also all the simulation are working so slow.

here is a very simple circuit: asdf.png
and a simple program for pwm, compiler: microCpro for pic V4.6
Code:
void main() 
{
  TRISC = 0x00;
  PORTC = 0x00;

  PWM1_Init(5000);
  PWM1_Start();                // start PWM1

  while (1)
   {                         // endless loop

      PWM1_Set_Duty(200);


  }
}

and here is the project settings

asdf.png
 
Last edited:

also the circuit is working in real, but pwm is not in proteus...!!!
Code:
int duty=10, cnt=0;
void main() 
{
  TRISA = 0xFF; // all input
  ADCON1 = 0xFF; // all digital input;
  TRISC = 0x00;
  PORTC = 0x00;
  TRISB = 0x00; // all out
  PORTB = 0x00; // all zero
  PWM1_Init(5000);
  PWM1_Start();                // start PWM1
  while (1)
   {
     if(RA0_bit == 1) // button 1 is pressed
     {
      if(duty<=254)
      {
      duty++;
      }
      else
      {
       duty = 254;
      }

     }
     if(RA1_bit == 1)
     {
      if(duty>=16)
      {
      duty--;
      }
      else
      {
       duty = 16;
      }
     }
      Delay_ms(20);
     cnt++;
     while(cnt>=20)
     {
      RB0_bit = ~RB0_bit;
      cnt = 0;
      break;
     }
     PWM1_Set_Duty(duty);
  }  // endless loop
}

This program is working in project board well as it should but only pwm is not working in proteus!!!!
 

For few days I've been noticed that, pwm is not working in proteus simulation. I use proteus 7.6 sp0. It was working before. But I don't know what is happening, even when proteus is running, it is taking so much processor speed(>97%) and ram(>82%) where it took processor speed(22~56%) and ram (~38%).

what is the wrong, need help!!!

The PWM on the PIC16F877 works fine for me using Proteus 7.6. If just using logic simulation then the simulation can be done in real time however as soon as you add analogue components (mixed mode) the simulation speed will drop by a factor of a thousand or so. Note the oscilloscope is a analogue component.
 

I understand, but the same circuit was working fine before, but now? only pwm is not working, other functions are working well in simulation.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top