LED Dimmer | PWM LAB1

Поділитися
Вставка
  • Опубліковано 28 сер 2024
  • CCP Module - PWM Mode (LAB1)
    Embedded Systems Tutorials - Microchip PIC Microcontrollers - MPLAB X
    [[ Tutorial #28 ]]
    You can read this exact same tutorial as a written article (in English) on my website.
    Through this link down below
    deepbluembedde...
    You can also check for downloadable content (code + schematics) herein in the description or on the website
    deepbluembedde...
    ===================================
    In this tutorial, you'll learn the fundamental of PWM signal generation with PIC Microcontrollers. Using Embedded-C programming language. You'll learn how to perform the required calculations for PWM frequency/duty cycle/resolution. We'll be using these concepts in LAB1 to control the brightness of an LED.
    ===================================
    You can also follow this course (with extra info) on my website (In English)
    deepbluembedde...
    You can follow this course playlist on UA-cam (In Arabic)
    • Embedded Systems Cours...
    ===================================
    For More Information
    Visit my website @ DeepBlueMbedded.com
    [[ And / Or ]]
    Follow me on socials
    LinkedIn / khaled-magdy-
    Twitter / ii_deepblue_ii
    FaceBook / khaled.elrawy.359
    ===================================
    If you've any questions, feel free to leave a comment down below.
    I will always be glad to respond to your comments as soon as possible.
    ------------
    Good Luck ^^
    And don't forget to SUBSCRIBE for more tutorials from DeepBlue!
    If you find this content useful .. Then Share It With Your Network!
    #Embedded_Systems
    #PIC_Microcontrollers
    #PWM

КОМЕНТАРІ • 17

  • @ameristanbouli5063
    @ameristanbouli5063 2 роки тому +1

    يعطيك العافية
    . عندي سؤال أنا جربت الكود على برنامج البروتس واشتغل تمام بس لما عم نزل الكود عالic ماعم يطلع خرج على pin17 علما أنو جربت غير أكواد وعم تشتغل باقي ال pins يعني مابظن مشكلة بالتوصيل أو بالتنزيل ,فقط الpin 17 تبع CCp1 ماعم تعطي خرج هل يوجد حل أم ياترا في خطأ بالكود ماعم تتوافق النمذجة مع التطبيق العملي :(

  • @pietmatsobane6790
    @pietmatsobane6790 4 роки тому

    Thanks, the website really helped!

  • @omarf148
    @omarf148 5 років тому +1

    i guess there's a point you've forgotten to mention that you used ( uint16_t) data type instead of (unsigned char) because the instance DC is 10-bits and that doen't suit (unsigned char) that only allowable for 8-bits .
    am i right ?

    • @DeepBlueMbedded
      @DeepBlueMbedded  5 років тому +1

      Exactly dude! the DC is a 10-Bit value which doesn't fit in a single byte data type. That's why i've stored it in a uint16_t variable. Yes, You're right !

  • @abbeed1
    @abbeed1 4 роки тому

    الله يجزيك الخير

  • @hammasouissi4110
    @hammasouissi4110 4 роки тому

    👍👍👍

  • @abdelrahmanyousef2237
    @abdelrahmanyousef2237 5 років тому

    here the prototyping of the function PWM_Set_Duty should be in the main not out side it as i learnt from a reference
    but actually it works in both in and out the main????
    do you have any idea??

    • @ahmedheshamal-qassas2682
      @ahmedheshamal-qassas2682 4 роки тому

      We can’t declare any function in main bro .. it’s one of basics of c/c++ programming language

  • @elektronikprojects3493
    @elektronikprojects3493 4 роки тому

    الله يعطيك العافية
    لو تتكرم انا عاوز اشغل LED 12v على خرج pic
    جربت مع ترانستورات التكبير 2n2222 pc337 لكن لما تفتح gate على 0.6v يعتبر الترانزستور اشارة الدخل من pic واحدة وغير متناوبة ومع منظمات الجهد 7812 lm على خرج pic ك دوائر تكبير لكن ايضا هناك حد معين لبوابة منظم الجهد ومانفعتش .
    السؤال اية ممكن استخدم لتشغيل LED 12v على خرج البيك بتفعيل PWM ؟
    وشكرا مقدما والله يعطيك العافية

    • @DeepBlueMbedded
      @DeepBlueMbedded  4 роки тому +1

      مفروض ای ترانزيستور يعطيك القدرة علی تنفيذ هذا الشیء
      انت تريد تكبير اشارة pwm جهدها 5 فولت الی 12 فولت
      و الخرج يروح ل الليد التی تريد التحكم بشدة اضاءتها
      يمكن استخدام Tip122 ترانزيستور مثلا و الدائرة بتاعته بسيطة جدا و هتلاقيها علی الانترنت بسهولة

    • @elektronikprojects3493
      @elektronikprojects3493 4 роки тому

      لك جزيل الشكر

  • @youssefelidrissi9471
    @youssefelidrissi9471 4 роки тому

    For tutorial 15: PWM
    CCP1CONbits.CCP1X = (350) & 2; // Get bit-1 !!?
    CCP1CONbits.CCP1X = (350 & 2)>>1;
    example:
    6&2=2
    (6&2)>>1 = 1

    • @DeepBlueMbedded
      @DeepBlueMbedded  4 роки тому

      عظيم جدا يا بشمهندس يوسف .. ملاحظة قوية جدا و صحيحة !
      فعلا تاهت عنی وقتها .. رغم انی عملتها صح قبل كدة فی اكثر من مشروع بس غلطت بالمثال دا
      طيب تقدر تتأكدلی اذا كان الbit field يقبل ارقام اكبر من 1 ام لا
      يعنی اكتب مثلا فی
      PORTBbits.RB0 = 2;
      شوف كدة هيشغلها و لا لا. لو ظبطت يبقا السطر ال حضرتك علقت عليه رغم انه خطأ منطقی الا انه هيشتغل صح .. و لو البيتاية RB0 فضلت 0 يبقا كلامك صح و السطر دا مش هيشتغل الا لما يتعدل و يتصحح.

  • @Masa-lo4uw
    @Masa-lo4uw 5 років тому

    Links wont open why?

    • @DeepBlueMbedded
      @DeepBlueMbedded  5 років тому

      I've tested the link a couple of times. it should be working! Try clicking the link below or maybe copy the URL to your browser. That may prevent UA-cam redirection. and please, tell me if it works for you deepbluembedded.com/pwm-pulse-width-modulation-tutorial/

    • @ahmedyasser9694
      @ahmedyasser9694 5 років тому

      @@DeepBlueMbedded
      It didn't work with me too!
      It says Error 404 Page not found
      I used all the links!

    • @DeepBlueMbedded
      @DeepBlueMbedded  5 років тому

      @Ahmed Oh My God! I thought this issue has been resolved :( .. Try opening the blog once again. it must be working
      deepbluembedded.com/blog/
      otherwise, the issue may be due to using adblocker or something about your browser security. Try going incognito and see if it works!
      please, notify me if you could load any page.