EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / Well iam using mikroC pro as

Well iam using mikroC pro as

|

Microcontroller › PIC › pwm with pic 16f877a › Well iam using mikroC pro as

May 13, 2012 at 2:32 am #7779
Basit Ali
Participant

Well iam using mikroC pro as my compiler an here are the code.s iam using to set up my frq iam using this

 

PWM1_init();

 

an for changing the duty iam using

 

PWM1_Set_Duty();

 

iam doing the incriment and decrement in the duty properly its working fine 0-255

 

but iam having some problem with the frq varying

 

 

 if(RD1_Bit) {
                           Delay_ms(10);
                           PWM1_init(1000);
                           PWM1_Set_Duty();
                                                                          
                    }

 

atm iam just runing it like this but i want to do proper increment and decrement in the frq like 1khz to 50khz

 

with the help on 2 buttons

RSS Recent Posts

  • Pickit 5 July 16, 2025
  • Pic18f25q10 osccon1 settings swordfish basic July 16, 2025
  • turbo jet fan - feedback appreciated. July 16, 2025
  • More fun with ws2812 this time XC8 and CLC July 16, 2025
  • I Wanna build a robot July 16, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise