The Arduino Zero is the first platform we have supported that has many (more than we knew of) PCBs with the same CPU setup. So we had to make some additions to our BASICtools. We added the ability to support multiple board types for a CPU, and give the user an option to select that. Follow this link to support BASIC on you Arduino Zero.

In addition all those boards seem to rename their pins different from the Atmel/Microchip pin definition. To support that we added an "auto" include function that will #include a register and pin definition file that is board specific.

Auto include menu option

With that auto option a #include file will be added before the user source BASIC program and then pre-processed,

Chosen include file

And that include will have a #define set according to the Arduino Zero board type chosen. To make it easy to expand these options, there is a table defined in the targets.tcl file which can be edited by the user.

#  name in board menu       #define used in SAMD21.bas
set Zero_PCBs {
    "Itaca uChip"           "SAMD_UCHIP"    
    "Protoneer Nano"        "SAMD_PROTONEER" 
    "Robotdyn M0"           "SAMD_ROBOTDYN_M0"
    "MKR Zero"              "SAMD_MKRZERO" 
    "Feather M0"            "SAMD_FEATHER_M0" 
    "generic"               ""              

One of our users had a Feather M0 board and sent us a pins_feather.bas file to define its pins. We added that option to the table above and to the SAMD21.bas file below.

  #include "pins_MKRzero.bas"       '   MKR zero
#elif defined SAMD_ROBOTDYN_M0
  #include "pins_RobotdynM0.bas"    '   Robotdyn M0
#elif defined SAMD_UCHIP
  #include "pins_uChip.bas"         '   Itaca uChip
#elif defined SAMD_PROTONEER
  #include "pins_Protoneer.bas"     '   Protoneer Nano
#elif defined SAMD_FEATHER_M0
  #include "pins_feather.bas"       '   Adafruit Feather M0
  #warning  -- no pin file defined

So if you've got an Arduino Zero board we don't have, feel free to send us a pin file and we will add that to BASICtools.

We also took advantage of this to automatically #include the Stamp_pins file for our ARMstamp.

Next Post Previous Post