Overview
The ProductivityOpen P1AM is an automation platform compatible with Productivity1000 Series I/O modules, P1AM Series shields, and Arduino MKR format shields.
P1AM-100: This board uses the SAMD21G18 Microcontroller like the Arduino MKRZERO and other similar boards. It can be programmed in C/C++ using the Arduino IDE.
P1AM-200: This board uses the ATSAMD51P20 Microcontroller like the Adafruit Grand Central M4. It can be programmed in CircuitPython using a compatible text editor like Microsoft VS Code or in C/C++ using the Arduino IDE.
Arduino Getting Started
Arduino IDE Setup
- Follow the Arduino IDE Setup process to install the board core and library in the Arduino IDE.
Select the Board and Port
- Connect the P1AM-CPU to the PC using a microUSB cable.
- Select the board: Tools > Board > P1AM-100 or P1AM-200.
- Select the port: Tools > Port > P1AM-100 or P1AM-200.
Select and Upload Blink Program
- Select the Blink program: File > Examples > Basics > BlinkThis program will blink the yellow LED.
- Upload the program by clicking on the round icon with a right arrow on the top bar.
- After the program has been uploaded, the yellow LED will blink on and off every second.
P1AM Library Examples and API
- The P1AM Library examples are located in File > Examples > P1AM
- It is recommended to take a look at the basic examples to become familiar with the
P1AM library API to control module I/O
NOTE: The P1AM library only controls the module I/O(right side).
CircuitPython Getting Started
To program in CircuitPython only a text editor is required. It is recommended to use Microsoft VS Code for programming in CircuitPython. Other supported IDEs can be found here.
Updating the Board Libraries
The P1AM-200 arrives will all libraries needed to use the board. However, it is recommended to update the libraries to the latest version.
- Connect the P1AM-200 to your PC using a microUSB cable.
- A new drive should appear on your PC called CIRCUITPY.
- To update the libraries grab the latest bundle from here.
- Extract the contents of the bundle to the root directory on the CIRCUITPY drive.
- NOTE: Before extracting the bundle on first-time setup, you must delete the following from your CIRCUITPY drive:
- lib folder
- examples folder
- bundle.txt
The CircuitPython Drive
CircuitPython boards will enumerate as a USB Mass Storage Device named CIRCUITPY. This drive can be viewed with your operating systems file explorer and files can be opened in any supported text editor.
Below are some important files and directories and their purpose.
- code.py: This is the program that CircuitPython will execute on power-up.
- lib: This directory contains libraries that can be imported into the application. Any downloaded library source should be placed in this folder to be used.
- examples: This directory contains all example programs for the included libraries.
Serial Console
CircuitPython boards will enumerate as a USB Serial Device. This can be used to interface with running programs or use the device with the REPL command line.
Below are some common keyboard commands to interact with the REPL.
- CTRL + C - Stop the current executing program. Hit any key to enter the REPL.
- CTRL + D - Soft reboot the board and start running code.py.
Arduino IDE Setup
Important Note: This installation process will require an internet connection. If you need an alternative install method for PCs not connected to the internet or with other restrictions, please follow the directions at this link.
Install the most recent Arduino IDE version 2.x.x or later. Arduino website.
Install From Library Manager
- In the Arduino IDE go to Sketch > Include Library > Manage Libraries
- Type P1AM into the search box
- Click the install button in the P1AM library box
Manual Library Install
- Click the green button that says Clone or download on this repository page
- Select Download ZIP
- In the Arduino IDE go to Sketch > Include Library > Add .ZIP Library
- Navigate to the ZIP file that you downloaded in the window that opens
Boards Manager Install
- Start the Arduino IDE and select File > Preferences
- Enter https://raw.githubusercontent.com/facts-engineering/facts-engineering.github.io/master/package_productivity-P1AM-boardmanagermodule_index.jsoninto the Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
- Open the Boards Manager from Tools > Board > Boards Manager
- Type P1AM into the search box and install the P1AM platform
- Select Tools > Board > P1AM-100 or P1AM-200
- Go to Tools > Portand select the COM Port for your P1AM-CPU
P1AM-100 Driver Installation
If you are having issues with the USB being discovered or not showing up correctly, installing the device driver may fix the issue.
- Download the driver installer here.
- Extract the .zip file to your PC.
- Unplug any P1AM-100 systems from your PC.
- Run P1AM-100_install.bat and follow the prompts to install the driver.