Question: You will design a pacemaker using a Moore FSM. There is one input and one output. The input will be high if the heart is

You will design a pacemaker using a Moore FSM. There is one input and one output. The input will be high if the heart is beating on its own. The input will be low if the heart is not beating on its own. If the heart is not beating your machine should pace the heart. If the heart is beating on its own, the input will be high and your output should be low. However, if the input is low, you should pace the heart by giving a 10 ms output pulse every 1 sec. PB0 is output, PB1 is input. Show the FSM state table and state diagram in Moore format. The structure and the main program is fixed. Show the C code for FSM definition, and specify the initial state const struct State{uint32_t out; uint32_t wait; uint32_t next[2]; typedef const struct State State_t; uint32)_t s;//define FSM here void main(void){PORTB_Init(); SysTick_Init() while(1) GPIO_PORTB_DATA_R_FSM[s].out; sysTick wait1ms(FSM[s].wait); input (GPIO_PORTB_DATA_R&0x02)>>1; s = FSM[s] next[Input];}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
