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

    Core2 + RS232F Module 13.2 UART2 not possible?

    Modules
    3
    11
    3.0k
    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.
    • H
      Hnerik Schmidt
      last edited by

      I have looked at the examples and the flow example indicates using uart2 and pins 16/17 on M5Stack Core.
      But according to documentation it is not the same pins for Core2 where uart2 is on 13/14 but pin 14 TX is not selectable on the dipswithes.

      I tried to use UART 1 on 1/3 but I have some issues with baud setting up 9600/7/1 None correctly on this port I think, and if I connect usb it stops working so...

      What am I doing wrong? Has anybody used the RS232 unit with core2?

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

        Hello @Hnerik-Schmidt

        have a look at the topside of the module where the different GPIOs for different cores (M5Stack aka Core; M5Core2 aka Core2; M5CoreS3 aka CoreS3) are explained.

        Note: The dip switches are labelled for M5Stack (Core) only.

        So in order for M5Core2 to use GPIO13 and GPIO14 you'll need to set dip switch GPIO16 and GPIO17 to on.

        Thanks
        Felix

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

        H 1 Reply Last reply Reply Quote 0
        • H
          Hnerik Schmidt @felmue
          last edited by Hnerik Schmidt

          deleted

          H 1 Reply Last reply Reply Quote 0
          • H
            Hnerik Schmidt @Hnerik Schmidt
            last edited by

            Ok so I might maybe probably have figured it out now.
            I compared the GPIO pinout of core and core2 and they have moved the pins on core2 to corespond to the same pins so what was said earlier that I should dipswitch the rs232 thing to 16/17 is correct.
            but at the same time the program should say 13/14. then it seems to play nicely,

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

              Hello @Hnerik-Schmidt

              correct. I know it is a bit confusing. Most (if not all) modules have their GPIOs labelled for M5Stack (Core) and need some 'translation' when used with M5Core2 (Core2) or M5CoreS3 (CoreS3).

              Note: M5Core2 (Core2) has internal PSRAM and while most ESP32 GPIOs can be reassigned for various functions, PSRAM can only be used with GPIO16 / 17. That is the reason M5Stack engineers replaced them with GPIO13 / 14 on the M5Stack bus.

              Thanks
              Felix

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

              K 1 Reply Last reply Reply Quote 0
              • K
                kumsat @felmue
                last edited by

                @felmue @Hnerik-Schmidt could you share your working code? I'm having issue with M5Core2 + RS232F + UIFlow2.

                I tried the below code to read from a serial port using RS232F module. I set the GPIO pins 16 and 17 to On on M5Core2. I just see None as the output.

                Screenshot 2024-06-18 at 6.19.55 PM.png

                I tried Execute mpy code that I found in another thread, but I get the same output "None".

                Screenshot 2024-06-18 at 6.30.45 PM.png

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

                  Hello @kumsat

                  maybe try to recreate the UIFlow1 example in UIFlow2?

                  Thanks
                  Felix

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

                  K 1 Reply Last reply Reply Quote 0
                  • K
                    kumsat @felmue
                    last edited by

                    @felmue I'm getting Invalid pin error with the UIFlow1 example using UIFlow2. I used tx=17 and rx=16.

                    Traceback (most recent call last):
                      File "<stdin>", line 23, in <module>
                      File "<stdin>", line 13, in setup
                    ValueError: invalid pin
                    
                    felmueF 1 Reply Last reply Reply Quote 0
                    • felmueF
                      felmue @kumsat
                      last edited by felmue

                      Hello @kumsat

                      Sorry, I meant recreate and adapt to M5Core2 accordingly.

                      For M5Core2 you'll need to chose GPIOs from the Core2 column. See picture here and set the DIP switches accordingly.

                      Note: the DIP switches are labelled for M5Core. So for instance if you want to use GPIO14 (of M5Core2) you need to set DIP switch 17. And GPIO13 (of M5Core2) corresponds to DIP switch 16.

                      Thanks
                      Felix

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

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        kumsat @felmue
                        last edited by kumsat

                        @felmue I assumed so and tested both cases - tx: 17 & 14; rx: 16 & 13. In case of GPIO 14 and 13, I am not getting the invalid pin error but not receiving any data from the serial device either.

                        I used UART count of available in place of Remain Cache as mentioned in this post - https://community.m5stack.com/topic/5714/uart-remain-cache-ui-flow-2-equivalent
                        Screenshot 2024-07-10 at 1.46.14 PM.png

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

                          Hello @kumsat

                          hmm, not sure what's going on then. Unfortunately I do not have the RS232F Module 13.2 so I cannot try it myself.

                          Maybe it's time to reach out to M5Stack support?

                          Thanks
                          Felix

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

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