Bootloader programmed using the SEGGER J-FLASH with the BIN file from Sparkfun SAMD21 Dev board bootloader. I will have to create my own custom one in the future. This will require using ATMEL studio which I do not like to use.
After bootloader is programmed it can be seen as a USB port in the Arduino IDE. Set the board type to Sparkfun SAMD21 Dev and select the detected USB. The variants file has to be modified to disable the SER5 handler.
Test software runs the following
- Qwiic I2C OLED display
- Reset Button and RX LED
- SerialUSB.read and write
- External SPI magnetic encoder
- On-board SPI magnetic encoder
- EEPROM I2C Read and write
- Free running 6x Sequential ADC via DMA
- SPI Read and write registers
- Fault and enable
- 3x Current Monitor into ADC
- PWM x3 Mode (not x6 Mode yet)
- RS485 TX and direction (RX not tested yet)
- On-board MOSFET Temperature sensor into ADC
- Battery voltage Monitor into ADC
Features left to test
- Spare UART TX and RX
- RS485 RX
- FAN/Servo PWM output
- External analogue temperature input
Full operation test
On-board magnetic encoder reads the diametric magnet connected to the motor shaft. Motor position is controlled from the USB using Saddle sinusoidal control. Vital information displayed on the OLED display.