Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Sending data from a microcontroller to Duet3 (with SBC)

    Scheduled Pinned Locked Moved
    General Discussion
    3
    7
    145
    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.
    • awitcundefined
      awitc
      last edited by

      Hi,

      I have an STM32F4 board running a custom pressure controller, with a melt pressure transducer connected to it. I can achieve basic functionalities with toggling IO pins on the Duet3, but my goal would be to establish a two-way communication with a custom protocol for future features. I am trying to setup an USART connection between IO0 and the STM32 pins, but seems like the Duet3 does not receive anything. I am sending this with the hopes of seeing something pop up in the DWC:

      "M118 P3 S\"Hello from STM32!\"\n\r"
      

      I lack the general understanding of how to wire things up - is the Raspberry Pi SBC setup 'overriding' the standalone functions of the Duet3 board? Maybe I should connect the STM32 to RPi, and then have a Python script that sends the commands to DWC?

      I would greatly appreciate any info on how this should be done, ideally I would love to add many modules this way, so the communication method needs to be reliable.

      TLDR: I need to send pressure readings to Duet3 from STM32, to have a macro which stops a print when the pressure is too low.

      Thanks,
      AW

      jay_s_ukundefined chrishammundefined 2 Replies Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk @awitc
        last edited by

        @awitc what are you ultimately going to use the STM32F4 based board for? Which specific STM32F4 processor does it run?

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        awitcundefined 1 Reply Last reply Reply Quote 0
        • awitcundefined
          awitc @jay_s_uk
          last edited by awitc

          @jay_s_uk for now I have a STM32F411RE, will switch up to STM32F491RE in the following days. So it has Arm Cortex-M4. The STM is used to run a custom PID controller, which manipulates the speed of the extruder stepper motor, based on pressure.

          EDIT: not extruder motor, but a drive which provides material to be extruded. I want to have the pressure in the extruder at a certain level.

          jay_s_ukundefined 1 Reply Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk @awitc
            last edited by

            @awitc ok. Just wanted to mention that theres a fork of the duet firmware which runs on an STM32F4 (only the STM32F407 and STM32F429) which can have an spi2can module added so it can talk directly over CAN-FD to the duet 3.
            Although that probably won't help you with the control of the extruder.

            Have you added M575 in your config to enable the UART connector?

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            1 Reply Last reply Reply Quote 0
            • chrishammundefined
              chrishamm administrators @awitc
              last edited by

              @awitc The UART channel on io0 should be available no matter if the board is running in standalone or SBC mode but it has to be configured using M575 first (e.g. M575 P1 B57600 S2).

              Duet software engineer

              1 Reply Last reply Reply Quote 0
              • awitcundefined
                awitc
                last edited by awitc

                @jay_s_uk @chrishamm Yes, I have added the command, using 115200 as baudrate, but from what I see, I had the parameter S set to be default. I will try with the raw mode, that might have been the problem. Thanks!

                1 Reply Last reply Reply Quote 1
                • awitcundefined
                  awitc
                  last edited by awitc

                  EDIT: took me way too long, no idea what was missing, just started working as it should, thanks

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Unless otherwise noted, all forum content is licensed under CC-BY-SA