打印
[PSoC™]

PSoC™ 4 and PSoC™ 6 MCUs: How to get the Silicon ID from the application?

[复制链接]
337|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
IFX_OwenSu|  楼主 | 2023-9-27 15:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
The Silicon ID contains silicon ID, revision ID, and family ID. The IDEs and PSoC™ Programmer use the Silicon ID to identify each device. Use the following registers to get the Silicon ID for PSoC™ 4 and PSoC™ 6 MCUs.
PSoC™ 4 MCU:
  • SFLASH_SILICON_ID register: Contains the silicon ID
  • MSB nibble of the ROMTABLE_PID2 register: Contains the major revision ID
  • MSB nibble of the ROMTABLE_PID3 register: Contains the minor revision ID
  • ROMTABLE_PID0 register: Contains the family ID
See the following sample code segment.

Code Listing 1     Sample code to get silicon ID for PSoC™ 4 MCU
uint32_t siliconID = CY_GET_REG32(CYREG_SFLASH_SILICON_ID);

uint8_t majorRevisionID = (CY_GET_REG8(CYREG_ROMTABLE_PID2) >> 4);   

uint8_t minorRevisionID = (CY_GET_REG8(CYREG_ROMTABLE_PID3) >> 4);   

uint16_t familyID = (CY_GET_REG16(CYREG_ROMTABLE_PID0) & 0x0FFF);   

    printf("\r\n Silicon ID: 0x%X Major Revision: 0x%X Minor Revision: 0x%X Family ID: 0x%X \r\n", siliconID, majorRevisionID, minorRevisionID, familyID );
PSoC™ 6 MCU:
  • SFLASH_SILICON_ID register: Contains the 16-bit silicon ID
  • SFLASH_SI_REVISION_ID register: Contains the revision ID
  • SFLASH_FAMILY_ID register: Contains the family ID
See the following sample code segment.

Code Listing 2     Sample code to get silicon ID for PSoC™ 6 MCU
uint8_t revisionID = CY_GET_REG8(SFLASH_BASE + 0x01); 

uint16_t siliconID = CY_GET_REG16(SFLASH_BASE + 0x02);

uint16_t familyID  = (CY_GET_REG16(SFLASH_BASE + 0x0c) & 0x0FFF);

printf("\r\n Silicon ID: 0x%X Revision: 0x%X Family ID: 0x%X \r\n", siliconID, revisionID, familyID);

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

认证:英飞凌科技股份公司
简介:关于英飞凌——我们致力于打造一个更加便利、安全和环保的世界,在赢得自身成功发展的同时,积极践行企业社会责任。

73

主题

205

帖子

6

粉丝