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

Logic Level shifter for 12864 display on Duet 2 Wifi

Scheduled Pinned Locked Moved
Duet Hardware and wiring
11
200
16.5k
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
    dc42 administrators @oliof
    last edited by dc42 20 Apr 2020, 21:35

    @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

    @bearer enabling the LCD12864 feature for DuetNG in RepRapFirmware3 does not grow the size beyond rom, or at least I do not get an error message ... I still need to suss out the pin assignments though.

    The standard v3.01-dev branch build of Duet2CombinedFirmware has 19kB free. The 12864 code on the Duet Maestro build takes up 0x24E0 bytes of readonly data, 0x2840 bytes of code, 0x144 exception table and 0x130 exception index. Total 0x5F94, which is nearly 24K. So unless I have missed anything, it is too large by about 5Kb, which agrees with the message.

    I've just managed to reduce the size of the standard 3.02 binary by 4.5kb, so now you are only about 0.5kb short. This will be in the next commit. You will need to update the CoreNG and freeRTOS projects as well as the RepRapFirmware project.

    Possible ways to make it fit (EDITED):

    • You could save 5kb space by removing the large font
    • Compile the less critical parts of the firmware with option -Os instead of -O2
    • Remove one of the less-used kinematics classes when 12864 support is enabled
    • Remove the old 3/4/5-point bed compensation (I will probably do this myself soon anyway)
    • Remove the support for async moves (see SUPPORT_ASYNC_MOVES) or IOBITS (SUPPORT_IOBITS) or scanner
    • Separate the WiFi and Ethernet support into separate firmware binaries, as they were before I combined them.

    Duet WiFi hardware designer and firmware engineer
    Please do not ask me for Duet support via PM or email, use the forum
    http://www.escher3d.com, https://miscsolutions.wordpress.com

    1 Reply Last reply Reply Quote 0
    • undefined
      dc42 administrators
      last edited by 20 Apr 2020, 21:53

      Update: I just tried a build with the 12864 display enabled. It overflowed by 28 bytes! So it's close to fitting.

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User
        last edited by 21 Apr 2020, 01:26

        just occured to me, would adding both say DIP and SOIC footprint cause issues with signaling? if not, maybe it could lower the diy threshold a little, although SOIC shouldn't really be an issue for the beginner.
        eb50fac4-4ace-4b60-a784-4abba24b70b7-image.png

        1 Reply Last reply Reply Quote 0
        • undefined
          oliof
          last edited by 21 Apr 2020, 07:49

          Funny story, the TXS0108 I ordered in DIP format came as SOIC on a PCB with pin headers ... same footprint, but kind of ironic.

          <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

          1 Reply Last reply Reply Quote 0
          • undefined
            oliof
            last edited by 21 Apr 2020, 07:52

            @dc42 I was considering removing kinematics I don't need for the machine I want to run this on because it will likely be the easiest self-contained change for someone not super acquainted with the firmware. But finding another 28 bytes to drop seems a worthy cause (-:

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by 21 Apr 2020, 07:53

              eBay is like a box of chocolates?

              btw, compiling without, say hangprinter , results in a binary after dc42's other improvements. seemed the path of least resistance.

              diff --git a/src/Movement/Kinematics/Kinematics.cpp b/src/Movement/Kinematics/Kinematics.cpp
              index 782bd43f..d48ef90f 100644
              --- a/src/Movement/Kinematics/Kinematics.cpp
              +++ b/src/Movement/Kinematics/Kinematics.cpp
              @@ -11,7 +11,9 @@
               #include "LinearDeltaKinematics.h"
               #include "RotaryDeltaKinematics.h"
               #include "ScaraKinematics.h"
              +#ifndef SUPPORT_12864_LCD
               #include "HangprinterKinematics.h"
              +#endif
               #include "PolarKinematics.h"
               #include "FiveBarScaraKinematics.h"
              
              @@ -161,8 +163,10 @@ AxesBitmap Kinematics::GetConnectedAxes(size_t axis) const noexcept
                              return new LinearDeltaKinematics();
                      case KinematicsType::scara:
                              return new ScaraKinematics();
              +#ifndef SUPPORT_12864_LCD
                      case KinematicsType::hangprinter:
                              return new HangprinterKinematics();
              +#endif
                      case KinematicsType::polar:
                              return new PolarKinematics();
                      case KinematicsType::rotaryDelta:
              diff --git a/src/Movement/Kinematics/Kinematics.h b/src/Movement/Kinematics/Kinematics.h
              index e2cf603f..6852214e 100644
              --- a/src/Movement/Kinematics/Kinematics.h
              +++ b/src/Movement/Kinematics/Kinematics.h
              @@ -27,7 +27,9 @@ enum class KinematicsType : uint8_t
                      linearDelta,
                      scara,
                      coreXYU,
              +#ifndef SUPPORT_12864_LCD
                      hangprinter,
              +#endif
                      polar,
                      coreXYUV,
                      fiveBarScara,           // was previously reserved for @sga, see https://forum.duet3d.com/topic/5775/aditional-carterian-z-axis-on-delta-printer
              
              1 Reply Last reply Reply Quote 0
              • undefined
                oliof @A Former User
                last edited by 21 Apr 2020, 08:10

                @bearer said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                but it doesn't build at all unless the pins are defined?

                I defined the freed pins from the stepper, so they weren't undefined. I just didn't sort them out. I'll give your patch a go and see whether I can get the 28 byte overflow.

                <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                1 Reply Last reply Reply Quote 0
                • undefined
                  oliof
                  last edited by oliof 21 Apr 2020, 09:35

                  After some more fighting with Eclipse, I seem to have a finished build from RepRapFirmware v3.01-dev branch with LCD support and no hangprinter ... will try to see whether my Duet2 board boots, and then carefully start a test setup ...

                  <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                  1 Reply Last reply Reply Quote 0
                  • ?
                    A Former User
                    last edited by 21 Apr 2020, 10:13

                    Took a while before I realized I had to go via 3.0 release to get the iap file to support the 3.x binaries; and then make the swap of the two pins I did on mine - but seems to work with RRF3 as well after Davids efforts.

                    The dedication on that man ... can we (temporarily!) put him to work on a covid-19 vaccine?

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      oliof
                      last edited by 21 Apr 2020, 10:36

                      I am currently trying to understand your tsx cabling -- my 74hct08 started smelling funny after a minute when I tried to figure out what to connect where so I don't trust it a lot. Of course I am complicating things by using an 12864 minipanel which might not even work fine (but in testing lit up fine on 3.3V -- that may be just the leds though).

                      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                      ? 1 Reply Last reply 21 Apr 2020, 10:46 Reply Quote 0
                      • undefined
                        oliof
                        last edited by 21 Apr 2020, 10:38

                        Also, some confusion: In your photo you are connecting to the CONN_SD port, not to the CONN_LCD one. Or am I looking at things wrong?

                        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                        ? 1 Reply Last reply 21 Apr 2020, 10:41 Reply Quote 0
                        • ?
                          A Former User @oliof
                          last edited by A Former User 21 Apr 2020, 10:41

                          @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                          Also, some confusion: In your photo you are connecting to the CONN_SD port, not to the CONN_LCD one. Or am I looking at things wrong?

                          @bearer said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                          edit: i would propose swapping lcd_cs to from PortDPin(21) / lcdconn.10 to PortAPin(7) / sdconn.7 as it would enable a single 10 way ribbon cable to function as just a display + sd reader (but no buttons/beep). Or maybe utxd0, urxd0 and spi0_cs could be used if the reader isn't present or needed.

                          true story. the SPI bus is on CONN_SD
                          6d7eb945-d54e-4131-9624-39a8a3f44bda-image.png

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User @oliof
                            last edited by 21 Apr 2020, 10:46

                            @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                            I am currently trying to understand your tsx cabling -- my 74hct08 started smelling funny

                            the only difference is the swapping of the LCD_CS pin as it allowed me to use just the one port and also cleaned up the board layout a little. i could probably get below 3 vias if I really put some more effort into it, but with the prices jlcpcb have these days meh.

                            funny smelling wouldn't be caused by swapping the signal pins they don't have the oompfh to do so. i'd check the 5v and gnd connections.

                            1 Reply Last reply Reply Quote 0
                            • undefined
                              oliof
                              last edited by 21 Apr 2020, 11:53

                              It might be a mistake on my board. My guess is I can try to get it to work like your setup, and then move to my board or the updated design later.

                              I think the distribution of pins to headers is just what a standard 12864 display has, and not dc42's design. I'd suggest sticking with the standard setup.

                              Don't you need both headers still if you also want to use the encoder wheel? I'd question the utility of the 12864 display without one ... but I might be completely wrong. Speaking of the encoder, do I interpret your color scheme correctly that ENC_A, ENC_B, ENC_SW do not go through the level shifter but connect directly?

                              <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                              ? undefined 2 Replies Last reply 21 Apr 2020, 12:03 Reply Quote 0
                              • ?
                                A Former User @oliof
                                last edited by 21 Apr 2020, 12:03

                                @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                                Don't you need both headers still if you also want to use the encoder wheel?

                                i find my self looking at the screen in passing more than using them for operation, but yes.

                                @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                                do I interpret your color scheme correctly that ENC_A, ENC_B, ENC_SW do not go through the level shifter but connect directly?

                                when i looked at he reprap discount display schematic, the encoder is wired directly to the headers and its effectively three normally open(?) switches to ground so it only needs the pull up on the duet, no level shifting. so yes.

                                1 Reply Last reply Reply Quote 0
                                • undefined
                                  dc42 administrators @oliof
                                  last edited by 21 Apr 2020, 12:48

                                  @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                                  I think the distribution of pins to headers is just what a standard 12864 display has, and not dc42's design.

                                  Correct, the pinout is taken from the original RepRapDiscount design and is compatible with the many clones of that display that you can find on Amazon and eBay. Unfortunately, some printer/display manufacturers got the connectors the wrong way round, and others went for a different pinout completely.

                                  Duet WiFi hardware designer and firmware engineer
                                  Please do not ask me for Duet support via PM or email, use the forum
                                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                                  undefined 1 Reply Last reply 21 Apr 2020, 12:59 Reply Quote 0
                                  • undefined
                                    oliof @dc42
                                    last edited by 21 Apr 2020, 12:59

                                    @dc42 as I am currently experiencing with my CR 20 "minipanel". Reading Marlin source code I am 90% sure it is an ST7920, but for some reason it needs 8MHz instead of 2 (or at least the refresh rate in Marlin is set to 125nsec), and I think some pins are different. I am still digging (-:

                                    <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                    ? undefined 2 Replies Last reply 21 Apr 2020, 13:03 Reply Quote 0
                                    • ?
                                      A Former User @oliof
                                      last edited by A Former User 21 Apr 2020, 13:03

                                      @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                                      it needs 8MHz instead of 2

                                      should be possible to do with F8000000 to the M918 command

                                      for the pinout you could look at reprap http://reprap.org/mediawiki/images/5/51/RRD_FULL_GRAPHIC_SMART_CONTROLER_SCHEMATIC.pdf and work backwards from the 3 pins on the lcd and the pins on the encoder (to map the cr 20 header)?

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        oliof
                                        last edited by 21 Apr 2020, 15:09

                                        Thanks for pointing out the F parameter! I will use the default pin layout if only to avoid future hassle when a ready-made adapter is available and people use this that aren't up to making their own custom cable (especially considering I have enough trouble doing it myself).

                                        A new reprap smart controller is on the way so I can test with a device that's known good ... I will test first on an unmodified maestro running RRF 2.05.

                                        <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                                        ? 1 Reply Last reply 21 Apr 2020, 15:20 Reply Quote 0
                                        • ?
                                          A Former User @oliof
                                          last edited by A Former User 21 Apr 2020, 15:20

                                          @oliof said in Logic Level shifter for 12864 display on Duet 2 Wifi:

                                          I will use the default pin layout

                                          not sure which is the default? afaik beyond the reprap one its a bit of a lottery, and ramps have had a range of adapters for the various clones (why they couldn't just clone the reprap idk)

                                          if you're refering to the change i made, it's only between the duet and the 74htc08 so it won't affect the display as such. (but it will simplify troubleshooting as you only need to get 1 cable right to get the display to indicate its working)

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