Microchip
直播中

李铭鑫

7年用户 272经验值
私信 关注
[问答]

PIC24FJ256GA702读取UDID不起作用

对于PIC24FJ256GA702,我需要读取UDID和AM有麻烦。方法TreDeMPLAB程序内存视图(调试会话)直接代码访问(例如“UDID(0)=*(Uti1616T*)0x800 F02;”)如何读取UDID,既不工作!要注意的是,我已经彻底检查了下面的例子:Microchip论坛-参考……阅读UDID(http://www. Microchip .com /论坛/ M100816.ASPX)Microchip论坛-Pic24FJ,可以读取UDID(http://www. Microchip .com /论坛/ M98967 .ASPX)的想法?我错过了什么?

以上来自于百度翻译


      以下为原文

    For the PIC24FJ256GA702 I need to read the UDID and am having trouble.

Methods Tried
  • MPLAB Program Memory View (Debug Session)
  • Direct code access (e.g. " udid[0] =  *(uint16_t *) 0x800F02;")
How can you read the UDID, neither works! To note, I have examined thoroughly the following examples:

References
Thoughts? What am I missing here?

回帖(3)

吕聪

2018-10-11 08:58:05
UDID是AT0x801600到0x801608为您的PIC…

以上来自于百度翻译


      以下为原文

    The UDID is at 0x801600 to 0x801608 for your PIC...
举报

李天竹

2018-10-11 09:04:26
该设备具有独立的数据和程序地址空间。你需要程序空间。我会用TBRRDL阅读它。

以上来自于百度翻译


      以下为原文

    This device has separate data and program address spaces. You need program space. I would use TBLRDL to read it.
举报

李雨晨

2018-10-11 09:21:41
首先,你忘了提到“不工作”是什么意思。请更具体。您的参考链接不起作用,因为包含了括号。如果您遵循第二个链接,HTTP://www. McCHIP.COM/FUMMS/M98967.ASPXY,您就看不到用IPE读取UDID(在GB6家族以前的一些版本中已经工作过)了。4 NOR GB6族。因此,我认为它也不会用于GA705。如果从这里你选择了你将在这里得到的链接:HTTP://www. McCHIP.COM/FoMss/FordPase/981589U将找到如何访问GA705族的UDID(和更多的内存位置)的代码。表29 -5显示了UDID地址,这似乎是你所犯的错误。D.UDID1 0x800 F0UDI2 0x800 F02…UDID5 0x800 F08DS300 10118B页340,& lt & & lt;;(编辑:继续阅读线程& Rev B;过时和包含错误地址)(希望Microchip正确地记录它们,文档对于GB4(其他线程)是错误的)。e作业,替换dg**函数,它们是自定义显示函数。

以上来自于百度翻译


      以下为原文

    FIRST, you forgot to mention what "does not work" means. Please be more specific.
Your reference links don't work, because the closing parenthesis is included.
 
If you follow the second link,
http://www.microchip.com/forums/m998867.aspx
you see that I was not able to read the UDID with IPE  (worked in some previous version for the GB6 family) any longer for GB4 nor GB6 family. So I assume it won't for GA705 either.
 
If from there you choose the link you will get here:
http://www.microchip.com/forums/FindPost/981589
You will find the code how to access the UDID (and more memory locations)
For the GA705 family the Table 29-5 shows the UDID addresses, which you seem to have found.
UDID1  0x800F00
UDID2  0x800F02
...
UDID5  0x800F08
DS30010118B-page 340,   <<<  [edit: continue reading thread -> Rev B is outdated and contains wrong addresses]
(Let's hope Microchip documented them correctly, documentation was wrong for the GB4 (other thread)).
 
The following code should do the job, replace the dbg* functions, they are custom display functions.
 

  unsigned int j, wAddr, wData, wTablePag = TBLPAG;            // save previous setting
  TBLPAG= 0x80;                             // retrieve the PIC24 UDID
  wAddr = 0x1600;    // edit: 0x0F00 is wrong;

  dbgPuts("UDID=");
  for (j=0;j<5;++j)
    {
       dbgPuts("UDID");
       dbgPutc('0'+j+1);
       dbgPuts(" = ");
       dbgPutHex( __builtin_tblrdh( wAddr) );
       wData = __builtin_tblrdl( wAddr) ;
       dbgPutHexW( wData );
       wAddr += 2;
       dbgPutLF();
     }
  TBLPAG = wTablePag;      
 
举报

更多回帖

发帖
×
20
完善资料,
赚取积分