4 ms·
The Pinecil implementation is essentially a watchdog, it just operates proactively instead of reactively. The end result is the same but relies on simple hardwa
by ssl232 3y ago
The Pinecil implementation is essentially a watchdog, it just operates proactively instead of reactively. The end result is the same but relies on simple hardware. See also: dead man's switch [1] used in trains and other safety critical infrastructure.
[1] https://en.wikipedia.org/wiki/Dead_man%27s_switch https://en.wikipedia.org/wiki/Dead_man%27s_switch
- adql 3y agoIf the end result is the same you're just wasting components that already are builtin into most microcontroller. And you'd need to remember to not use autonomous part of microcontroller (like a timer output) to implement it. Considering the connected net is named "tip_control" I'd assume its PWM that is fed into MOSFET controlling the heater... and in vast majority of cases that PWM will happily run when core is hanged. Looking at datasheet of the microcontroller PA6 does indeed go to tip_control and one of alternate functions is TIMER2_CH0, and at least glancing at code /* enable TIMER1 - PWM control timing*/ timer_enable(TIMER1); timer_enable(TIMER2); ... https://github.com/Ralim/IronOS/blob/1fbcdcdf987a28541524e4f23ddc60fc942633ea/source/Core/BSP/Pinecil/Setup.cpp#L298 https://github.com/Ralim/IronOS/blob/1fbcdcdf987a28541524e4f... ... timer_init(TIMER2, &timer_initpara); /* CH0 configuration in PWM mode0 */ timer_channel_output_struct_para_init(&timer_ocintpara); timer_ocintpara.outputstate = TIMER_CCX_ENABLE; timer_ocintpara.outputnstate = TIMER_CCXN_DISABLE; timer_ocintpara.ocpolarity = TIMER_OC_POLARITY_HIGH; ... they are using it for PWM. The watchdog itself also appears to be enabled tho, so there is a chance it will kill itself the normal way