RoadTest: BASYS MX3 Trainer Board
Evaluation Type: Development Boards & Tools
Did you receive all parts the manufacturer stated would be included in the package?: True
What other parts do you consider comparable to this product?: Arduino MKR IOT Bundle, Electronics Starter Kit for micro:bit
What were the biggest problems encountered?: There are a few things here and there, but nothing really worth mentioning. If there's one thing I had to point out, it would be the lack of online community presence. Then again, the typical use of this board might be in training centers or university labs - where students focus on completing their given assignments and move on. If that's the case, that would be a shame... :-/
Back in my undergraduate days, I programmed with 8051 and MC68HC11F1. I remember enjoying the experience immensely - it was the first time where I got to write code that interacted with the physical environment! There's something really gratifying about seeing code bring to life traffic light sequences, elevator model, linear actuator and the cable car model. I remember spending hours trying to perfect my assembly code, scanning over the list of assembly instructions, calculating the number of clock cycles needed for a delay, and then hand-writing the code on paper before keying them into the memory.
Ah... the good old days.
As much fun as it was, there were only a handful of microcontroller rigs available to be shared among all the students - and they were only accessible when the lab was open to us. But by then I was hooked. I tried scrounging for parts to build my own AVR microcontroller board, but that didn't really work out. I didn't know where to start, and I didn't know where to get support - what parts do I need? which programmer should I use? etc. Other things happened in life, and I just left it at that.
Years later, my adventures picked up again when I learned about Arduino - this cool microcontroller which I can easily program. Just connect the USB cable, load one of the example programs (sketches in Arduino-speak) and I'm ready to go. No need for a programmer at all! I got myself an Inventor's Kit; a simple kit, with a list of projects ranging from powering LEDs through PWM or shift registers, generating buzzer tones to running a servo motor. It was simple, but it opened up a new world for me. Since then, I have continued to spiral deeper down the rabbit hole: I got to explore and learn about the wonderful world of microcontrollers.
I went from Arduino Duemilanove to Breadboard Arduino to assembling custom AVR boards with ATtiny13, ATtiny 841, ATmega1284 etc. Thanks to the support I was able to find online (mostly guys at AVRfreaks) and countless hours down the drain, I learned a great deal about embedded systems. I got my hands on different MCU/boards over the years: TI C28x, Freescale HC12, STM32, NXP LPC, AVR32, ESP8266/ESP32 but never on a PIC32 board.
That is, until now...
When I found out about this road test, it tickled my interest and led me to research (i.e. google search) and read more about it. This is a trainer board designed by Digilent and what really impressed me was the course material that comes with this board. On top of the reference manuals, Digilent has provided the coursework material that introduces the fundamentals of embedded system design, and there is also a set of labs by Dr Greg Mason for a workshop at ASEE Conference 2018.
Basys MX3 costs USD99.00 on Digilent website as Basys MX3: PIC32MX Trainer Board for Embedded Systems Courses. The name tells you that Digilent positioned this an educational product - an MCU trainer board targeted at initiating engineering students to the world of embedded systems. Also on offer is the Basys MX3 Lab Bundle at USD59.00, which includes components used in the coursework:
Having said that, even without the Lab Bundle I must say that Basys MX3 is plenty packed full of goodness on its own. Featuring a PIC32 MCU (PIC32MX370F512L) with clock speeds up to 96MHz (onboard 8 MHz oscillator), 512 KB + 12KB Program Flash Memory, 128KB Data Memory, you have one beefy MCU to do your microcontroller-ly stuff. There's only so much you can do with the MCU alone - and the Basys MX3 equips the MCU with a wide range of peripherals:
- Slide switch array
- Directional push buttons
- Potentiometer analog input
- Line out jack
- 2x Servo pinout
- Stepper or 2DC motor terminal block
- LED array
- Seven segment LED Display
- 2x16 LCD Display
- RGB LED
- IrDA module
- 2x Standard PMod ports
|Memory||- 4MB flash|
|Sensor||- 3-axis 12bit accelerometer (I2C)|
|Probing||- Analog Discovery 2 (on the back of the board)|
If you're like me, you might be wondering what PMod ports are. Digilent makes boards that extends the capabilities of embedded control boards quickly and painlessly. Need WiFi? You're covered. Need to talk to a CAN bus? You're also covered. Judging by the code examples and guides on the resource center, engineers can get their prototype ready quickly. This is very much like the Arduino shields or the Raspberry Pi hats. You can browse other Pmod Boards on their site.
This board allows engineering students to go right into the meat of things - to learn the theories and implement them in a real system. No need to fiddle with jumper wires, shorting the Vcc pins and smelling burned plastic - none of that mess. The reference manual walks through the connections and explains how the board is set up, and how it should be used. Awesome.
This bad boy has a lot going for it.
The course materials covers an extensive range of topics which are fundamental to an engineering student. There are 7 units, each of them accompanied by lab exercises.
Whoever came up with the course material - you have my utmost respect and admiration. Aside from the very comprehensive notes (and if that's not enough, there's the appendix section + numerous links to Wikipedia articles), the lab exercises guides the student step-by-step through the engineering design, and prompts questions which reinforces understanding on the subject matter.
I must admit that I wasn't able to go through all the units as they are quite verbose (I think some of the paragraphs are better understood as diagrams), but I did enjoy reading them. There is also the issue of not having the lab bundle (*winks at Digilent*) and my stepper motor wires don't fit into the stepper motor terminal block. So yea... excuses.
Having said this, I should point out that the tutorial is somewhat dated, and the MPLAB X IDE setup instructions are no longer compatible with the instructions. the instructions on plib.h threw me off quite a bit - since it's no longer supported in the current MPLAB X IDE version. I get the feeling that if the instructions weren't so verbose - I might have had a smoother experience setting up the development environment. Reading and trying to filter what's obsolete and what's relevant left me very confused indeed.
This is likely not an issue for an experienced MPLAB C IDE user, but for engineering students who are new - it can be quite a distraction. I imagine that in a university the lecturer would have got this covered, but for the individual student who bought this board on his/her own initiative, some self-research (google) will be required.
Also, some of the links to resources on other websites are outdated and broken. (This is just a minor issue, and a fact of life when you link to a website resource out of your control.)
Digilent has provided the Arduino core to smooth the transition for those who started with Arduino. This would be useful for those who don't want to install and maintain another IDE on their computers. The installation is rather straightforward - we need to include Digilent's board manager URL and then install Digilent core using the Boards Manager.
Board manager URL: https://s3-us-west-2.amazonaws.com/digilent/Software/Digilent_Core/package_digilent_index.json
I installed the core hoping to see some example codes for Basys MX3 in Arduino, but most of the example codes are general for Digilent boards or just Arduino in general.
Trying to upload a simple sketch, I realised that the board wasn't detected by the IDE. Switching to the UART port didn't help either:
Clearly I need a bootloader for this to work - but the instructions for that seem to be missing...
Digging a little deeper into the package directory, I find this within the Board_Defs.h:
/************************************************************************/ /* */ /* Board_Defs.h -- Board Customization for Digilent chipKIT Uno32 */ /* */ /************************************************************************/ /* Author: Gene Apperson */ /* Copyright 2011, Digilent. All rights reserved */ /************************************************************************/ /* File Description: */ /* */ /* This file contains the board specific declartions and data structure */ /* to customize the chipKIT MPIDE for use with the Digilent chipKIT */ /* Uno32 board. */ /* */ /* This code is based on earlier work: */ /* Copyright (c) 2010, 2011 by Mark Sproul */ /* Copyright (c) 2005, 2006 by David A. Mellis */ /* */ /************************************************************************/ /* Revision History: */ /* */ /* 10/06/2011(GeneA): Created */ /* 11/28/2011(GeneA): Moved data definitions and configuration */ /* functions to Board_Data.c */ /* 11/29/2011(GeneA): Moved int priority definitions to System_Defs.h */ /* Feb 17, 2012 <KeithV> Added PPS support for MZ devices */ /* */ /************************************************************************/
It almost seemed as if the Arduino support for Basys MX3 is still under construction... Without examples or the ability to upload my sketch, there's really not much left to do here.
Let's move on, shall we?
This is probably the recommended approach if you want to go through the course material. We need to install 3 components:
MCC reminds me of STM32 Cube, which offers a GUI way to set up the MCU. My first impression is that it's slow, and the list of control registers are unnecessarily long (imagine every bit of option in the MCU enumerated as a single list. I took the liberty of recording a video of me scrolling. See below.) Maybe that's a bug on my install, or that I have yet to familiarise with the interface.
Also, when a resource is added, it disappears from the Device resources list, so I wasn't able to go back and modify it. It was only later that I found out the resource have moved under the Project Resources list (which wasn't displayed for some reason, until I switched to a different monitor), so that was on me. Needless to say, I didn't do much with MCC - but I think it deserves a second exploration, now that I can find my configured resources. Haha.
Caption: scrolling the list left me with a strong impression, so I'm sharing the experience with you all.
As of MPLAB X IDE v5.25, starting a new project is very similar to what you would find on other IDEs. I've added pictures to show you what it looks like:
1) File > New Project > Standalone Project
2) MCU is PIC32MX370F512L:
3) Debugger is Basys MX3:
4) Compiler is X32:
5) Give your project a name:
6) Once you have your project, you need to add a .c source file where you define the main() entry point.
Right-click on the project : New > xc32_newfile.c.
Honestly, I'd rather they include a boiler plate main() when I create a new project. Odd design choice.
7) Within the file, include xc.h for the MCU header and add in the main() entry point. You're all set!
If you want the board to run at 80MHz, there's some additional fiddling of the control registers. Luckily, you can just copy this settings from the example config_bits.h, and add to your project.
Unless we're happy flicking bits in the MCU registers, it might be easier to work on a higher abstraction level. Digilent provides the Basys MX3 Library Pack which makes our coding efforts a lot easier. LibPack provides the wrappers to control the components on the board:
For example, if I want to control LED3, this is what it would look like, using bit manipulation:
// Configure LED3 as digital output. TRISAbits.TRISA3 = 0; // set LED3 output to high LATAbits.LATA3 = 1;
With LibPack, the code becomes more humanly readable:
// Guess what this code does? LED_Init(); LED_SetValue(3,1);
Using the wrapper library is very simple. Just right-click on the source/header folder to add the library files you need:
Even if you don't plan to use this library, I highly recommending downloading it if only as a reference implementation. You can dive into the source to see how the functions are implemented:
If you're in the mood for amateurish videos, I have some here depicting stuff I did with the board:
...and now I can say that I have programmed a PIC32 microcontroller. Truth is, if you're programming in C, it's pretty much the same regardless of the platform you write code on. That is, until you have to manipulate registers directly - that's when you need to refer to the datasheet. The datasheet is quite readable and is well-structured. Also, I find it interesting how all the bitfields in the control registers are organised in structs.
In AVR8, to set/clear pin 3 of PORTB, we would write
PORTB |= (1<<3); // set PORTB &= ~(1<<3) ; // clear
For PIC32, we would write
LATAbits.LATA3 = 1; // set LATAbits.LATA3 = 0; // clear LATA |= (1<<3); // similar style to AVR8 also valid
I'm not used to the bitfield style of programming, but I can see it's usefulness in preventing programming errors.
MPLAB X IDE is a mostly painless affair - sure it has its own idiosyncracies, but the same goes for every other embedded IDEs out there. I wish it allowed multi-line editing like VS code, but other than that it does the job pretty well. I could write code, flash the MCU, debug the MCU... that's really all I expect it to do. So thumbs up on that.
In the past I have worked with companies that package training courses for professional engineers using Arduino Uno/Mega boards, and that's perfectly ok. The clones probably cost about USD3-10 and they are perfectly disposable should one accidently burn the board. In comparison, burning USD99.00 might not be a good idea. Not sure about other universities, but from my experience - the smell of burnt plastic is really not that uncommon. (That's probably why the lab officer had to really strengthen the heck out of the microcontroller rigs - probably with lots of buffers/optocouplers/fuses everywhere. Thank and sorry Jim.)
However, keep in mind that the Arduino boards are really barebone boards - we need to assemble and re-assemble the parts for every different lab exercise that we work on. And naturally, there will always be students who missed a step or made a mistake - requiring the trainer to troubleshoot their boards. In a class of 20-30 people, that translates into a lot of wasted time - time that could otherwise be devoted to learning outcomes.
The Basys MX3 is a self-contained trainer board, where the average student don't need to fuss around with wiring components on a breadboard, screwing around with soldering, or setting up their own motor driver. (Not saying that they aren't important, but they should be taught in a different subject.) This thing is packed with modules that are very relevant in the engineering curriculum - aside concepts of microcontroller programming, general I/O, and serial/parallel communication protocols, this is a board where a student can learn and apply concepts of state machines, real-time, control systems and signal processing - I think these are concepts which may not be vital for the average hobbyist maker, but are critical for engineering students to understand. And this is where I think Basys MX3 shines.
I may on occasion be tempted to say that Digilent should include BLE or WiFi since it's the age of IoT, but the average engineering student can always look at PMod expansion, or get a more IoT-oriented development board if they need to do IoT at a later stage. Adding those from the get-go would just clutter up the board and serve to distract from the fundamental knowledge of engineering. I think Basys MX3 is best kept as is.
Seeing me and my fellow road testers sing praise of the Basys MX3, I can't help but wonder: this is a product that is on the market since 2017 - why hasn't it gain any online presence? Compared to Micro:bit, there is barely a blip of search activity for the term "Basys MX3".
Judging from the Github repository, not much has happened either.
Is this a consequence of Digilent mostly aiming to sell into learning institutions? Or perhaps the offered course materials are too advanced for the average maker out there? Do you think Digilent should add more example code to support Basys MX3 development on Arduino?
Credits to where they are due:
Hi ytan ,
I found your roadtest report really interesting and packed full of information that either reinforced my understanding or explored areas of the board I knew nothing about. Shame about the Arduino…
I guess ytan you made some interesting points. The problem these days with MCUs is too many differing platforms. Other than Raspberry Pi x and Arduino/clones, all of them lack the necessary following to…
The Arduino implementation seemed to me like an afterthought. Judging from the course materials, I believe Digilent is targeting education at the university level. Having said this, I can…
There's a monthly meetup going on at a place where I go to that looks into MicroPython for ESP32 boards. I have been eyeing on them for a while now, and might go check them out in the coming months... or I might prepare a demo for another ESP32 meetup that I go to. We'll see.
I suppose this might be a worthy exercise for engineering/comsci students. What kind value do you see in porting MicroPython to Basys MX3 in the spheres of education?
May I suggest you look at this:
The quote above comes from https://en.wikipedia.org/wiki/MicroPython . This code be a way to get a full language on the board and allow interesting prototype by non-C programmers. Just an idea, but if I had this I would attempt.
I agree, the maker market is really spoiled for choice these days. Not that I'm complaining.
Basys MX3 is a trainer board geared towards education. To an engineering trainer/lecturer, this is a system that is wired up and ready to go + the quality reference course material that can be used to develop further lab exercises - robot kinematics, fuzzy-logic control, etc.
The same just can't be said for Arduino and Raspberry Pi, even with the combination of shields/hats out in the market. Are you aware of other platforms out there with similar offerings? Do let me know.
To answer your question: Using this board in a project probably wouldn't do it justice. It would be like using a power drill to as an eggbeater. Would it work? Yes, but it wouldn't do it justice.
What then, would be the fate that befalls this trainer board of mine (yes, mine!)? Most likely, I would use it for proof-of-concept prototyping and quick verification. The LCD screen, analog rotary knob, motor drivers, servo pins, LED/switch arrays all make for a very convenient testing platform.
The Arduino implementation seemed to me like an afterthought. Judging from the course materials, I believe Digilent is targeting education at the university level. Having said this, I can also imagine students at high school or even vocational schools benefiting from the higher level abstraction found in the Arduino ecosystem.
I have little knowledge on how these trainer boards are marketed - is a two year-old product considered mature, or still in its infancy? Is Digilent just getting started with the marketing efforts? I don't know. Adopting a standard trainer board can facilitate collaboration between universities, and Basys MX3 is a good candidate - it is low cost, and is worth a great deal of lab assignments that could span multiple semesters.
However, someone needs to facilitate the buildup of an online presence for community and support... and this responsibility is likely to rest in the hands of Digilent. Perhaps someone from Digilent lurking around element14 can comment? :-)
I guess ytan you made some interesting points. The problem these days with MCUs is too many differing platforms. Other than Raspberry Pi x and Arduino/clones, all of them lack the necessary following to get a solid community of support. PIC used to be heavy back a few years ago if I remember correctly, but lost its edge with the mergers of several companies. In fact these mergers may have lessen some good MCUs out there. Maybe the plan is to kill off some by the acquiring companies. Thinking about this, why have many platforms in one mega company. Where the following is ardent, they survive based on the fanaticism of the fans. We will have to see where this one goes. My question for you: Would you be inclined to use this board beyond training in a project or two? And how would the reasoning go to switch?
Hi ytan ,
I found your roadtest report really interesting and packed full of information that either reinforced my understanding or explored areas of the board I knew nothing about. Shame about the Arduino interface as I skipped that bit and so it would have been nice to know what it actually was capable of....maybe I'll have a look while off work at Christmas.
I found your perceived lack of user base interesting (and probably true) and I also cannot work out why that is. This is a great 'go to' board for microcontroller code development and is far more capable than many similar boards. Perhaps it simply launched at the wrong time and with too little advertising?