Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    RMT preipheral won't transmit?

    Scheduled Pinned Locked Moved Issues & Bugs
    6 Posts 2 Posters 22 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mogplus8M Offline
      mogplus8
      last edited by

      Hi all,
      I have been trying to use the RMT peripheral to transmit a pulse stream but I can't get it to work. Not sure if I've missed something.
      I have a Wipy and an Expansion board V3.1. All firmware is up to date. I'm using VS code with Pymakr plugin to program the board, running under Manjaro Linux. I am using Xoscope to view the output pulse train.
      I have another ESP32 based board (a Heltec WiFi kit 32) and I can program the RMT peripheral on that board using C (with VS code and PlatformIO plugin and the esp-idf functions (rmt_write_items etc) ) and it works perfectly. But I can't get it to work on my Pycom board.
      Here is my test program

      # This is your main script.
      
      print("Hello, world!")
      import pycom
      pycom.heartbeat(False)
      from machine import RMT
      from machine import Pin
      chanPulse = [1000, 2000, 1000, 2000, 1000, 2000, 1000, 2000, 11000]
      duration=()
      ppmOut = Pin("P18", mode=Pin.OUT)
      ppm = RMT(channel=4, gpio=ppmOut, tx_idle_level=RMT.LOW)
      
      while(True):
          del duration
          duration = ()
          for i in range(8):
              duration = duration + (chanPulse[i], 300)
          syncPulse = 22500 - sum(duration)
          duration = duration + (syncPulse, 300)
          ppm.pulses_send(duration, start_level=RMT.HIGH) #, wait_tx_done=True)
          # print(duration)
      
      

      Pretty basic. Have I left something out, or is there something else I need to do to get it to work?

      FWIW this is what I see on xoscope. Just noise.
      Screenshot from 2020-07-11 11-53-45.png

      And this is what it should look like.
      Screenshot from 2020-07-11 11-58-04.png

      All advice gratefully received.

      robert-hhR 1 Reply Last reply Reply Quote 0
      • robert-hhR Offline
        robert-hh @mogplus8
        last edited by robert-hh

        @mogplus8 P18 is an input-only pin. You cannot set it to output mode. That applies to P13-P18. See the pin-out sheets.
        Edit: I agree that the firmware should raise an exception on the attempt to set output mode on P18.

        1 Reply Last reply Reply Quote 0
        • mogplus8M Offline
          mogplus8
          last edited by mogplus8

          Hi @robert-hh and apologies for taking so long to get back to you. Every time I looked in this forum over the last few days I couldn't find my post, so I figured it must have been sitting in somebody's inbox waiting for approval or something. Obviously it wasn't as you found it almost immediately. I've only just managed to find it now!
          So thanks for the tip, I'll try a different pin.
          (ten minutes later)
          Well that did it! I changed to pin 12 and it now works perfectly!
          edit well, not perfectly. There is another problem but I'll start a new thread for it.
          thanks again
          ;-)
          Whooops, got t his in the wrong place somehow..., it's a reply to @robert-hh 's post.

          robert-hhR 1 Reply Last reply Reply Quote 0
          • robert-hhR Offline
            robert-hh @mogplus8
            last edited by

            @mogplus8 Be careful with P12. You can use it with a WiPy2, but on all newer boards with PSRAM P12 is used for switching the WiFi antenna. So using it will interfere with WiFi.

            mogplus8M 1 Reply Last reply Reply Quote 0
            • mogplus8M Offline
              mogplus8 @robert-hh
              last edited by

              @robert-hh good grief. I picked P12 as it was the easiest one to find on the board being in the corner, and my eyesight ain't what it used to be. How about P5? That doesn't seem to have much attached to it, that I'm interested in at the moment anyway... or P7 maybe? Future plans involve lots of ADCs (10 of), a SPI connection and using the usb connector.

              ;-)

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @mogplus8
                last edited by

                @mogplus8 P5 and P7 are fine. The ADC's are limited to 8, P13 - P20, since only ADC1 can be used. P4, P8 and P23 are connected to the SD Card adapter on the expansion board. If you want to use the SD card, you cannot use the for other purposes. Otherwise you can use them. The USB is connected through a USB/UART bridge on the expansion board to UART0 on P0 and P1.

                1 Reply Last reply Reply Quote 0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom