Skip to content

Commit

Permalink
Add support for P1AM-200, P1-08ND-TTL, and P1-08TD-TTL
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamCummick committed Nov 27, 2023
1 parent 8edef52 commit 84f508c
Show file tree
Hide file tree
Showing 37 changed files with 2,046 additions and 2,057 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
105 changes: 43 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
ProductivityOpen P1AM-100 [![Build Status](https://github.com/facts-engineering/P1AM/actions/workflows/main.yml/badge.svg)](https://github.com/facts-engineering/P1AM/actions)
ProductivityOpen P1AM [![Build Status](https://github.com/facts-engineering/P1AM/actions/workflows/main.yml/badge.svg)](https://github.com/facts-engineering/P1AM/actions)
============================

The ProductivityOpen P1AM-100 is an automation platform compatible with Productivity 1000 Series I/O modules, P1AM Series shields, and Arduino MKR format shields. It can be programmed using the Arduino IDE. The board uses the SAMD21G18 Microcontroller like the Arduino MKRZERO and other similar boards.
### Product Description
The ProductivityOpen P1AM is an automation platform compatible with Productivity 1000 Series I/O modules, P1AM Series shields, and Arduino MKR format shields.
- P1AM-100: The board uses the SAMD21G18 Microcontroller like the Arduino MKRZERO and other similar boards.
- P1AM-200: The board uses the SAMD51P20 Microcontroller like the Adafruit Grand Central and other similar boards.

In depth information on the P1AM family and Productivity 1000 Modules can be found on the reference page here:
[P1AM-100 Documentation](https://facts-engineering.github.io/)
### Hardware - P1000 I/O Modules

Productivity Series modules offer several types of industrial grade I/O
- Analog and Temperature Inputs
Expand All @@ -13,60 +15,17 @@ Productivity Series modules offer several types of industrial grade I/O
- Discrete Outputs and Relays
- Specialty Modules

The P1AM Library provides a simple interface for controlling P1000 Modules
```C++
P1.writeDiscrete(HIGH, 1, 2); //Turn slot 1 channel 2 on

float temperature = P1.readTemperature(2, 3); //Return temperature read from slot 2 channel 3
```

The P1AM-100 can be purchased on the [Automation Direct Webstore](https://www.automationdirect.com/adc/shopping/catalog/programmable_controllers/open_source_controllers_(arduino-compatible)/productivityopen_(arduino-compatible)/controllers_-a-_shields/p1am-100)

Productivity 1000 Series Modules can be purchased on the [Automation Direct Webstore](https://www.automationdirect.com/adc/shopping/catalog/programmable_controllers/productivity_series_controllers/productivity1000_(stackable_micro_plc))

# P1AM-100 Installation #
>Install the Arduino IDE version 1.8.7 or later. We recommend the current version on the [Arduino website](https://www.arduino.cc/en/main/software).
After you have installed the Arduino IDE you will need to follow one of the library install methods and the boards manager install instructions to get started with the P1AM-100

### P1AM-100 Library Install ###

**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

***OR***

**Install From Zip**
- 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 Arduino and select `File > Preferences`
- Enter `https://raw.githubusercontent.com/facts-engineering/facts-engineering.github.io/master/package_productivity-P1AM-boardmanagermodule_index.json` into 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-100** platform
- Select `Tools > Board > P1AM-100`
- Go to `Tools > Port` and select the COM Port your P1AM-100 is plugged into

Boards manager link: `https://raw.githubusercontent.com/facts-engineering/facts-engineering.github.io/master/package_productivity-P1AM-boardmanagermodule_index.json`
### Hardware - P1AM Shields
ProductivityOpen offers 3 types of industrial shields and a prototyping kit.
- P1AM-ETH
- P1AM-SERIAL
- P1AM-GPIO
- P1AM-PROTO

### Driver Installation ###
For Windows users it is required that you install a device driver for the P1AM-100
[Download driver installer here](https://github.com/facts-engineering/P1AMCore/raw/master/drivers.zip)
### Base Controller
The P1AM Base Controller is the chip that directs communcations between the microcontroller and the P1000 Modules. A P1000 Series power supply or external 24V supply is required to power the Base Controller and modules.


# Getting Started #
The P1AM-100 library comes packed with examples to help you get started.
The examples can be found in the Arduino IDE under `File > Examples > P1AM-100`

The **Basic** category contains the best examples to get started with the library and P1000 Modules.
The other categories contain examples that further explore the functionailty of the P1AM-100.

# Base Controller #
The P1AM Base Controller is the chip that directs communcations between the SAMD21 and the P1000 Modules. A P1000 Series power supply or external 24V supply is required to power the Base Controller and modules. The communications with the SAMD21 are SPI based and use 5 total pins. Pins 8, 9 and 10 can be shared with other SPI devices. **A3 and A4 must not be used on any shield if using the base controller functionality of the P1AM-100**
The **P1AM-100** communications with the SAMD21 are SPI based and use 5 total pins. Pins 8, 9 and 10 can be shared with other SPI devices. **A3 and A4 must not be used on any shield if using the base controller functionality of the P1AM-100**

| Pin | Function |
|:---:|:--------:|
Expand All @@ -76,18 +35,40 @@ The P1AM Base Controller is the chip that directs communcations between the SAMD
| A3 | CS |
| A4 | ACK |

The **P1AM-200** Base Controller pins are all internal. No header pins are used for IO module communications.

# Shields #
In depth information on the P1AM family hardware can be found on the reference page here: [ProductivityOpen Documentation](https://facts-engineering.github.io/)

The P1AM-100 uses the Arduino MKR format header. The pins are 3.3V tolerant only, so do not apply any 5V signals.
Hardware can be purchased on the [Automation Direct Webstore](https://www.automationdirect.com/adc/shopping/catalog/programmable_controllers/productivity_open_(arduino-compatible))

Industrial rated shields for the P1AM-100 can be purchased from [Automation Direct here](https://www.automationdirect.com/adc/shopping/catalog/programmable_controllers/open_source_controllers_(arduino-compatible)/productivityopen_(arduino-compatible)/controllers_-a-_shields/).
## P1AM Library

Please read through the Base Controller section above to determine if your shield pinout will work properly. For example, the Arduino MKR RGB Shield is not compatible with the P1AM-100 as it uses pins A3 and A4.
### Description

The P1AM Library provides a simple interface for controlling P1000 Modules.
```C++
P1.writeDiscrete(HIGH, 1, 2); //Turn slot 1 channel 2 on

float temperature = P1.readTemperature(2, 3); //Return temperature read from slot 2 channel 3
```
### Installing the Library

# Additional Resources #
>Install the Arduino IDE version 2.0.0 or later. We recommend the current version on the [Arduino website](https://www.arduino.cc/en/main/software).
- Use Arduino's Library Manager to install the library. `Tools > Manage Libraries`
- Type **P1AM** into the search box and click the install button

### Installing the Board

- Use Arduino's Boards Manager to install the board. `Tools > Board > Boards Manager`
- Type **P1AM** into the search box and click the install button

### Getting Started
Documentation can be found on the [ProductivityOpen Documentation](https://facts-engineering.github.io/). The website has information that includes the hardware documentation, library API, and code snippets.

The P1AM library also comes packed with examples that can be found in the Arduino IDE under `File > Examples > P1AM`.

## Additional Resources
[ProductivityBlocks Graphical Programming from Automation Direct](https://github.com/AutomationDirect/ProductivityBlocks)

[Automation Direct P1AM Customer Forum](http://go2adc.com/p1am)
Expand All @@ -98,4 +79,4 @@ Please read through the Base Controller section above to determine if your shiel

[Arduino Forum](https://forum.arduino.cc/index.php)


[Arduino Support Discord](https://discord.com/invite/jQJFwW7)
8 changes: 4 additions & 4 deletions examples/Basic/AnalogInput/AnalogInput.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/AnalogOutput/AnalogOutput.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
To confirm the analog output value you can use either a P1 analog input module or a multimeter.
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/ChannelLabels/ChannelLabels.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
| A || O || O |
| M || T || T |
| - || || |
| 1 || 0 || 0 |
| 0 || 1 || 2 |
| 0 || || |
| C || 0 || 0 |
| P || 1 || 2 |
| U || || |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/DiscreteInput/DiscreteInput.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/DiscreteOutput/DiscreteOutput.ino
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/DiscretesBitmapped/DiscretesBitmapped.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
| A || O || O |
| M || T || T |
| - || || |
| 1 || 0 || 0 |
| 0 || 1 || 2 |
| 0 || || |
| C || 0 || 0 |
| P || 1 || 2 |
| U || || |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
Note: This example uses hexadecimal formatted numbers, though any number format
Expand Down Expand Up @@ -52,7 +52,7 @@
readDiscrete function.
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/PrintModules/PrintModules.ino
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
| A || O || O || O || O || O || O || O || O || O || O || O || O || O || O || O |
| M || T || T || T || T || T || T || T || T || T || T || T || T || T || T || T |
| - || || || || || || || || || || || || || || || |
| 1 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 |
| 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 0 || 1 || 2 || 3 || 4 || 5 |
| 0 || || || || || || || || || || || || || || || |
| C || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 0 || 1 || 1 || 1 || 1 || 1 || 1 |
| P || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 0 || 1 || 2 || 3 || 4 || 5 |
| U || || || || || || || || || || || || || || || |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Basic/ReadTemperature/ReadTemperature.ino
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Implementation/START1_LED/START1_LED.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
| A || A || - |
| M || M || C |
| - || - || O |
| G || 1 || M |
| P || 0 || B |
| I || 0 || O |
| G || C || M |
| P || P || B |
| I || U || O |
| O || || |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
This example requires an LED (not provided in the start kit) attached to pin 6 of the P1AM-GPIO terminal block.
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Implementation/START1_LOOPBACK/START1_LOOPBACK.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
| A || - |
| M || C |
| - || O |
| 1 || M |
| 0 || B |
| 0 || O |
| C || M |
| P || B |
| U || O |
| || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
8 changes: 4 additions & 4 deletions examples/Implementation/START2_IO/START2_IO.ino
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
| A || - || - |
| M || 0 || 0 |
| - || 8 || 8 |
| 1 || T || S |
| 0 || R || I |
| 0 || S || M |
| C || T || S |
| P || R || I |
| U || S || M |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/
#include <P1AM.h>
Expand Down
8 changes: 4 additions & 4 deletions examples/Implementation/START2_PUZZLE/START2_PUZZLE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
| A || - || - |
| M || 0 || 0 |
| - || 8 || 8 |
| 1 || T || S |
| 0 || R || I |
| 0 || S || M |
| C || T || S |
| P || R || I |
| U || S || M |
¯¯¯¯¯ ¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
| A || O |
| M || T |
| - || |
| 1 || 0 |
| 0 || 1 |
| 0 || |
| C || 0 |
| P || 1 |
| U || |
¯¯¯¯¯ ¯¯¯¯¯
Written by FACTS Engineering
Copyright (c) 2019 FACTS Engineering, LLC
Copyright (c) 2023 FACTS Engineering, LLC
Licensed under the MIT license.
*/

Expand Down
Loading

0 comments on commit 84f508c

Please sign in to comment.