Analysis and Implementation of CAN Controller State Machine