Тёмный
No video :(

19- Pulse Width Modulation (PWM) | mikroC Pro for PIC Tutorial 

StudentCompanion Electronics
Подписаться 22 тыс.
Просмотров 20 тыс.
50% 1

PWM is a technique of controlling an amount of power delivered to a load by switching ON and OFF a digital signal. Learn to configure PWM, capture and compare using mikroC Pro for PIC PWM library.
For more info and download source code: www.studentcom...
Have questions, need assistance or looking for source code? Engage with us and please do not forget to support us with any donation:
Please Donate: www.paypal.com...
Facebook: / studentcompanion
Twitter: / stcompanion
Google+: plus.google.co...
Patreon: / studentcompanion

Опубликовано:

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 65   
@StudentCompanion
@StudentCompanion 7 лет назад
We appreciate all your feedback guys. Thanks
@saifi1223
@saifi1223 3 года назад
sir i need your help
@StudentCompanion
@StudentCompanion 3 года назад
Start your own comment not replying on this comment. Ask your question, provide all relevant information to understand your question.
@StudentCompanion
@StudentCompanion 8 лет назад
For more info and download source code: www.studentcompanion.co.za/pulse-width-modulation-pwm-with-pic-microcontroller-mikroc/
@keshenanaidu7160
@keshenanaidu7160 8 лет назад
Thank you very much
@StudentCompanion
@StudentCompanion 8 лет назад
+keshena naidu You are welcome
@tota896
@tota896 8 лет назад
Thank you.
@StudentCompanion
@StudentCompanion 8 лет назад
+tota896 You are welcome
@hicham3341
@hicham3341 8 лет назад
سلام عليك جزاك الله خيرا
@StudentCompanion
@StudentCompanion 8 лет назад
+Hicham Bougaa thank you.
@CADElectronicsTH
@CADElectronicsTH 2 года назад
Thank you so much.
@smartsamirul5499
@smartsamirul5499 2 года назад
can you help to learn how spwm signal 50hz for sine wave inverter work perfectly ?
@shariefmahaboob2363
@shariefmahaboob2363 5 лет назад
hello im getting error for this code like(undeclared identifier in 'PWM1_Init' expression) can u please tell me how to solve it
@StudentCompanion
@StudentCompanion 5 лет назад
Which PIC are you using? Does ot have more than 1 PWM?
@bhavinrathod406
@bhavinrathod406 6 лет назад
I want to use this pwm for stepper motor control where I use 50% duty cycle , and 2khz frequency ,this pwm I feeds to stepper motor driver , driver need variables frequency step inputs to vary speed but I can't use variable for pwm frequency ,, one more thing is I can't initialized 2 pwm pins with different frequencies ,, is there bug I am facing in my programming or it's limitations?
@StudentCompanion
@StudentCompanion 6 лет назад
Your first question is not clear. Are you trying to get a variable frequency from PWM? You can't use different frequencies with PWM. Mikroc PWM libraries explains why: Some MCUs have multiple CCP modules. In order to use the desired CCP library routine, simply change the number 1 in the prototype with the appropriate module number, i.e. PWM2_Start();. All PWM modules use Timer2 for its operation, so you can not set different frequencies for different PWM modules. You can learn more from the library help page. There is also an example using 2 PWM: download.mikroe.com/documents/compilers/mikroc/pic/help/pwm_library.htm
@bhavinrathod406
@bhavinrathod406 6 лет назад
Student Companion yes I've red every documents about pwm to vary frequency ,but not found any thoings, so what you suggest for stepper motor driver I need steps with variable frequency any other controller ?
@StudentCompanion
@StudentCompanion 6 лет назад
Then you misunderstood PWM. All PWM use timer. You can't have a PWM with a fixed duty cycle. Then it's not a PWM, it's simply a clocked pulse. What basically you are looking for? There might be other options maybe even a simple 555 can give you a variable frequency eith just a variable resistor and capacitor.
@wahidali4378
@wahidali4378 4 года назад
Sir you wrote ANSEL=0; ANSELH=0; But here you didn't specify any register that which register are going to be used digital I/O? Pease elaborate sir.
@StudentCompanion
@StudentCompanion 4 года назад
Some pins are multiplexed with analog functions as the ADC and comparators. When these pins are yo be used as digital input/output pins, it's important to disable the analog features on these pins, this is done with the ANSEL and ANSELH Registers. A 1 will set it as analog and a 0 will set it as digital. The ANSEL controls PORTA, the ANSELH controls PORTB . We cleared all PORTA and PORTB as digital. To clear an individual pin use ANSx. You can learn more from the datasheet on Port analog control. In this example that code won't make any difference because there is no analog features on RC1 which is used as PWM pin, you can remove it. But if you connect anything to PORTA or PORTB, then you can consider that code. It's best practice in hardware to set unused pins to digital output then connect them to ground with a resistor to avoid interferences.
@wahidali4378
@wahidali4378 4 года назад
@@StudentCompanion sir bindle of thanks. Looking forward to your guidence in future tutorials. I didn't find keypad tutorial coz i dont understand correctly the hardware configuration of keypad. Thanks
@StudentCompanion
@StudentCompanion 4 года назад
You are welcome!
@StudentCompanion
@StudentCompanion 4 года назад
We don't have yet a video tutorial on keypad but you can watch this video it explains how to use the keypad: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-s6GXfBZRoRM.html
@StudentCompanion
@StudentCompanion 4 года назад
We also have more tutorials on our website. This is the keypad tutorial: www.studentcompanion.co.za/interfacing-matrix-keypad-with-pic-microcontroller-mikroc/
@bhavinrathod406
@bhavinrathod406 7 лет назад
hello sir, i am your huge fan , i faced some problem about pic microcontroller using micro c, actually I want to use pwm for generating sound by the sampled array which is derived from audacity and store it into rom memory , please give me solution , thanks
@StudentCompanion
@StudentCompanion 7 лет назад
Your question is not clear, what do you mean by "sampled array which is derived from audacity and store it into rom memory"
@StudentCompanion
@StudentCompanion 7 лет назад
And by the way, ROM means Read Only Memory, so you can't store anything in this memory because it's read only. No write allowed.
@bhavinrathod406
@bhavinrathod406 7 лет назад
Can I have email address so I can send a program example
@StudentCompanion
@StudentCompanion 7 лет назад
We have to understand first your problem before we can assist you. As we have said, we don't understand your question and you can't save anything in PIC ROM memory as it's read only. What exactly are you trying to save?
@bhavinrathod406
@bhavinrathod406 7 лет назад
I want to save a raw data(voice data) which is obtained from a/d conversion from microphone
@CLANFORD294
@CLANFORD294 5 лет назад
aap ne likha Kp=keypad _key_click ();ye mana uske bad while(!kp);ye bhi samjha keypad press nahi hua uske agle step me if( keypad==Enter)break; jab keypad press hi nahi hua to enter kaise press ho gaya ??Aur chalo enter press kia bhi to without any operation break kyu ?? next step me if(kp is greater than 3 and less than 8)kp=kp-1 ;kyu suppose mai press kia 5 jo ki greter than 3 and less than 8 hai to kp-1 ho gaya 4 jo ki kp ko assign kr dia ab kp= 4 ka kaha use hua
@CLANFORD294
@CLANFORD294 5 лет назад
if (kp greater than 8 and less than 12 )kp=kp-2;yaha kp less than 12 hi kyu lia and lia bhi to kp-2 se kya fayda hua next step if (kp==14) kp=0; ye kya hai kp=14 kaise hoga jab keypad 9 tak hi hai agar hua v to kp=0 kyu
@StudentCompanion
@StudentCompanion 5 лет назад
We don't understand what you are writing. write your question in English.
@StudentCompanion
@StudentCompanion 5 лет назад
@@CLANFORD294 What are you referring to? We don't understand what you are writing. write your question in English.
@epicbattles542
@epicbattles542 5 лет назад
i am using pic 18F26k20 and running the same code as yours but the error is MCLR IS LOW PROCESSOR IS IN RESET
@StudentCompanion
@StudentCompanion 5 лет назад
You must connect the PIC MCLR pin to +5V via a pullup resistor (10K). Or disable the MCLR in code. In edid project menu.
@epicbattles542
@epicbattles542 5 лет назад
@@StudentCompanion ok sir i am going to apply this
@StudentCompanion
@StudentCompanion 5 лет назад
Ok. Let us know if it works
@epicbattles542
@epicbattles542 5 лет назад
@@StudentCompanion yes sir it worked
@StudentCompanion
@StudentCompanion 5 лет назад
Great!
@alinisar2553
@alinisar2553 5 лет назад
sir how we can implement this circuit in hardware,,,please help
@StudentCompanion
@StudentCompanion 5 лет назад
There is the circuit diagram showing you how it should. What's your questions?
@DaniyalElectronicsWorkshop1
@DaniyalElectronicsWorkshop1 6 лет назад
pwm for ups with variable control..plz send me any sample code..mikroc
@StudentCompanion
@StudentCompanion 6 лет назад
+Pakistani Urdu World we don't write codes for each and everyone who request it. We only assist with existing codes which have errors.
@saifi1223
@saifi1223 3 года назад
Sir please avoid my English.. here is my question im going to build a buck converter using your sorurce code how can i control duty cycle using feedback tell me about which adc commamd will work for it so it will automatically varies the duty cycle if output voltage of buck gets low or high . Please make video on it or provide code for me because you can easly do it and im newbie microcontroller programing I'll be vary thankful to you . Thank you
@StudentCompanion
@StudentCompanion 3 года назад
Hi. You could use the same principle explained in this video to change the duty cycle. The same analog voltage we used to change the duty cycle, you could use the output voltage: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-mHtI9m3aO3s.html
@saifi1223
@saifi1223 3 года назад
@@StudentCompanion Hello. Thank you sir for fast response does it work as feedback and it will automatically changes duty cycle when i add load on out put of buck converter?
@StudentCompanion
@StudentCompanion 3 года назад
You are the one who has to change your code/project for it to work as feedback by using the same procedure.
@saifi1223
@saifi1223 3 года назад
@@StudentCompanion ok thank you ill try it
@StudentCompanion
@StudentCompanion 3 года назад
You are welcome!
@TheEngineersBeatsDeLinge
@TheEngineersBeatsDeLinge 4 года назад
I can't use these fonctions, did i miss something?
@StudentCompanion
@StudentCompanion 4 года назад
No one can guess what could be the problem based on that limited information. Which PIC are you using? What do you mean you can't use those functions? Are you getting errors? If yes, what errors?
@CLANFORD294
@CLANFORD294 5 лет назад
sir nahi samjha kisi ko lectue 12 project 2 samjha to pls explain
@StudentCompanion
@StudentCompanion 5 лет назад
We don't understand what you are writing. write your question in English.
@smartsamirul5499
@smartsamirul5499 2 года назад
with pic 16F877
Далее
PIC Basics - PWM Part 1
18:47
Просмотров 13 тыс.
Ajdarlar...😅 QVZ 2024
00:39
Просмотров 824 тыс.
50Hz PWM generation using PIC16F877A
56:59
Просмотров 32 тыс.
Scamp3 PWM / MOSFET Driver / FlashForth / PIC
9:20
Просмотров 1,8 тыс.