<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Embedded and Microcontrollers</title><link>https://community.element14.com/technologies/embedded/</link><description>Embedded systems programming, design and products; also microcontrollers, programmable logic, memory, DSP and controllers. </description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=33fc2a9f-2ce8-452e-bd4b-cb5ad362efda</link><pubDate>Tue, 24 Nov 2026 03:12:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:33fc2a9f-2ce8-452e-bd4b-cb5ad362efda</guid><dc:creator>shabaz</dc:creator><description>A more visually functioning mockup (just using rough graphics, but implementing the frequency adjustment algorithm). It is downloadable here: community.element14.com/.../mockup.zip To run: python ./panel_prototype_tuning.py The mouse scroll wheel represents turning the rotary encoder (or use up/down cursor keys). The left/right cursor keys are used to push the buttons below the encoder knob. In reality I&amp;#39;d want it to look closer to this: To me, currently it doesn&amp;#39;t feel very easy to use. Maybe it would be better in reality, but for sure on the PC it doesn&amp;#39;t feel as intuitive as I&amp;#39;d hoped (maybe because there is a full keyboard on the PC! easier to type the frequency). On the other hand, such an implementation is quite feature-rich, because it would quite easily extend to the memory capability with the purple lines shown there, plus, in future, maybe even reuse for receiver projects. Also, the same display could be used and let the user go into a menu to switch to digit-based tuning perhaps (i.e. the buttons below the encoder would move a cursor left/right). Another thing: I was strongly considering having two rotary encoders, one for coarse, one for fine, but that would have needed a larger enclosure. But possibly worth it in hindsight. I&amp;#39;m going to look at online projects, to see how they implement such wide-range tuning. On a military radio, they had an excellent rotary encoder that could be spun, so the software acceleration worked nicely, plus, they had an explicit button to press while rotating, in order to do the ultra-fine trimming. I have a consumer handheld receiver, it has awful tuning. The encoder is clicky, and the knob needs to be held down and simultaneously rotated, to adjust at a larger step size. But that just provides two step sizes which isn&amp;#39;t enough, and I can be sitting turning it for a minute just to get to the destination, so instead I have to use the memory functions heavily (so it jumps between memory locations quickly).</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=d0898ab6-af18-4af0-b4c0-814a4b33546d</link><pubDate>Mon, 23 Nov 2026 23:26:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d0898ab6-af18-4af0-b4c0-814a4b33546d</guid><dc:creator>shabaz</dc:creator><description>Chat GPT created a skeleton mockup (it doesn&amp;#39;t do anything except indicate button-presses):</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=13db2c88-d7cf-4d4c-89bf-2d99398278df</link><pubDate>Mon, 23 Nov 2026 22:18:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:13db2c88-d7cf-4d4c-89bf-2d99398278df</guid><dc:creator>shabaz</dc:creator><description>It&amp;#39;s a really awesome display isn&amp;#39;t it! There&amp;#39;s actually a nicer one - brighter, even better viewing angles, and far higher-res. But, it was just a fraction too large for some of the enclosures that I had : ( I think I&amp;#39;d strongly consider that one with say Pico 2, with the extra RAM. The encoder is not great, it doesn&amp;#39;t spin freely. I thought about trying to fit a bearing and a DIY rotary magnetic angle sensor, but that would have needed 3D printing and felt too complicated. For a first project, I&amp;#39;m thinking it would be nice to try to make a dedicated display specifically for frequency adjustment (so I can try it with the CMT2300A ), and experiment with the different schemes to find what works. I was thinking of something like this, playing around in PowerPoint: The encoder preferences could be stored in NVM, to try both the acceleration, and maybe a step method. Don&amp;#39;t know if this is intuitive or not... the black areas are not available (the CMT2300A has coverage gaps), the purple lines are stored frequencies, the white line is the current active freq. The top grey bar would contain all the status info like the current power level (low/med/high, since that is all that is configurable). The two buttons under the encoder could select the step, and when pressed, the display would zoom in or out, but also the rotation increment step would be displayed. The reason for displaying &amp;quot;FREQ&amp;quot; at the top-right, is to indicate that freq-adjustment mode is set. If the user pressed the MEMORY soft-key, then the new soft-keys that would appear would allow storing the frequency, or to switch to MEM mode, where rotating the control would jump to the next memory. The FINE TRIM would not change the zoom scale/step, but would just allow very fine adjustments of the order of tens of Hz. I&amp;#39;m thinking of asking AI to prototype this on the PC, then if it works OK, to port to C/C++ for Pi Pico. What do you think? Would this be intuitive? The inspiration was obviously a vintage radio tuner display : )</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=88da35fe-ea17-4193-9603-cadba0dc6062</link><pubDate>Mon, 23 Nov 2026 20:47:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:88da35fe-ea17-4193-9603-cadba0dc6062</guid><dc:creator>rsc</dc:creator><description /></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=133df238-7bfe-4147-9755-50f2dbd3898f</link><pubDate>Mon, 23 Nov 2026 20:35:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:133df238-7bfe-4147-9755-50f2dbd3898f</guid><dc:creator>Jan Cumps</dc:creator><description>&amp;gt; or to adjust the rotary encoder speed. The intuitive way for encoder speed is to react slow when turned slow, and to accelerate when turned faster. Like some mouse pointers do if you enable acceleration. That display has great form factor for instruments and little control boxes.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=87ca30d5-793d-434e-b7eb-f4aebecdd27e</link><pubDate>Mon, 23 Nov 2026 17:39:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:87ca30d5-793d-434e-b7eb-f4aebecdd27e</guid><dc:creator>shabaz</dc:creator><description>Hi! It&amp;#39;s a great idea, to add the mobile phone as another way of configuring/monitoring. When I get around to writing some code for this board, I will try to add WiFi (with Pi Pico W for now).</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=545d8b58-e796-44f0-b995-788218811ac1</link><pubDate>Mon, 23 Nov 2026 17:34:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:545d8b58-e796-44f0-b995-788218811ac1</guid><dc:creator>shabaz</dc:creator><description>Interesting idea! I googled and see that one of the popular PCB manufacturers offers a 3D print transparent resin service. I might give that a go sometime, it would be a great problem-solver, even if the display needed polishing to make it more transparent.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=3daac0a1-2ccc-49f6-afff-c0a12ed62365</link><pubDate>Mon, 23 Nov 2026 16:31:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:3daac0a1-2ccc-49f6-afff-c0a12ed62365</guid><dc:creator>shabaz</dc:creator><description>Hehe four lines are a luxury : ) This is the oldest character LCD I have here (24x2 line I believe), the PCB traces look hand-drawn. I should try to power it up one day.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=84eb09dc-1bc7-40b9-a746-c915513ee73d</link><pubDate>Mon, 23 Nov 2026 13:51:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:84eb09dc-1bc7-40b9-a746-c915513ee73d</guid><dc:creator>rsc</dc:creator><description>For many years I used a similar board with a 4x20 LCD and 3 buttons (Menu up, Menu down, Select). Lately, I&amp;#39;ve been using the Arduino Uno R4 WiFi with my phone as the display and control. I like to use enclosures with clear lids also to see status LEDs and such. I like the buttons you chose, I&amp;#39;ll have to get me some of those.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-vs-code-debug-setup-nxp-mcxn326-controller?CommentId=19297407-1632-41d2-b37a-2257f0fde661</link><pubDate>Mon, 23 Nov 2026 12:58:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:19297407-1632-41d2-b37a-2257f0fde661</guid><dc:creator>Qbit</dc:creator><description>Nice guide, Jan! Have you run into any quirks with SWO trace output over that 6 pin to 10 pin SWD conversion when stepping or running at higher clock speeds?</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=fcc731dd-51fc-4fac-8fcd-a7a16ac787fe</link><pubDate>Mon, 23 Nov 2026 12:19:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:fcc731dd-51fc-4fac-8fcd-a7a16ac787fe</guid><dc:creator>veluv01</dc:creator><description>Awesome! It&amp;#39;s well designed! I&amp;#39;m recently trying to work on some battery powered projects,so I’d prefer OLED screens with the SSD1309 controller. For the enclosures, I’d go with clear resin enclosures as they’re a little softer, so they’re less likely to accumulate scratches over time. Their transparency also lets the screen remain visible while still protecting it and the internal components remain visible too.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough?CommentId=00aac9dd-e2f2-44b2-8513-430189b9f355</link><pubDate>Mon, 23 Nov 2026 02:43:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:00aac9dd-e2f2-44b2-8513-430189b9f355</guid><dc:creator>kmikemoo</dc:creator><description>shabaz VERY NICE! I may have to rethink my early plan to use my enclosure stock. I&amp;#39;ve spent quite a bit of time looking this all over. I do not own a 3D printer so hacking on project boxes is what I do. I consider enclosures one of my strongest weaknesses. I&amp;#39;m rarely happy with the outcome. For the couple of time I&amp;#39;ve used menus, it&amp;#39;s just a simple state-machine. Four line display and four buttons; three options and a Back. Very basic. Select is execute.</description></item><item><title>Blog Post: The User Interface Dilemma: The Display Is Not Enough</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/the-user-interface-dilemma-the-display-is-not-enough</link><pubDate>Sun, 22 Nov 2026 23:27:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:ac8626b3-3d2a-45ce-99f3-4b8a3b32a80c</guid><dc:creator>shabaz</dc:creator><description>Introduction There must be a thousand and one LCD or LED display and button boards out there. Here is one more to add to that! It is a generic display/control board that could be easily added to microcontroller projects. There’s not a lot that I have done for this project so far, so I won’t write much. I’m actually more interested in what other people use, and how; off-the-shelf boards? Do you drill and create your own enclosures, or 3D-print? And what do you do regarding user menus? How do you code them? For example, for this project, there are six buttons, and clearly four of them can be used as soft-buttons that alter their purpose depending on what is indicated on the display, but there are also two buttons below the rotary control; I don&amp;#39;t know whether to use those as Back/Menu buttons, or perhaps to move the cursor left/right, or to adjust the rotary encoder speed. Circuit Unsurprisingly, the circuit consists of buttons and a display. Still, the buttons footprint can accommodate at least four different varieties of push-buttons, to use whatever you can get access to: • 6x6 mm Omron/Aratas B3F style tact buttons • Kailh Mute Mini microswitches • E-Switch 5.8 x 5.8 mm TL2203 series • E-Switch 7 x 7 mm TL2230 series The E-Switch options are also available in latching versions, so in theory one of the buttons could be a physical power button if desired. The display is a very low-cost ER-TFT2.25-1 TFT screen . It contains a ST7789P3 display controller. The resolution is 284 x 76, and there is a backlight. The rotary encoder is an Alps EC12E series part. I purchased EC12E24104A6 which is smooth-turning (no detents) but there are various other options, including ones with a built-in push-button which mine doesn’t have. The EC12E series is not particularly high quality, but these encoders are not as bad as they could be, and they are low-cost and easily available. For the full parts list and CAD files, see the Github repo . Printed Circuit Board I spent a bit of time compacting the board, so that it could potentially fit into a lot of different enclosures. The PCB size is 81 x 29 mm. In theory if the rotary encoder and a couple of buttons are not needed, perhaps that end could be hacksawed off, and the board should still work. As you can see in the render below, the connections to the board use normal 0.1” DIL pin headers, to attach to any desired microcontroller of choice (3.3V logic levels) - but alternatively there is also a 1mm pitch flat-flex cable (FFC) connector, because I don’t like making up 20-way 0.1” header cables if I can help it. For drilling the enclosure, all the buttons are on nice round-number dimensions, so that the holes can be marked out easily. However, there is another option, discussed next. Enclosure Front Panel If the enclosure has a removable front panel, then it could be swapped out with a PCB if desired. I decided to create a front panel PCB for Hammond 1593W enclosures (pictured above). These enclosures are of size 105 x 110 x 35 mm overall. The KiCad and Gerber files for this are in the GitHub repo, they could be used as-is, or modified for a different enclosure. The button holes are 5.6 mm diameter, which are suitable for “A30 button caps” which should fit genuine Omron B3F-1050 tact buttons with 2.4x2.4mm square actuator (see the photo). With different switches or caps, the holes in the front panel PCB will need to be changed. One more enclosure option: use a 3D printer : ) However I don’t have that option, hence the desire to make a front panel that fits commonly-available enclosures. The front panel has no screw-holes, so I’ll need to glue spacers onto the back of it, to attach the display board. I’ll use M2 spacers, 6mm tall, and that would be just right for the buttons and the rotary encoder. The TFT screen will need to be cushioned on foam 3.6 mm thick according to back-of-the-envelope calculations. Summary A small TFT screen with buttons was created using KiCad ( Github repo ). If it works (I have not built it yet!) I’ll use it with a Pi Pico microcontroller initially. The intended use-case is really any project that requires a display or controls beyond just an LED or two. Of course, the hardware is just one part of the system. A lot hinges on how well the software is implemented. What do you use as a user interface for your projects, both software- and hardware-wise? And what kinds of enclosures are your favorites? Any recommendations? Let me know! Thanks for reading.</description><category domain="https://community.element14.com/technologies/embedded/tags/B3F">B3F</category><category domain="https://community.element14.com/technologies/embedded/tags/lcd">lcd</category><category domain="https://community.element14.com/technologies/embedded/tags/ER_2D00_TFT2-25_2D00_1">ER-TFT2.25-1</category><category domain="https://community.element14.com/technologies/embedded/tags/tft">tft</category><category domain="https://community.element14.com/technologies/embedded/tags/EC12E">EC12E</category><category domain="https://community.element14.com/technologies/embedded/tags/1593W">1593W</category><category domain="https://community.element14.com/technologies/embedded/tags/ST7789P3">ST7789P3</category></item><item><title>File: NXP MCXN236 embedded C++ stepper motor microsteps</title><link>https://community.element14.com/technologies/embedded/m/managed-videos/152069</link><pubDate>Sun, 22 Nov 2026 15:52:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e2fe367a-7b91-402e-b17e-6ff9cf77ca03</guid><dc:creator>Jan Cumps</dc:creator><description>let a stepper take full steps and /4 microsteps silent video for element14 blog: https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-class-for-allegro-a4988-stepper-motor-controller controller: NXP MCXN236 Step...</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-class-for-allegro-a4988-stepper-motor-controller?CommentId=7c264c50-aa7b-452e-9a16-ed5cdb1d3dd3</link><pubDate>Sun, 22 Nov 2026 15:51:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:7c264c50-aa7b-452e-9a16-ed5cdb1d3dd3</guid><dc:creator>Jan Cumps</dc:creator><description>I&amp;#39;m using an oscilloscope to confirm that the correct number of steps are generated. My oscilloscope can only count what&amp;#39;s on screen. I created a pattern that fits the screen, when zoomed in to see the individual steps. That&amp;#39;s needed to be able to let the scope count them. 5 full steps forward at 300 pulses/s 20 /4 microsteps at 1200 pulses/s Both moves create the same movement in the motor, and last the same time. I made the oscilloscope trigger on any edge of the direction signal. That happens at the start of a move, so a good candidate for triggering. Then, zoomed the scope to show no more than one pulse train. I then check if the oscilloscope counts 5 and 20. youtube.com/.../geolPvZPVps</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-simple-stepper-motor-controller?CommentId=ae07ce26-356d-4f26-8d1a-5462803f9a3c</link><pubDate>Sat, 21 Nov 2026 21:25:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:ae07ce26-356d-4f26-8d1a-5462803f9a3c</guid><dc:creator>DAB</dc:creator><description>Nice post Jan.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-class-for-allegro-a4988-stepper-motor-controller?CommentId=c015bc5b-7ef2-4201-af37-b5825f3f8d66</link><pubDate>Sat, 21 Nov 2026 21:12:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c015bc5b-7ef2-4201-af37-b5825f3f8d66</guid><dc:creator>DAB</dc:creator><description>Nice post Jan. I always learn something when you post.</description></item><item><title /><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-class-for-allegro-a4988-stepper-motor-controller?CommentId=4938e960-5ff8-4c4b-92ea-95458ed1a8a0</link><pubDate>Fri, 20 Nov 2026 19:39:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:4938e960-5ff8-4c4b-92ea-95458ed1a8a0</guid><dc:creator>shabaz</dc:creator><description>Hi Jan, That is really useful. And very neat that it requires literally nothing other than adding that snippet into the CMakeLists.txt file!</description></item><item><title>Blog Post: EZ-MCXN: NXP MCXN326 C++ class for Allegro A4988 stepper motor controller</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/ez-mcxn-nxp-mcxn326-c-class-for-allegro-a4988-stepper-motor-controller</link><pubDate>Fri, 20 Nov 2026 18:57:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:eb9833a6-a7e2-4d92-8e97-825520687fcd</guid><dc:creator>Jan Cumps</dc:creator><description>In this post, I write a C++ driver class for the Allegro A4988 stepper motor driver IC. I designed it originally for the Raspberry Pico . Later ported it to TI&amp;#39;s MSPM0 . This time, adapted for NXP&amp;#39;s SDK. I&amp;#39;m testing it with an NXP MCXN236 microcontroller, on shabaz&amp;#39; EZ-MCXN dev board . This can be helpful to work with the stepper(s) of the Rise Of The Robots - Robotics Design Challenge . This little library has two duties: control the enable and microstep settings of the A4988 provide an object that makes enabling the driver easy and safe*. https://youtu.be/MpR-S1X__tY * the pattern I used is Resource Acquisition is Initialization (RAII). You enable the driver by declaring an object. Once the object is out of scope, the driver disables itself. This is useful for stepper motor designs. Leaving a driver enabled when the motor is not running can cause high currents, hot driver ICs and cooked motor coils. Configuration image source: Allegro A4988 datasheet (annotated) In this minimal configuration, the ~EN pin is used, and 3 MSx pins to configure microsteps. You &amp;#39;ll need 4 GPIO output pins. The driver code expects that all 4 are on the same GPIO port. Set the initial state of N_ENABLE to 1. It&amp;#39;s active low, and this takes care that the driver is disabled right at the initialisation part of your program. Check the Connections section below for wiring instructions. Main code This is the same program used in post EZ-MCXN: NXP MCXN326 C++ simple stepper motor controller , but now with support for the A4988 driver IC. // physical stepper IC driver import stepper_driver; // wakeup class import a4988_mcx; // hw driver class // mcxn pwm timer driver import mcx_pwm_stepper_driver; const uint32_t microstep_x = 1; // object to manage the a4988 IC used for motor1 using driver_t = a4988_mcx::a4988_mcx; driver_t driver1(BOARD_INITPINS_DRIVER_N_EN_PIN_PIN, BOARD_INITPINS_DRIVER_MS1_PIN_PIN, BOARD_INITPINS_DRIVER_MS2_PIN_PIN, BOARD_INITPINS_DRIVER_MS3_PIN_PIN, BOARD_INITPINS_DRIVER_N_EN_PIN_GPIO); // ... int main(void) { // ... // physical stepper IC driver driver1.init(); driver1.microsteps(microstep_x); // ... while (1) { stepper_driver::wakeup w(driver1); // A4988 is enabled as long as the while loop runs // ... step } } A4988 driver class Very similar to the Pico and MSPM0 version. Because this class only uses GPIO, I only need to change the GPIO SDK / API calls and datatypes. Also similar to the other 2: the class is derived from an abstract stepper_driver class I wrote earlier. It provides the basics for enabling and microstepping. class a4988_mcx: public stepper_driver::stepper_driver { public: a4988_mcx( uint32_t n_enable, uint32_t ms1, uint32_t ms2, uint32_t ms3, GPIO_Type *gpio) : n_enable_(n_enable), ms1_(ms1), ms2_(ms2), ms3_(ms3), gpio_(gpio) {} virtual inline bool init() override { return true; } virtual bool microsteps(unsigned int microsteps) override { unsigned int mode = true; switch (microsteps) { case 1: mode = 0x0000; break; case 2: mode = 0x0001; break; case 4: mode = 0x0002; break; case 8: mode = 0x0003; break; case 16: mode = 0x0007; break; default: // TODO check: assert(false); // develop check unsupported microstep mode = 0x0000; } put(ms1_, mode &amp;amp; 0b001); put(ms2_, mode &amp;amp; 0b010); put(ms3_, mode &amp;amp; 0b100); return true; } virtual void enable(bool enable) override { put(n_enable_, enable? false : true); } private: uint32_t n_enable_; uint32_t ms1_; uint32_t ms2_; uint32_t ms3_; GPIO_Type *gpio_; virtual void init_gpio() { // done by sysconfif } void put(uint32_t pin, bool set) { GPIO_PinWrite(gpio_, pin, set ? pin : 0U); } }; // class a4988_mcx Using the A4988 driver in your project The code is hosted on GitHub. You can add it to your CMake project by adding these snippets: # ... include(FetchContent) FetchContent_Declare(stepper_driver GIT_REPOSITORY &amp;quot;https://github.com/jancumps/stepper_driver_lib.git&amp;quot; GIT_TAG &amp;quot;origin/main&amp;quot; ) FetchContent_MakeAvailable(stepper_driver) FetchContent_Declare(mcx_a4988 GIT_REPOSITORY &amp;quot;https://github.com/jancumps/mcx_a4988_lib.git&amp;quot; GIT_TAG &amp;quot;origin/main&amp;quot; # prevent makefile execution (if any) SOURCE_SUBDIR = ) FetchContent_MakeAvailable(mcx_a4988) # .... target_sources(${CMAKE_PROJECT_NAME} # cpp modules PRIVATE FILE_SET cxx_modules TYPE CXX_MODULES FILES ${stepper_driver_SOURCE_DIR}/source/stepper_driver.cpp ${mcx_a4988_SOURCE_DIR}/source/a4988_mcx.cpp ) # ... target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE $ :-fno-use-cxa-atexit&amp;gt; # cpp flag $ :-fno-exceptions&amp;gt; # cpp flag $ :-fno-rtti&amp;gt; # cpp flag $ :-fcommon&amp;gt; # cpp flag $ :-fmodules-ts&amp;gt; # cpp flag: support modules # ... ) # ... ) CMake will resolve everything. No need to copy sources manually. Connections Most A4988 kits have digital pins on one side, power and motor connections on the other. Connect ~EN and MS1, 2, 3 to the GPIO pins configured in the first section of this post. Wire STEP and DIR to your step/dir control pins (see EZ-MCXN: NXP MCXN326 C++ simple stepper motor controller . In the attached project, DIR is GPIO4, pin16 and STEP is CTIMER3, MATCH 1). VDD and GND have to go to your microcontroller board. Vmot and its ground are the motor power, and should come from a capable power supply. I tied ~RST or ~SLP to VDD. Check the datasheet ( A4988 ) if you have questions about the function of those pins. When using the EZ-MCXN board, these are all connections to the board: A4988 EZ-MCXN CPU pin signal identifier comments ~EN J5.4 95 GPIO 1.3 DRIVER_N_EN_PIN initial high MS1 J5.5 97 GPIO 1.4 DRIVER_MS1_PIN MS2 J5.6 98 GPIO 1.5 DRIVER_MS2_PIN MS3 J5.7 99 GPIO 1.6 DRIVER_MS3_PIN ~RST +3.3V pull up ~SLP +3.3V pull up STEP J10.5 39 CTIMER3.MATCH1 STEP_PIN DIR J10.6 38 GPIO 4.16 DIR_PIN Elaborate example first speed 250 steps / s microsteps: no dir: forward steps: 900 full steps then pause and speed 125 microsteps / s microsteps: 4 dir: reverse steps: 3600 microsteps (900 full steps) then pause repeat while (1) { stepper_driver::wakeup w(driver1); pwm_stepper_driver1.set_dir(true); driver1.microsteps(1U); SDK_DelayAtLeastUs(1U, SystemCoreClock); pwm_stepper_driver1.set_speed(250); pwm_stepper_driver1.set_step(900); pwm_stepper_driver1.start_motor(); while (pwm_stepper_driver1.is_motor_running()) { __WFI(); // Enter low-power sleep mode; wake on timer interrupts } SDK_DelayAtLeastUs(25000U, SystemCoreClock); pwm_stepper_driver1.set_dir(false); driver1.microsteps(4U); SDK_DelayAtLeastUs(1U, SystemCoreClock); pwm_stepper_driver1.set_speed(125); pwm_stepper_driver1.set_step(3600); pwm_stepper_driver1.start_motor(); while (pwm_stepper_driver1.is_motor_running()) { __WFI(); // Enter low-power sleep mode; wake on timer interrupts } SDK_DelayAtLeastUs(25000U, SystemCoreClock); } VS Code project, including the C++ PWM driver from previous post: community.element14.com/.../ez_5F00_mcxn_5F00_stepper_5F00_fixedspeed_5F00_20261120.zip Thank you for reading MCXN stepper motor posts EZ-MCXN: NXP MCXN326 simple stepper motor controller EZ-MCXN: NXP MCXN326 C++ simple stepper motor controller EZ-MCXN: NXP MCXN326 C++ class for Allegro A4988 stepper motor controller Related posts .</description><category domain="https://community.element14.com/technologies/embedded/tags/EZ_2D00_MCXN">EZ-MCXN</category><category domain="https://community.element14.com/technologies/embedded/tags/MCXN">MCXN</category><category domain="https://community.element14.com/technologies/embedded/tags/a4988">a4988</category><category domain="https://community.element14.com/technologies/embedded/tags/nxp">nxp</category><category domain="https://community.element14.com/technologies/embedded/tags/MCXN236">MCXN236</category></item><item><title>File: NXP MCXN236 C++ stepper motor design with Allegro A4988 IC.</title><link>https://community.element14.com/technologies/embedded/m/managed-videos/152067</link><pubDate>Fri, 20 Nov 2026 14:46:00 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:8d704187-ba0b-4d5f-9229-5bf7fba57b34</guid><dc:creator>Jan Cumps</dc:creator><description>NXP MCXN236 C++ stepper motor design with Allegro A4988 IC. Constant speed. For element 14 blog</description><category domain="https://community.element14.com/technologies/embedded/tags/allegro">allegro</category><category domain="https://community.element14.com/technologies/embedded/tags/stepper%2bmotor">stepper motor</category><category domain="https://community.element14.com/technologies/embedded/tags/a4988">a4988</category><category domain="https://community.element14.com/technologies/embedded/tags/nxp">nxp</category><category domain="https://community.element14.com/technologies/embedded/tags/c_2B002B00_">c++</category><category domain="https://community.element14.com/technologies/embedded/tags/MCXN236">MCXN236</category></item></channel></rss>