Skip to content

Commit 1f6e73b

Browse files
authored
Merge pull request #8656 from henriclinden/stable
Added support for the PCTEL WSC-1450 board
2 parents cb7db2e + 995c4b8 commit 1f6e73b

File tree

5 files changed

+213
-0
lines changed

5 files changed

+213
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# PCTEL WSC-1450
2+
3+
The PCTEL Wireless Sensor Core (WSC) is a versatile Industrial IoT product line
4+
that offers multiple radio connectivity options including cellular, LoRa,
5+
Bluetooth 5, NFC as well as 802.15.4 support.
6+
7+
In addition to several radios, the PCTEL WSC includes several sensors to
8+
monitor a variety of physical conditions. These sensors can detect gas, air
9+
quality, temperature, relative humidity, acceleration, angular rate of change,
10+
magnetic field, range, and sound. For solution optimization, the PCTEL WSC can
11+
be ordered with a subset of radios and sensors.
12+
13+
For more details about this board, and its variants, navigate to
14+
https://pctel.com
15+
16+
# Build instructions
17+
18+
Configure your build environment according to the Adafruit instructions. To
19+
build circuitpython for WSC-1450 do:
20+
21+
cd ports/nrf make BOARD=pctel_wsc_1450
22+
23+
This will create a number of firmware files in the `build-pctel_wsc_1450`
24+
directory.
25+
26+
27+
# Installing
28+
29+
The WSC-1450 do not feature an Adafruit-provided bootloader (supporting
30+
niceties like UF2 flashing). Instead, WSC-1450 uses DAPLink. DAPLink handles
31+
everything from debugging to programming the device, as well as the boot
32+
sequence.
33+
34+
1. Connect the WSC-1450 dev kit using a USB cable to the `DHD USB` port. This
35+
will power up the board and open a file browser showing the contents of the
36+
target. (DAPlink magic)
37+
2. Copy the newly built firmware to the WSC-1450 target using drag-n-drop or
38+
other method. The file to upload is
39+
`circuitpython/ports/nrf/build-pctel_wsc_1450/firmware.combined.hex`
40+
3. Wait for the file to upload.
41+
4. Install is complete. Reset the board.
42+
43+
# Running
44+
45+
Connect an additional USB cable to the `Target USB` port on the development
46+
board and open a terminal like `screen` on Mac or `TeraTerm` on Windows. Serial
47+
settings are 115200,n,8,1.
48+
49+
Don't forget to install/update the supporting python libraries.
50+
51+
Happy hacking.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2017 Scott Shawcroft for Adafruit Industries
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
27+
#include "supervisor/board.h"
28+
29+
// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
* This file is part of the MicroPython project, http://micropython.org/
3+
*
4+
* The MIT License (MIT)
5+
*
6+
* Copyright (c) 2016 Glenn Ruben Bakke
7+
*
8+
*
9+
* Permission is hereby granted, free of charge, to any person obtaining a copy
10+
* of this software and associated documentation files (the "Software"), to deal
11+
* in the Software without restriction, including without limitation the rights
12+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
* copies of the Software, and to permit persons to whom the Software is
14+
* furnished to do so, subject to the following conditions:
15+
*
16+
* The above copyright notice and this permission notice shall be included in
17+
* all copies or substantial portions of the Software.
18+
*
19+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
* THE SOFTWARE.
26+
*/
27+
28+
#include "nrfx/hal/nrf_gpio.h"
29+
30+
#define PCTELWSC1450
31+
32+
#define MICROPY_HW_BOARD_NAME "WSC-1450"
33+
#define MICROPY_HW_MCU_NAME "nRF52840"
34+
35+
#define MICROPY_HW_LED_STATUS (&pin_P0_05)
36+
37+
#define DEFAULT_I2C_BUS_SCL (&pin_P0_27)
38+
#define DEFAULT_I2C_BUS_SDA (&pin_P0_26)
39+
40+
#define DEFAULT_SPI_BUS_SCK (&pin_P1_15)
41+
#define DEFAULT_SPI_BUS_MOSI (&pin_P1_13)
42+
#define DEFAULT_SPI_BUS_MISO (&pin_P1_14)
43+
44+
#define DEFAULT_UART_BUS_RX (&pin_P0_16)
45+
#define DEFAULT_UART_BUS_TX (&pin_P0_13)
46+
47+
// Flash operation mode is determined by MICROPY_QSPI_DATAn pin configuration.
48+
// A pin config is valid if it is defined and its value is not 0xFF.
49+
// Quad mode: If all DATA0 --> DATA3 are valid
50+
// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid
51+
// Single mode: If only DATA0 is valid
52+
#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20)
53+
#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21)
54+
#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22)
55+
#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23)
56+
#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19)
57+
#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17)
58+
59+
// #if SPI_FLASH_FILESYSTEM
60+
// #define SPI_FLASH_MOSI_PIN &pin_P0_20
61+
// #define SPI_FLASH_MISO_PIN &pin_P0_21
62+
// #define SPI_FLASH_SCK_PIN &pin_P0_19
63+
// #define SPI_FLASH_CS_PIN &pin_P0_17
64+
// #endif
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
USB_VID = 0x04E9
2+
USB_PID = 0x80FF
3+
USB_PRODUCT = "WSC-1450"
4+
USB_MANUFACTURER = "PCTEL"
5+
6+
MCU_CHIP = nrf52840
7+
8+
QSPI_FLASH_FILESYSTEM = 1
9+
EXTERNAL_FLASH_DEVICE_COUNT = 1
10+
11+
# External flash is Winbond W25Q32JV_IQ
12+
EXTERNAL_FLASH_DEVICES = "W25Q32JVxQ"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#include "shared-bindings/board/__init__.h"
2+
3+
STATIC const mp_rom_map_elem_t board_module_globals_table[] = {
4+
CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS
5+
6+
{MP_ROM_QSTR(MP_QSTR_32KHZ_XTAL1), MP_ROM_PTR(&pin_P0_00)},
7+
{MP_ROM_QSTR(MP_QSTR_32KHZ_XTAL2), MP_ROM_PTR(&pin_P0_01)},
8+
{MP_ROM_QSTR(MP_QSTR_BATTERY), MP_ROM_PTR(&pin_P0_02)},
9+
{MP_ROM_QSTR(MP_QSTR_BOARD_ID), MP_ROM_PTR(&pin_P0_03)},
10+
{MP_ROM_QSTR(MP_QSTR_INT_LIGHT_TOF), MP_ROM_PTR(&pin_P0_04)},
11+
{MP_ROM_QSTR(MP_QSTR_LED_RED), MP_ROM_PTR(&pin_P0_05)},
12+
{MP_ROM_QSTR(MP_QSTR_I2S_SCK), MP_ROM_PTR(&pin_P0_06)},
13+
{MP_ROM_QSTR(MP_QSTR_LORA_SCLK), MP_ROM_PTR(&pin_P0_07)},
14+
{MP_ROM_QSTR(MP_QSTR_I2S_WS), MP_ROM_PTR(&pin_P0_08)},
15+
{MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09)},
16+
{MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10)},
17+
{MP_ROM_QSTR(MP_QSTR_LORA_MOSI), MP_ROM_PTR(&pin_P0_11)},
18+
{MP_ROM_QSTR(MP_QSTR_LORA_MISO), MP_ROM_PTR(&pin_P0_12)},
19+
{MP_ROM_QSTR(MP_QSTR_DEBUG_TX), MP_ROM_PTR(&pin_P0_13)},
20+
{MP_ROM_QSTR(MP_QSTR_CELL_RTS), MP_ROM_PTR(&pin_P0_14)},
21+
{MP_ROM_QSTR(MP_QSTR_CELL_DCD), MP_ROM_PTR(&pin_P0_15)},
22+
{MP_ROM_QSTR(MP_QSTR_DEBUG_RX), MP_ROM_PTR(&pin_P0_16)},
23+
{MP_ROM_QSTR(MP_QSTR_QSPI_CSN), MP_ROM_PTR(&pin_P0_17)},
24+
{MP_ROM_QSTR(MP_QSTR_BT840_RESETN), MP_ROM_PTR(&pin_P0_18)},
25+
{MP_ROM_QSTR(MP_QSTR_QSPI_CLK), MP_ROM_PTR(&pin_P0_19)},
26+
{MP_ROM_QSTR(MP_QSTR_QSPI_IO0), MP_ROM_PTR(&pin_P0_20)},
27+
{MP_ROM_QSTR(MP_QSTR_QSPI_IO1), MP_ROM_PTR(&pin_P0_21)},
28+
{MP_ROM_QSTR(MP_QSTR_QSPI_IO2), MP_ROM_PTR(&pin_P0_22)},
29+
{MP_ROM_QSTR(MP_QSTR_QSPI_IO3), MP_ROM_PTR(&pin_P0_23)},
30+
{MP_ROM_QSTR(MP_QSTR_CELL_HW_SHUTDOWN), MP_ROM_PTR(&pin_P0_24)},
31+
{MP_ROM_QSTR(MP_QSTR_I2S_SD), MP_ROM_PTR(&pin_P0_25)},
32+
{MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_26)},
33+
{MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_27)},
34+
{MP_ROM_QSTR(MP_QSTR_CELL_POWER_ENABLE), MP_ROM_PTR(&pin_P0_28)},
35+
{MP_ROM_QSTR(MP_QSTR_PUSH_BUTTON), MP_ROM_PTR(&pin_P0_29)},
36+
{MP_ROM_QSTR(MP_QSTR_CELL_ON_OFF), MP_ROM_PTR(&pin_P0_30)},
37+
{MP_ROM_QSTR(MP_QSTR_SENSOR_POWER_ENABLE), MP_ROM_PTR(&pin_P0_31)},
38+
{MP_ROM_QSTR(MP_QSTR_BT840_SWO), MP_ROM_PTR(&pin_P1_00)},
39+
{MP_ROM_QSTR(MP_QSTR_CELL_RX), MP_ROM_PTR(&pin_P1_01)},
40+
{MP_ROM_QSTR(MP_QSTR_CELL_TX), MP_ROM_PTR(&pin_P1_02)},
41+
{MP_ROM_QSTR(MP_QSTR_CELL_DSR), MP_ROM_PTR(&pin_P1_03)},
42+
{MP_ROM_QSTR(MP_QSTR_CELL_DTR), MP_ROM_PTR(&pin_P1_04)},
43+
{MP_ROM_QSTR(MP_QSTR_INT_ACCEL), MP_ROM_PTR(&pin_P1_05)},
44+
{MP_ROM_QSTR(MP_QSTR_BOARD_ID_DISABLE), MP_ROM_PTR(&pin_P1_06)},
45+
{MP_ROM_QSTR(MP_QSTR_LORA_DIO0), MP_ROM_PTR(&pin_P1_07)},
46+
{MP_ROM_QSTR(MP_QSTR_CELL_CTS), MP_ROM_PTR(&pin_P1_08)},
47+
{MP_ROM_QSTR(MP_QSTR_LORA_SSN), MP_ROM_PTR(&pin_P1_09)},
48+
{MP_ROM_QSTR(MP_QSTR_LORA_RESETN), MP_ROM_PTR(&pin_P1_10)},
49+
{MP_ROM_QSTR(MP_QSTR_BATTERY_MONITOR_ENABLE), MP_ROM_PTR(&pin_P1_11)},
50+
{MP_ROM_QSTR(MP_QSTR_LORA_DIO1), MP_ROM_PTR(&pin_P1_12)},
51+
{MP_ROM_QSTR(MP_QSTR_LORA_DIO2), MP_ROM_PTR(&pin_P1_13)},
52+
{MP_ROM_QSTR(MP_QSTR_LORA_DIO3), MP_ROM_PTR(&pin_P1_14)},
53+
{MP_ROM_QSTR(MP_QSTR_CELL_PWRMON), MP_ROM_PTR(&pin_P1_15)},
54+
{MP_ROM_QSTR(MP_QSTR_LORA_DIO4), MP_ROM_PTR(&pin_P1_15)},
55+
};
56+
57+
MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table);

0 commit comments

Comments
 (0)