Cocktail Party

CAN Acceptance Filter Exercise

Task

Log the engine's frames, standard ID 0x1A4, with print_frame() for as long as the board runs: if a frame is the engine's: print it if not: print nothing The registers and bit fields are on the Datasheet tab.

Circuit

Block diagram: U1, an STM32F4, reads CAN RX on PA11 and drives CAN TX on PA12 through U2, a CAN transceiver, onto the CANH and CANL bus with a 120 ohm terminator R1 and R2 at each end; U3, the engine ECU, sends ID 0x1A4 on the same bus as the other nodes; PA9 carries USART1 TX to J1, a serial console

Pass condition

Each engine frame prints one line in arrival order. None is missing, even on a busy bus. Figure 2 shows the public case.

Expected output for the rush hour case: eleven frames on the bus between 20 and 31 ms, three of them the engine's 0x1A4 at 20.0, 21.2 and 30.0 ms among other nodes' frames 0.3 ms apart; the serial console logs only the three engine frames, in the order they arrived

Notes

The bench sends the engine's frames and other nodes' standard and extended frames while your program runs. Other nodes' frames must never wake the CPU, so enable no CAN interrupt. The given code stays as it 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

Related challenges

Loading the interactive arena.