Generating PWM Signals Using the Raspberry Pi Pico | STOP BIT BANGING on the RP2040!

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ม.ค. 2025

ความคิดเห็น • 43

  • @lorenzo.c
    @lorenzo.c 3 ปีที่แล้ว +18

    Good video.
    A note: in serial communications "Manchester encoding" refers to associating the logic value of a bit to the direction of the transition of the signal (so binary "1" corresponds to "high-to-low" and binary "0" corresponds to "low-to-high" or the other way round) rather than the level ("VCC" voltage and "GND" voltage). This means that, whatever the actual values of the information being transmitted, the serial stream will have one transition in each of the bit-periods.

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว +2

      Ah, yeah you're right good catch. I had the names mixed up

  • @critical_always
    @critical_always 2 ปีที่แล้ว +1

    Mate the information from 2:21 onwards was exactly the answer to my question: Are all PWM channels using a common clock. Answer: YES. And I learned something. Thanks.

  • @weench
    @weench 3 ปีที่แล้ว +7

    Thank you for the detailed explanation of the PWM before revealing the code

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว

      Glad it was helpful!

  • @ProactiveExcellence
    @ProactiveExcellence ปีที่แล้ว +2

    The best explanation I've seen about PWM on the Pi Pico. Would be perfect if you included an explanation of the PWM clock divider so you can produce much lower PWM frequencies... 👌

  • @MrVipulLal
    @MrVipulLal 3 ปีที่แล้ว +1

    Exactly what I was looking for. Thanks!

  • @HighfireX
    @HighfireX 3 ปีที่แล้ว +2

    c examples are always appreciated. Was just thinking about learning how to use pwm

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว +1

      I found the PWM interface kind of confusing at first, I hope this clears it up!

    • @tinker7722
      @tinker7722 3 ปีที่แล้ว

      PWM is often used to dimm an LED or also to control a servo.

  • @junaidpv
    @junaidpv 3 ปีที่แล้ว +2

    Thanks! Especially for explaining the code.

  • @DavisidMatius
    @DavisidMatius ปีที่แล้ว +2

    Cool video, thank you!
    I have a question for you, how can I set a PWM with 50Hz frequency.
    50Hz would require 2.500.000 as wrap point using the Pico's inner clock (125MHz)
    The thing is that according to the C header of the pwm_wrap_number void function, the wrap point number must be a uint16_t variable and 2.500.000 exceeds the variable maximum number (2**16).
    Thank you!

    • @DavisidMatius
      @DavisidMatius ปีที่แล้ว

      If you wonder, 50Hz is because I want to control a servo using your method

  • @brendanowen7563
    @brendanowen7563 3 ปีที่แล้ว +1

    Well explained video. Had a working example in minutes.

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว

      I'm glad it was helpful :)

  • @grahamparr4451
    @grahamparr4451 2 ปีที่แล้ว

    your the man ,this was really useful

  • @sonnentaugnu2184
    @sonnentaugnu2184 3 ปีที่แล้ว

    Loved the video! Thank you very much.

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว

      Glad you enjoyed it!

  • @monsterhunter445
    @monsterhunter445 ปีที่แล้ว

    Can these be used to generate an analog tv signal? I am assuming not i am trying to get way to generate an analog output that is capable of driving a crt .

  • @aka12176
    @aka12176 3 ปีที่แล้ว

    Thanks so much. Clears alot

    • @LowLevelTV
      @LowLevelTV  3 ปีที่แล้ว

      Glad it helped!

    • @aka12176
      @aka12176 3 ปีที่แล้ว

      It did. I love your work... keep it coming.

  • @bjhazelwood1014
    @bjhazelwood1014 2 ปีที่แล้ว

    great video, i have a question tho could this be used as a clock signal for data transmission?i haven't found any documentation about being able to get the clock signal from the pico and what this offers seems like it would be what i need but not sure.

  • @davidkender4660
    @davidkender4660 2 ปีที่แล้ว

    Thanks,
    Dave Kender

  • @vipullal7689
    @vipullal7689 3 ปีที่แล้ว +1

    Great, but you might have discussed the fractional dividers.

  • @phillipneal8194
    @phillipneal8194 5 หลายเดือนก่อน

    Nice. And now can you make a qrp WSPR beacon ?

  • @Arthur60
    @Arthur60 3 ปีที่แล้ว

    03:20 : On the diagram count 500 should be the same as, not followed by, count 0.

  • @jeyaprakashrajaiah32
    @jeyaprakashrajaiah32 11 หลายเดือนก่อน

    i m using rp2040 pwm with dso 100mhz i want create freq 100mhz but the square wave isn't coming it has much noice can you tell me please whats the reason and is it possible to create high freq with pico

  • @yahmk3978
    @yahmk3978 3 ปีที่แล้ว

    Thank you very much!

  • @flethacker
    @flethacker 2 ปีที่แล้ว

    Is it posssible to use this to control a dc motor to turn on off and maybe even speed purely in sofware on pico?

    • @monsterhunter445
      @monsterhunter445 ปีที่แล้ว

      Yes PWM is used for that and buzzers. Encoding digital information as well.

  • @la6mp
    @la6mp 3 ปีที่แล้ว

    How about making a stopwatch with microsec resolution?

  • @nin1ten1do
    @nin1ten1do 3 ปีที่แล้ว

    can i have wish?? For example of 2 chanel with 180degree phase shift ( not flip flop) with seting of frequency and also duty cycle?? coz at time 0 we shut have one pin HIGH and second pin LOW output.. let se for example for H-BRIDGE i can deal with that code somehow.. still pain for me to use arduino.. ijust try miniaturized my dual chanell function generator and IR2153 or etc was not abble go up to 1MHz per chanell with dudy drive + freq set + phase shift they in the best scenation end at 466kHz.. and ton of EMI problems..

    • @julianbinder2371
      @julianbinder2371 3 ปีที่แล้ว

      I don't think you can use PWM like that, you could use PIO for that thou, which the pi pico also has

    • @nin1ten1do
      @nin1ten1do 3 ปีที่แล้ว

      @@julianbinder2371 i do and i will share code kid.. dont say you cant.. it is only lack of efford..

    • @abdullahahmed7781
      @abdullahahmed7781 2 ปีที่แล้ว +2

      @@nin1ten1do sooooo.... 3 months have passed. Im also a naive kid, can you share the code now? With your dedication and eFfoRT Im sure you have coded the most optimal and beautiful solution 😂

  • @ananduajayan8829
    @ananduajayan8829 3 ปีที่แล้ว

    What's the maximum frequency of the PWM signal that we can produce using Raspberry pi pico?

    • @sonnentaugnu2184
      @sonnentaugnu2184 3 ปีที่แล้ว

      I can only assume, but I would say 125/2 MHz (62,5 Mhz), if you let the counter count to one as wrapping point. but there could be more limitations due to delay in the timer mechanics.

  • @tareqshahriar2587
    @tareqshahriar2587 2 ปีที่แล้ว

    That's good

  • @damin1916
    @damin1916 2 ปีที่แล้ว

    haha duty cycle

    • @damin1916
      @damin1916 2 ปีที่แล้ว +1

      im sorry