Big Red Button
CAN Emergency Stop Exercise
Task
Log the sensor's frames and obey the emergency stop for as long as the board runs: if a frame has standard ID 0x300 to 0x303: print_frame() it if a frame has standard ID 0x010: motor_stop() within 3 ms if neither: do nothing The registers and bit fields are on the Datasheet tab.
Circuit
Pass condition
Every sensor frame prints one line, in arrival order. PA5 falls within 3 ms of the stop frame, as figure 2 shows. With no stop frame, PA5 stays high.
Notes
While your program runs, the bench sends the stop frame, other nodes' frames and sensor frames, some in bursts. Leave the given code as is: print_frame() prints one line, and returns once it has gone out at 115200 baud: about 2.3 ms can_start() puts CAN1 on the bus at 500 kbit/s motor_run() PA5 high, the motor runs; main calls it first motor_stop() PA5 low, the motor stops