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

M950 GPIO Bug

Scheduled Pinned Locked Moved
General Discussion
4
8
397
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.
  • undefined
    stevenim
    last edited by 30 Jul 2020, 19:32

    I'm noticing a GCode bug on my Duet3D board. I'm running the following configuration:
    FIRMWARE_NAME: RepRapFirmware for Duet 3 MB6HC FIRMWARE_VERSION: 3.1.1 ELECTRONICS: Duet 3 MB6HC v1.01 or later FIRMWARE_DATE: 2020-05-19b2

    So I'm using all 9 GPIO outputs to drive some valves and I have all the GPIO set high beforehand. But when I assign the pins using M950, some of the states change. For example, assume that all GPIO outputs are set high at 3.3V. So when I query the object model of those pins, they all say this:

    {"key":"state.gpOut","flags":"","result":[{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00},{"pwm":1.00}]}

    Which is what I expect.
    Then I'll send down the following commands sequentially:
    M950 P0 C"io0.out"
    M950 P1 C"io1.out"
    M950 P2 C"io2.out"
    M950 P3 C"io3.out"
    M950 P4 C"io4.out"
    M950 P5 C"io5.out"
    M950 P6 C"io6.out"
    M950 P7 C"io7.out"
    M950 P8 C"io8.out"

    For some unknown reason, pins 4, 5, and 7 get switched low to 0V during those assignments and I have no idea why they would switch when all I'm doing is assigning them and not setting them. Even when I query the object model again, I still see that all pins are said to be high even though pins 4, 5, and 7 are low.

    What's going on? Why do only those 3 gpio pins get switched when I'm assigning pins? I'm not even setting them at all which is concerning since the board even thinks that they're all set high when they're physically not which puts it at an unknown state. Am I missing something?

    undefined 1 Reply Last reply 31 Jul 2020, 05:51 Reply Quote 0
    • ?
      A Former User
      last edited by 30 Jul 2020, 19:39

      seems to be related to the type of output https://duet3d.dozuki.com/Wiki/Duet_3_Mainboard_6HC_Hardware_Overview#Section_IO

      1 Reply Last reply Reply Quote 0
      • undefined
        fcwilt
        last edited by 30 Jul 2020, 21:52

        Hi,

        Would it not be simplest to configure them and then set them to a known state?

        Does it really matter if the states might change DURING configuration?

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        1 Reply Last reply Reply Quote 0
        • undefined
          JoergS5
          last edited by JoergS5 30 Jul 2020, 22:31

          I expect after assigning M950 the pullups are activated and behave differently to your measuring method of the voltage.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by 31 Jul 2020, 01:46

            So I'm using all 9 GPIO outputs to drive some valves and I have all the GPIO set high beforehand. But when I assign the pins using M950, some of the states change.

            Maybe I'm missing something here, but don't you need to create the pins with M950 first, then set values with something like M42? In any case there seems to be a difference with the three pins that do support pwm outputs, but if you can set the values immediately after then not sure I see the issue. To have predictable behavior before firmware is in control add external pull up/down?


            I expect after assigning M950 the pullups are activated and behave differently to your measuring method of the voltage.

            Wouldn't activation of pull ups require a ^ in the pin name? So there shouldn't be any pull ups active as its missing. Adding one might help though, but i'd put my money on external pull up if this is an issue in a undefined state.

            1 Reply Last reply Reply Quote 0
            • undefined
              JoergS5 @stevenim
              last edited by JoergS5 31 Jul 2020, 05:51

              @stevenim I have found it:

              https://duet3d.dozuki.com/Wiki/Connecting_a_Z_probe#Section_Software_setup_RepRapFirmware_Num_3
              in.4,5,7 are inverted to support Z probe:
              "On Duet 3 it is one of io4.out, io5.out or io7.out. If you use one of these pin names, you will not need to invert the output."
              So don't have to invert output means normal state 0.

              @bearer I read in the docu that the io pins of Duet 3 have pullups alreay (27k), so they don't need the ^.
              https://duet3d.dozuki.com/Wiki/Connecting_endstop_switches#Section_Duet_3_endstop_inputs
              My thought was that maybe by the assignment of the pins the resistors were activated, but the reason was invert for z probe.

              ? 1 Reply Last reply 31 Jul 2020, 07:12 Reply Quote 0
              • ?
                A Former User @JoergS5
                last edited by 31 Jul 2020, 07:12

                @JoergS5 said in M950 GPIO Bug:

                @bearer I read in the docu that the io pins of Duet 3 have pullups alreay (27k), so they don't need the ^.
                https://duet3d.dozuki.com/Wiki/Connecting_endstop_switches#Section_Duet_3_endstop_inputs
                My thought was that maybe by the assignment of the pins the resistors were activated, but the reason was invert for z probe.

                mixing inputs and outputs here? inputs have pullups yes, not the outputs. (well, buffered outputs have pulldowns leading up to the buffer, but the unbuffered io_n.out do not)

                undefined 1 Reply Last reply 31 Jul 2020, 07:25 Reply Quote 0
                • undefined
                  JoergS5 @A Former User
                  last edited by 31 Jul 2020, 07:25

                  @bearer said in M950 GPIO Bug:

                  mixing inputs and outputs here

                  you're right, thanks for explaining.

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