Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[-]
Slideshow

[-]
Stats
» Members: 764
» Latest member: Peiler
» Forum threads: 593
» Forum posts: 3,155

Full Statistics

Control system
#31
After installing the required Adafruit and Arduino board definitions, the main work involved in getting the SHADOW-MD sketch to compile was tracking down a version of the USB library that someone had ported to the M4 and using that instead of the standard one.

https://github.com/gdsports/USB_Host_Library_SAMD

The easiest way to do this I found was to rename all the required files (and every mention of the file names inside the library) and include it from the local project folder, otherwise it conflicted with my already installed USB library used by the USB shield, etc.

Code:
#include "m4_PS3BT.h"
#include "m4_usbhub.h"


Also, configuring the SERCOMS was a bit tricky. These can be SPI, I2C, UART, etc. I had to figure out how to configure the extra ones which by default were not setup to be extra UART ports. I have not tested if these work yet, but they compile without error.

Code:
//D18-TX, D19-RX
Uart Serial2 (&sercom4, 19, 18, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void SERCOM4_Handler()
{
 Serial2.IrqHandler();
}

//D16-TX, D17-RX
Uart Serial3 (&sercom1, 17, 16, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void SERCOM1_Handler()
{
 Serial3.IrqHandler();
}

//D14-TX, D15-RX
Uart Serial4 (&sercom5, 15, 14, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void SERCOM5_Handler()
{
 Serial4.IrqHandler();
}

I have not found a working hardware servo library, but I suspect you don't need this with the adafruit PWM boards.

There are probably a few other tweaks I have forgotten.

Martin
Reply
#32
Thanks for that! It will help immensely. I am about to delve deeper. Almost done with my BuzzSaw.

Eebel
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)