🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Where can I find examples of using UART module in UIFlow?

    UIFlow
    4
    25
    10.7k
    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.
    • teastainT
      teastain @felmue
      last edited by

      @felmue As a side note:
      I had a project where the third party sensor was 5V intolerant.
      I chose the Stamp-PICO with the USB Downloader accessory (and the Stamp-ISP) are 3.3V (!)

      Cheers, Terry!

      100% M5Stack addict with several drawers full of product!

      1 Reply Last reply Reply Quote 0
      • Z
        zhoubinx @felmue
        last edited by

        @felmue Thanks Felix! The device i'm working on is an Arduino 328P board, there were a UART port on the board (as far as the info i have, there printed "UART port", not I2C or whatever). It's a quite old device, it's difficult find link and more introduction. And it is the control board of an open source laser engraver machine.
        I will try your suggestion of the port voltage. And I also ordered a M5 UART GPS module, I will try that module to get more understanding of serials port programing first.

        1 Reply Last reply Reply Quote 0
        • Z
          zhoubinx @felmue
          last edited by

          @felmue I tested my target device the PIN is 3.3V, so, I need to downgrade M5 from 5V to 3.3V? Many thanks!

          robskiR 1 Reply Last reply Reply Quote 0
          • robskiR
            robski @zhoubinx
            last edited by

            @zhoubinx M5 gpio/ grove are 3.3v so if your device side is 3.3 then all good, be sure that tx goes to rx and rx to tx, same baudrate and parity ....

            M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ

            1 Reply Last reply Reply Quote 1
            • felmueF
              felmue
              last edited by felmue

              Hello @zhoubinx

              like @robski already mentioned, you only need level shifter if your target board TX and RX pins are different from M5Stack Groove port, which uses 3.3 V on its data pins. (Only the red wire of the Groove port, providing power to the M5Stack units, is 5 V.)

              Are you sure your target board uses 3.3 V on the data pins? Arduino boards (especially old ones) mostly use 5 V on their data pins.

              Thanks
              Felix

              GPIO translation table M5Stack / M5Core2
              Information about various M5Stack products.
              Code examples

              1 Reply Last reply Reply Quote 0
              • Z
                zhoubinx
                last edited by

                0_1709551989520_da169cec-8dae-4fdb-8fd5-671dcf1aaaaa-image.png It looks like the bad thing is from AXP2101 power chip, all the PORTs were set to 5V? Please, any idea of how to lower voltage to 3.3V.
                I will also find a multimeter to give a test.

                robskiR 1 Reply Last reply Reply Quote 0
                • felmueF
                  felmue
                  last edited by felmue

                  Hello @zhoubinx

                  I am not sure you fully understand the concept of how the Groove port of M5Stack devices are setup.

                  • Power (red wire) provides 5 V to M5Stack units (which if required turn the 5 V internally to 3.3 V using an DC/DC converter or LDO).
                  • Data lines (yellow and white wire) use 3.3 V
                  • GND (black wire)

                  In your case I assume the 3rd party device (Arduino) is already powered by its own power supply. If yes, then there is no need to use the power (red wire) of the M5Stack.

                  If the 3rd party device is using 3.3 V on its data lines (TX and RX) then the wiring is as follows:

                  M5Stack (3.3 V) TX <---> RX (3.3 V) of 3rd party device
                  M5Stack (3.3 V) RX <---> TX (3.3 V) of 3rd party device
                  M5Stack GND <---> GND of 3rd party device

                  If the 3rd party device is using 5 V on its data lines (Tx and RX) then the wiring is as follows:

                  M5Stack (3.3 V) TX <---> Level shifter <---> RX (5 V) of 3rd party device
                  M5Stack (3.3 V) RX <---> Level shifter <---> TX (5 V) of 3rd party device
                  M5Stack GND <---> GND of 3rd party device

                  Here is an example M5Stack unit which uses an DC/DC converter to lower the 5 V to 3.3 V and includes level shifters for the data lines. See schematic.

                  Thanks
                  Felix

                  GPIO translation table M5Stack / M5Core2
                  Information about various M5Stack products.
                  Code examples

                  1 Reply Last reply Reply Quote 0
                  • robskiR
                    robski @zhoubinx
                    last edited by

                    @zhoubinx said in Where can I find examples of using UART module in UIFlow?:

                    0_1709551989520_da169cec-8dae-4fdb-8fd5-671dcf1aaaaa-image.png It looks like the bad thing is from AXP2101 power chip, all the PORTs were set to 5V? Please, any idea of how to lower voltage to 3.3V.
                    I will also find a multimeter to give a test.

                    on your graphic USB-C is not PORT C (blue) - unfortunately it is drawn in blue - but this is USB port which you are connecting your Laptop /pc to M5Stack

                    in general on Ports A/B/C wires blk/red are power pins with gnd/5v on them where other two pins wht/yellow are data/sensor pins with 3.3v expected

                    M5StickC, M5StickCPlus, M5StickCplus2,M5GO, M5Core, M5Tough, M5Core2, M5 Demo Board, M5Dial, M5Paper, M5Atom, M5Cardputer, M5StampS3, CoreMP135, StamPLC, AirQ

                    1 Reply Last reply Reply Quote 0
                    • Z
                      zhoubinx
                      last edited by

                      Thanks all friends! I finally figure it out.
                      I think it is still related to AXP2101. When I keep the USB-C connected and use PORT C to communicate, it works. When plug off the USB-C, PORT C UART port just never send and receive data. I think it is because the USB-C supply power to the PORT C, not the inside battery. I will try to figure out how to let the battery to give power to PORT C.

                      1 Reply Last reply Reply Quote 0
                      • felmueF
                        felmue
                        last edited by

                        Hello @zhoubinx

                        I am glad to hear you got it working (at least with USB-C power).

                        BTW: My M5CoreS3 (running UIFlow2 firmware) provides power to all Groove ports (A/B/C) in both cases: running from USB-C or battery.

                        In your hardware setup, what do you need the 5 V of the Groove port for? If you have a multimeter it should be relatively easy to verify 5 V being present or not.

                        Thanks
                        Felix

                        GPIO translation table M5Stack / M5Core2
                        Information about various M5Stack products.
                        Code examples

                        1 Reply Last reply Reply Quote 0
                        • felmueF
                          felmue
                          last edited by

                          Hi guys

                          I've created an UIFlow2 example (M5CoreS3_Ext_Usb_Power_UIFlow2.0.1) showcasing switching ext. power output (Groove port) and USB power output. You can find it in the UIFlow2 Play Zone.

                          Thanks
                          Felix

                          GPIO translation table M5Stack / M5Core2
                          Information about various M5Stack products.
                          Code examples

                          1 Reply Last reply Reply Quote 0
                          • Z
                            zhoubinx
                            last edited by

                            Thanks Felix! I will study your new example.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post