1 Reply Latest reply on Mar 16, 2017 9:44 PM by hjpn

    Changing CAN receiver id


      How do i change the id of a particular receiving filter in CAN through code itself? The device i am using is psoc5lp.




      Thank you

        • 1. Re: Changing CAN receiver id



          You need to use AMR and ACR registers to modify the Rx ID dynamically.


          Kindly have a look at the following code:




          void change_set_value_id(void)
          uint8 result = CAN_FAIL;
          uint32 temp_amr;
          uint32 temp_acr;
          temp_amr = ((uint32)0x0u << 21u) | ((uint32)0x3FFFFu << 3u); /* obtain necessary value to put in AMR */
          temp_acr = ((uint32)0x110u << 21u) | ((uint32)0x3FFFFu << 3u); /* obtain necessary value to put in ACR*/
           /*0x110 is new ID, you can assign your own ID */


          if (CAN_RXRegisterInit((reg32 *)&CAN_RX[1].rxamr, temp_amr) == CYRET_SUCCESS)
          if (CAN_RXRegisterInit((reg32 *)&CAN_RX[1].rxacr, temp_acr) == CYRET_SUCCESS)
          result = CYRET_SUCCESS;
          if (result == CAN_FAIL)
          /* error */




          Please refer PSoC 5LP architecture and register TRM for more details:






          Hope this helps.


          Please feel free to update for any query.