读取STM8 Unique ID registers
来源:互联网 发布:4g转有线网络 编辑:程序博客网 时间:2024/05/22 11:38
here is a more generic code:==========u_id.h=================//u_id for stm8s105xx chips/*typedef union { struct { unsigned short X_coordinate; //X-coordinate on the wafter unsigned short Y_coordinate; //Y-coordinate on the wafer unsigned char Wafer_Number; //wafer number unsigned char Lot_Number[7]; //lot number } ; unsigned char str[12]; //or the string} U_ID_t; //u_id typ__no_init const U_ID_t U_ID @ 0x48cd;*///alternative approach to delcare U_ID__no_init const union { //either the struct or a string struct { //nameless struct unsigned short X_coordinate; //X-coordinate on the wafter unsigned short Y_coordinate; //Y-coordinate on the wafer unsigned char Wafer_Number; //wafer number unsigned char Lot_Number[7]; //lot number } ; unsigned char str[12]; //or the string} U_ID @ 0x48cd; //u_id typ///*to verify, compare the following with the corresponding items in above struct__no_init const unsigned short X_coordinate @ 0x48cd; //X-coordinate on the wafter__no_init const unsigned short Y_coordinate @ 0x48cf; //Y-coordinate on the wafer__no_init const unsigned char Wafer_Number @ 0x48d1; //wafer number__no_init const unsigned char Lot_Number[7] @ 0x48d2; //wafer number__no_init const unsigned char Lot_Number0 @ 0x48d2; //lot number__no_init const unsigned char Lot_Number1 @ 0x48d3; //lot number__no_init const unsigned char Lot_Number2 @ 0x48d4; //lot number__no_init const unsigned char Lot_Number3 @ 0x48d5; //lot number__no_init const unsigned char Lot_Number4 @ 0x48d6; //lot number__no_init const unsigned char Lot_Number5 @ 0x48d7; //lot number__no_init const unsigned char Lot_Number6 @ 0x48d8; //lot number//end to verify*/=====================================it was written for iar and on on stm8s105xx. for other chips, you may need to change the offset.all you need to do is to include it in your code and compile.U_ID.X_coordinate gives you the x coordinate of the chip on its wafer; etc.or U_ID.str gives you the entire 12 bytes in a string format.
</pre><pre code_snippet_id="477972" snippet_file_name="blog_20140930_1_8961502" name="code" class="cpp">
</pre><pre code_snippet_id="477972" snippet_file_name="blog_20140930_1_8961502" name="code" class="cpp"><span style="color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);">第1、2字节:x坐标</span><br style="word-wrap: break-word; color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);" /><span style="color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);">第3、4字节:y坐标</span><br style="word-wrap: break-word; color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);" /><span style="color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);">第5字节:晶体号</span><br style="word-wrap: break-word; color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);" /><span style="color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);">第6~第12字节:生产批号</span><br style="word-wrap: break-word; color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);" /><span style="color: rgb(34, 34, 34); font-family: sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(238, 238, 238);">我只能告诉你这么多了。。。。。。。。。。</span>还有一种:http://blog.chinaaet.com/detail/24156
0 0
- 读取STM8 Unique ID registers
- 读取STM32F207/40x的CPU唯一ID(Unique Device ID)号方法
- [STM8] 通过STM8芯片唯一ID加密程序
- Android Unique Device ID
- Unique ID策略
- arduino: read unique ID
- STM8/STM32硬件I2C读取APDS9930程序代码
- STM8
- 读取Unique reads
- STM32F0唯一ID ,Unique device ID ,UID
- STM32 Unique device ID reading
- 生成唯一序列号 Unique ID
- stm32 unique device id (UDID)
- stm8 读取电表芯片 att7053 io口模拟 spi
- x86 Registers
- CPU Registers
- ARM registers
- Smali Registers
- LeetCode: Binary Tree Level Order Traversal
- 奇迹Mu分析 - 魔盒刷钱实现
- C语言字符串使用注意事项
- 安卓开源框架积累笔记
- Swifty methods
- 读取STM8 Unique ID registers
- 星巴克的胜利
- Silverlight+WCF+Sql Server
- 工作笔记之-svn 常用技巧及命令总结
- Nehe OpenGL lesson 8
- 面试题—— 找出一个无序整型数组中第k大的数。
- ajax回调函数执行顺序带来的同步异步问题
- 01背包 装满 hdu 1079 The Balance
- 调节阀的选型