Programming

Base boards with AVR chips

Anwaar Base boards use the newer UDPI protocol. As I understand this is a proprietary protocol from Microchip that is serial communications based. It's a single wire protocol which greatly reduces the pin count and space needed for direct access. Thanks to a python tool and community effort it is very easy to program udpi over a serial channel, allowing me to design the base boards to be programmable without need of any buttons or bootloaders simply by adding a usb-uart chip and a couple passives.

As of time of writing the Amulet A-TINY-15F and A-TINY-20F both have onboard usb-uart lines for programming so now external hardware is needed. Future releases of other families may not have an on board programmer/debugger/serial or even an mcu on the base board so programming would be different for those.

Arduino

All my testing and programming with arduino uses the wonderful megaTinyCore and DxCore by Spence Konde, visiting the repository will give you info on how to set up core and so much more valuable info. I love these cores because they are more based around the mcu itself and not any specific board. This gives great freedom to me as a board designer and makes it a little easier to understand how you are interacting with you mcu than through abstracted board names and pin numbers.

For those who know how to add a core to their arduino quick reference here is the board json:

http://drazzy.com/package_drazzy.com_index.json

If you need more guidance, follow the link here DxCore or megaTinyCore installation

Arduino Cores used for AVR based Anwaar boards:

These repositories contain a treasure trove of knowledge for working with the newer AVR chips and I highly recommend visiting them and browsing through their documentation.

Notes for coding in Arduino

  • Pins are referred to by their port number, example PIN_PB1
  • Fuse settings are in the drop down, most defaults are fine but for reduced power consumption I almost always use 1Mhz clock option.
  • You will need to select the appropriate MCU in the library:
    • A-TINY-15F and A-TINY-20F uses the ATTINY 1616
  • A-TINY-15F/20F use alternate ports for the serial debug. In arduino make sure you use Serial.swap(1); in your setup function if you are using the serial port.