Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
checkpoint
  • Loading branch information
rickkas7 committed Apr 28, 2025
commit 349f8713eedcd59bddb44cafb6b413cf743baf9b
11 changes: 8 additions & 3 deletions scripts/carriers-update/generator-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5294,8 +5294,8 @@ const schemaDocs = require('./schema-docs');
return updater.generatePinInfo({
style: 'pinFunction',
platformNew: 'm-hat-m2',
noPinNumbers: false,
sortByNum: true,
noPinNumbers: true,
sortByNum: false,
includeDesc: false,
noPWM: true,
noHardwarePin: true,
Expand All @@ -5317,6 +5317,10 @@ const schemaDocs = require('./schema-docs');
key: 'desc',
title: 'Description'
},
{
key: 'num',
title: 'M.2 pin'
},
],
functionCols: [],
});
Expand Down Expand Up @@ -5526,7 +5530,8 @@ const schemaDocs = require('./schema-docs');
noPWM: true,
noHardwarePin: true,
pinFilterFn: function(pinObj) {
return pinObj.connectedTo != 'DML3006';
// return pinObj.connectedTo != 'DML3006';
return !pinObj.net.match(/EN[0-9]_CTR/);
},
rightColumns: [
{
Expand Down
210 changes: 111 additions & 99 deletions src/content/reference/datasheets/m-series/m-hat-datasheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,23 @@ See also [Power](#power), below.

### <!-- shared-diagram-label m-hat pd-led title-label-paren -->USB-C PD LED (2)<!-- end -->

This LED will turn on when USB-C PD has been negotiated.

### <!-- shared-diagram-label m-hat dc-in title-label-paren -->DC IN (3)<!-- end -->

Optional 6V - 12V DC power input.
Optional 5V - 12V DC power input (fscrew terminals).

See also [Power](#power), below.

### <!-- shared-diagram-label m-hat chg-led title-label-paren -->Charge LED (4)<!-- end -->

- When lit, the battery is being charged.
- When off, the battery is fully charged, or is not charging because of insufficient power.
- When blinking, there is a battery fault or charging fault.

If you do not have a battery connected, the charge LED may flicker at boot and in DFU mode, and will periodically blink when the device attempts to determine if a battery has been connected.


### <!-- shared-diagram-label m-hat bat-conn title-label-paren -->LiPo Battery (5)<!-- end -->

The M-HAT has a 3-pin JST-PH (2mm pitch) battery connector that is the same as the Monitor One, Muon, and Tachyon for connection to a 3.7V LiPo battery pack
Expand Down Expand Up @@ -204,7 +212,7 @@ This is a standard Particle RGB status LED. It is unaffected by the Raspberry Pi
Power can be supplied to M-HAT by:

- USB-C
- VIN (6 - 12 VDC, via screw terminals)
- VIN (5 - 12 VDC, via screw terminals)
- LiPo battery (via 3-pin JST battery connector)
- Expansion card (HAT)

Expand Down Expand Up @@ -248,11 +256,34 @@ A jumper located on the bottom side of the M-HAT selects the direction of expans

<p class="attribution">This picture is of the Muon; the appearance of the M-HAT may differ</p>

## Internal peripherals

### Components - Internal peripherals
When the jumper is set to 5V_IN, the M-HAT powers the Raspberry Pi HAT connector, which is turn powers the Raspberry Pi itself.

There are two separate ways 5V on the HAT connector can be generated when powering from M-HAT:
- LiPo boost converter
- DCIN or USB boost-buck converter

The outputs are ORed together using a circuit similar to an ideal diode so none, one, or both can be safely powered at the same time.

Both of these default to on, but can be disabled using GPIO.

{{!-- BEGIN do not edit content below, it is automatically generated f90b1182-87f3-4aa6-8599-01504bfdff97 --}}

| Module Pin | Pin Name | Schematic net | MCU direction | Description |
| :---: | :--- | :--- | :--- | :--- |
| 37 | A3 | EN1_CTR | O | LiPo to 5V boost converter (HIGH to turn off, default on) |
| 41 | A4 | EN2_CTR | O | DCIN or USB boost-buck converter (HIGH to turn off, default on) |


{{!-- END do not edit content above, it is automatically generated--}}

The LiPo boost converter is isolated by a DML3006 load switch, so when disconnected, the boost converter (TPS61088) is not powered. The EN1_CTR control line connects to the load switch via a 2N7002 N-channel MOSFET to handle the inversion and voltage-level differences.

The EN2_CTR control line connects to the MP28167 boost-buck converter EN pin via a 2N7002 N-channel MOSFET to handle the inversion and voltage-level differences.

#### STUSB4500
## Internal peripherals

### STUSB4500 - Internal peripherals

The STUSB4500 USB PD controller has three connections, however they are not frequently needed and are hard to access on the B-SoM.

Expand All @@ -269,7 +300,24 @@ Two of the pins are NFC pins on the B-SoM. They can be converted from NFC Tag to

{{!-- END do not edit content above, it is automatically generated--}}

#### FSA2567
#### PD_RST

This is the PD_RST line to reset the STUSB4500 USB PD controller. You normally will not need to use this.

There is a 10K hardware pull-down resistor on this pin. If you set the pin to OUTPUT and HIGH, it will reset the chip.

#### PD_ALERT

This is the PD_ALERT output from the STUSB4500 USB PD controller. It is not enabled by default.

This is connected to M.2 Pin 19.

#### PD_ATTACH

This is the PD_ATTACH output from the STUSB4500 USB PD controller.


### FSA2567 - Internal peripherals

This chip isolates the UART pins (RX, TX, CTS, RTS) between the Particle M.2 SoM and the Pi.

Expand All @@ -287,32 +335,20 @@ If the A0 pin is set HIGH, then the UART is connected:

{{!-- END do not edit content above, it is automatically generated--}}

By default, the serial connection is isolated.

To enable the UART connection, you would typically use code like this in your firmware that enabled tethering:

```cpp
pinMode(A0, OUTPUT);
digitalWrite(A0, HIGH); // enable UART connection
```

#### DML3006

There are two separate ways 5V on the HAT connector can be generated when powering from

{{!-- BEGIN do not edit content below, it is automatically generated f90b1182-87f3-4aa6-8599-01504bfdff97 --}}

| Module Pin | Pin Name | Schematic net | MCU direction | Description |
| :---: | :--- | :--- | :--- | :--- |
| 37 | A3 | EN1_CTR | O | LiPo to 5V boost converter (HIGH to turn off, default on) |


{{!-- END do not edit content above, it is automatically generated--}}


#### TMP112A
### TMP112A - Internal peripherals

This is the temperature sensor on the M-HAT, which is connected by I2C. There is an optional alert output that can be enabled
on the sensor. It is an open-collector output and is connected to D4. If you are using this feature, be sure to set
`pinMode(D4, INPUT_PULLUP)` so the input does not float.
`pinMode(D4, INPUT_PULLUP)` so the input does not float. There is no hardware pull-up on tbe M-HAT on this line.

{{!-- BEGIN do not edit content below, it is automatically generated f6622f00-cc13-43e4-99d4-c955ed253710 --}}

Expand All @@ -323,10 +359,20 @@ on the sensor. It is an open-collector output and is connected to D4. If you are

{{!-- END do not edit content above, it is automatically generated--}}

#### AB1805
### AB1805 - Internal peripherals

The AB1805 RTC/Watchdog provides additional RTC and hardware watchdog options. It can be powered by:

- USB-C power
- DCIN
- HAT connector (when the jumper is selected to power from HAT)
- LiPo battery

Note that the LiPo battery will power the chip

The FOUT/IRQ output from the AB1805 is an open-collector output and defaults to Hi-Z in the chip. If you are using this feature, be sure to set
`pinMode(D5, INPUT_PULLUP)` so the input does not float. There is no hardware pull-up on tbe M-HAT on this line.

The AB1805 RTC/Watchdog provides additional RTC and hardware watchdog options. This is push-pull driven from the AB1805
and defaults to HIGH in the chip, so you can't reuse this pin for other purposes, though you can ignore it.

{{!-- BEGIN do not edit content below, it is automatically generated e37904f1-301c-4f2b-97a9-3bab92a6acd3 --}}

Expand All @@ -337,7 +383,7 @@ and defaults to HIGH in the chip, so you can't reuse this pin for other purposes

{{!-- END do not edit content above, it is automatically generated--}}

#### PM-BAT
### PM-BAT - Internal peripherals

[PM-BAT](/hardware/power/pm-bat-datasheet/) power module includes an open-collector output for interrupts from the bq24195 PMIC
and the MAX17043 fuel gauge. If using this feature, be sure to set `pinMode(A7, INPUT_PULLUP)` so the input does not float.
Expand All @@ -352,91 +398,54 @@ and the MAX17043 fuel gauge. If using this feature, be sure to set `pinMode(A7,

{{!-- END do not edit content above, it is automatically generated--}}

This output controls the 3V3_AUX power, which also powers:

- Qwiic connector
- Grove connector

Unlike the Muon, AUX_PWR_EN does not control 3.3V and 5V power to the HAT connector.

### GPIO - Internal peripherals

{{imageOverlay src="/assets/images/m-hat/m-hat-m2.svg" alt="Pin Diagram"}}

{{!-- BEGIN do not edit content below, it is automatically generated 5c7622c6-ae73-4a5b-88b6-e761ee69fa3f --}}

| Module Pin | Pin Name | Schematic net | MCU direction | Connected to | Description |
| :---: | :--- | :--- | :--- | :--- | :--- |
| 17 | D21 | PD_RST | O | STUSB4500 | USB PD controller reset, pin is NFC1 on B-SoM |
| 19 | D20 | PD_ALERT | I | STUSB4500 | USB PD controller alert, pin is NFC2 on B-SoM |
| 20 | SCL | M2_SCL | I/O | Multiple | I2C SCL |
| 22 | SDA | M2_SDA | I/O | Multiple | I2C SDA |
| 23 | A0 | SEL | O | FSA2567 | HIGH to enable SoM to Pi UART |
| 32 | MODE | M2/MODE | I | MODE button | MODE button for Particle SoM |
| 33 | A1 | M2_A1/MISO | I/O | Grove A1 | Grove A1, Input, Output, ADC, PWM |
| 34 | RESET | M2/RESET | I | RESET button | RESET button for Particle SoM |
| 35 | A2 | M2_A2/SCK | I/O | Grove A2 | Grove A2, Input, Output, ADC |
| 36 | TXD | M2_TXD | O | HAT | UART serial TXD, connects to Pi UART0 RXD |
| 37 | A3 | EN1_CTR | O | DML3006 | LiPo to 5V boost converter (HIGH to turn off, default on) |
| 38 | RXD | M2_RXD | I | HAT | UART serial RXD, connects to Pi UART0 TXD |
| 40 | CTS | M2_D3/CTS | I | HAT | UART serial CTS, connects to Pi UART0 RTS |
| 41 | A4 | EN2_CTR | O | MP28167 | DCIN or USB boost-buck converter (HIGH to turn off, default on) |
| 42 | RTS | M2_D2/RTS | O | HAT | UART serial RTS, connects to Pi UART0 CTS |
| 47 | A7 | M2_A7/PMIC_INT | I | PM-BAT | PMIC and fuel gauge interrupt output |
| 48 | CS | WAKE_RPI_CTR | O | HAT | Pi power control by GPIO4 |
| 51 | SOM14 | SOM14 | I/O | IOEX connector | NC on B-SoM |
| 57 | SOM17 | SOM17 | I/O | IOEX connector | NC on B-SoM |
| 58 | D24 | M2_D24 | I/O | IOEX connector | On IOEX connector, NC on B-SoM |
| 59 | D26 | PD_ATTACH | I | STUSB4500 | USB PD controller attach interrupt, NC on B-SoM |
| 60 | D25 | M2_D25 | I/O | IOEX connector | On IOEX connector, NC on B-SoM |
| 62 | D22 | 3V3_DETECTION | I | HAT connector | HIGH when Pi is supplying 3V3 to the HAT connector |
| 64 | D23 | M2_D23 | I/O | IOEX connector | GPIO on IOEX connector |
| 66 | D4 | TEMP_ALERT | I | TMP112A | Temperature sensor ALERT output |
| 68 | D5 | RTC_INT | I | AB1805 | RTC/Watchdog FOUT/IRQ output |
| 70 | D6 | M2_D6 | I/O | IOEX connector | PWM, GPIO on IOEX connector |
| 72 | D7 | D7/AUX_POWER_EN | O | PM-BAT | 3V3_AUX power control (HIGH to turn on) |
| Pin Name | Schematic net | MCU direction | Connected to | Description | M.2 pin |
| :--- | :--- | :--- | :--- | :--- | :--- |
| A0 | SEL | O | FSA2567 | HIGH to enable SoM to Pi UART | 23 |
| A1 | M2_A1/MISO | I/O | Grove A1 | Grove A1, Input, Output, ADC, PWM | 33 |
| A2 | M2_A2/SCK | I/O | Grove A2 | Grove A2, Input, Output, ADC | 35 |
| A3 | EN1_CTR | O | DML3006 | LiPo to 5V boost converter (HIGH to turn off, default on) | 37 |
| A4 | EN2_CTR | O | MP28167 | DCIN or USB boost-buck converter (HIGH to turn off, default on) | 41 |
| A7 | M2_A7/PMIC_INT | I | PM-BAT | PMIC and fuel gauge interrupt output | 47 |
| CS | WAKE_RPI_CTR | O | HAT | Pi power control by GPIO4 | 48 |
| CTS | M2_D3/CTS | I | HAT | UART serial CTS, connects to Pi UART0 RTS | 40 |
| D4 | TEMP_ALERT | I | TMP112A | Temperature sensor ALERT output | 66 |
| D5 | RTC_INT | I | AB1805 | RTC/Watchdog FOUT/IRQ output | 68 |
| D6 | M2_D6 | I/O | IOEX connector | PWM, GPIO on IOEX connector | 70 |
| D7 | D7/AUX_POWER_EN | O | PM-BAT | 3V3_AUX power control (HIGH to turn on) | 72 |
| D20 | PD_ALERT | I | STUSB4500 | USB PD controller alert, pin is NFC2 on B-SoM | 19 |
| D21 | PD_RST | O | STUSB4500 | USB PD controller reset, pin is NFC1 on B-SoM | 17 |
| D22 | 3V3_DETECTION | I | HAT connector | HIGH when Pi is supplying 3V3 to the HAT connector | 62 |
| D23 | M2_D23 | I/O | IOEX connector | GPIO on IOEX connector | 64 |
| D24 | M2_D24 | I/O | IOEX connector | On IOEX connector, NC on B-SoM | 58 |
| D25 | M2_D25 | I/O | IOEX connector | On IOEX connector, NC on B-SoM | 60 |
| D26 | PD_ATTACH | I | STUSB4500 | USB PD controller attach interrupt, NC on B-SoM | 59 |
| MODE | M2/MODE | I | MODE button | MODE button for Particle SoM | 32 |
| RESET | M2/RESET | I | RESET button | RESET button for Particle SoM | 34 |
| RTS | M2_D2/RTS | O | HAT | UART serial RTS, connects to Pi UART0 CTS | 42 |
| RXD | M2_RXD | I | HAT | UART serial RXD, connects to Pi UART0 TXD | 38 |
| SCL | M2_SCL | I/O | Multiple | I2C SCL | 20 |
| SDA | M2_SDA | I/O | Multiple | I2C SDA | 22 |
| SOM14 | SOM14 | I/O | IOEX connector | NC on B-SoM | 51 |
| SOM17 | SOM17 | I/O | IOEX connector | NC on B-SoM | 57 |
| TXD | M2_TXD | O | HAT | UART serial TXD, connects to Pi UART0 RXD | 36 |


{{!-- END do not edit content above, it is automatically generated--}}


#### PD_RST

This is the PD_RST line to reset the STUSB4500 USB PD controller. You normally will not need to use this.

There is a 10K hardware pull-down resistor on this pin. If you set the pin to OUTPUT and HIGH, it will reset the chip.

#### PD_ALERT

This is the PD_ALERT output from the STUSB4500 USB PD controller. It is not enabled by default.

This is connected to M.2 Pin 19.

#### PD_ATTACH

This is the PD_ATTACH output from the STUSB4500 USB PD controller.

#### EN1_CTR

#### EN2_CTR

This controls the EN pin of the MP28167

#### TEMP_ALERT

This is the ALERT output from the TMP112A temperature sensor.

By default, this output is not enabled but can be enabled to interrupt or wake the Particle SoM based on temperature.

#### RTC_INT

This is the FOUT/IRQ output from the AM1805 RTC/Watchdog chip. By default, this output is not enabled.

By default, this output is not enabled but can be enabled to interrupt or wake the Particle SoM based RTC time.

#### A7/AUX_PWR_EN

This output controls the 3V3_AUX power, which also powers:

- Qwiic connector
- Grove connector

Unlike the Muon, AUX_PWR_EN does not control 3.3V and 5V power to the HAT connector.

## Other

### NFC
Expand All @@ -453,6 +462,9 @@ The 10-pin SWD/JTAG debugging connector is not populated on the M-HAT.
Additionally, the Particle M.2 SoM SWD pogo pins are not available on the M-HAT, so SWD would only work
on M-SoM, not B-SoM, even if populated.

Note that the 2x5 connector on the top of the M-HAT is the IOEX connector, not the debug connector, even though the debug
cable does fit in the connector.


## Firmware settings

Expand Down