When to use:
When NOT to use:
The Reset block samples its trigger input at its block sample time and issues a software chip reset when any element of that input becomes non-zero. On dsPIC it expands to the __asm__ volatile("RESET") instruction; on PIC32 and SAM families the equivalent SoftReset() / NVIC_SystemReset() call is emitted.
Because the effect is a full chip reset, any code after the trigger is never executed โ the MCU restarts from the reset vector and re-runs the initialization sequence (oscillator setup, peripheral configuration, main()).
| Port | Direction | Type | Description |
|---|---|---|---|
rst | Input | Scalar or vector of any numeric type | Trigger. Reset is issued when any element is non-zero in the current sample. |
The block has no outputs.
| Parameter | Variable | Default | Description |
|---|---|---|---|
| Sample Time | SampleTime | -1 | Inherited (-1) by default. Use an explicit positive value if the reset should be polled at a rate different from the driving subsystem. |
The Reset block has no other user-facing parameters โ it is intentionally minimalist.
Available on every family that ships a Mchp_reset() atomic-function implementation in its TLC. At the time of writing:
| Family | TLC atomic | Emitted code |
|---|---|---|
| dsPIC30F / 33F / 33E / 33C | MCHP_Functions_Atomic_dsPIC.tlc | __asm__ volatile("RESET"); |
| dsPIC33A / dsPIC33AK / PIC32A | MCHP_Functions_Atomic_dsPICA.tlc | __asm__ volatile("RESET"); |
| PIC32MK / MX / MZ / PIC32CM | MCHP_Functions_Atomic_PIC32.tlc | SoftReset (XC32 intrinsic) |
| SAM C2x / D5x / E5x | MCHP_Functions_Atomic_SAMC2x.tlc | NVIC_SystemReset() |
| SAM E70 / S70 / V70 / V71 | MCHP_Functions_Atomic_SAME70.tlc | NVIC_SystemReset() |
mdl = 'my_model';
% Add the Reset block
add_block('MCHP_Blockset/System Functions/Reset', [mdl '/ChipReset']);
% The only mask parameter is Sample Time; leave inherited unless you
% need an explicit rate.
% set_param([mdl '/ChipReset'], 'SampleTime', '0.01');
% Drive the trigger from a fault condition produced elsewhere in the model.
% Example: route a boolean flag computed by a subsystem named 'FaultMon'.
add_line(mdl, 'FaultMon/1', 'ChipReset/1', 'autorouting', 'on');
A supervisor board sends the ASCII character 'R' (0x52) to request a reboot. A small decoder subsystem compares the received byte against the constant and drives the Reset block.
UART Rx โโบ [==0x52?] โโบ Reset
The Microchip Master block enables the hardware watchdog. The application clears it in the main task. If the main task hangs, the hardware watchdog resets the MCU automatically โ no Reset block needed for that path. Use the Reset block instead for explicit faults detected before the watchdog would have expired, so the firmware logs a clean “reset reason = software fault” before rebooting.
RCON register for dsPIC, RSTC for SAM).RESET assembly mnemonic (dsPIC) and SoftReset() / NVIC_SystemReset() intrinsics.