tag 标签: lpc21xx

相关博文
  • 热度 14
    2010-12-4 17:49
    2132 次阅读|
    2 个评论
    Rule : The reserved ARM interrupt vector location(0x0000 0014) should contain the 2's complement of the check-sum of the remaining interrupt vectors. This causes the checksum of all of the vectors together to be 0. Polynomial: V0 + V1 + V2 + V3 + V4 + Sum + V6 + V7 = 0 Code: void CCalc_nxp_checksumDlg::OnCalc() {  // chose bin file  CString sFilename;  CFileDialog dlg(TRUE);      // open with TRUE, save with FALSE  if(dlg.DoModal() == IDOK) {   sFilename = dlg.GetPathName();   // full path  }   // read 8 interrupt vectors  CFile file;  if(!file.Open(sFilename, CFile::modeRead)) { return; }  int data ;  BYTE str ;  for(int i=0; i8; i++) {   file.Read(str, 4);   data = *(int *)str;  }  file.Close();  // calc checksum  int sum = 0;  for(i=0; i8; i++) {   if(i != 5) { sum += data ; }  }  sum = 0 - sum;  BYTE checksum ;  int *sum_ptr = ∑  BYTE *ptr = (BYTE *)sum_ptr;  for(i=0; i4; i++) {   checksum = *ptr;   ptr++;  }  CString sResult;  sResult.Format("%X %X %X %X", checksum , checksum , checksum , checksum );  GetDlgItem(IDC_EDIT1)-SetWindowText(sResult); } Conclusion: In current most IDE, the interrupt vector checksum can be calculated. But for the other old IDE, we have to calculate the checksum by ourselves. Written by Allen in Shenzhen 2010.12.04
相关资源
  • 所需E币: 5
    时间: 2019-12-24 21:17
    大小: 2.22MB
    上传者: givh79_163.com
    LPC21xxandLPC22xx用户手册UM10114LPC21xxandLPC22xxUsermanualRev.03―2April2008UsermanualDocumentinformationInfoContentKeywordsLPC2109/00,LPC2109/01,LPC2119,LPC2119/01,LPC2129,LPC2129/01,LPC2114,LPC2114/01,LPC2124,LPC2124/01,LPC2194,LPC2194/01,LPC2210,LPC2220,LPC2210/01,LPC2212,LPC2212/01,LPC2214,LPC2214/01,LPC2290,LPC2290/01,LPC2292,LPC2292/01,LPC2294,LPC2294/01,ARM,ARM7,32-bit,MicrocontrollerAbstractUsermanualforLPC2109/19/29/14/24/94andLPC2210/20/12/14/90/92/94including/01partsNXPSemiconductors……
  • 所需E币: 5
    时间: 2019-12-24 20:46
    大小: 2.22MB
    上传者: wsu_w_hotmail.com
    LPC21XX和LPC22xx用户手册UM10114LPC21xxandLPC22xxUsermanualRev.03―2April2008UsermanualDocumentinformationInfoContentKeywordsLPC2109/00,LPC2109/01,LPC2119,LPC2119/01,LPC2129,LPC2129/01,LPC2114,LPC2114/01,LPC2124,LPC2124/01,LPC2194,LPC2194/01,LPC2210,LPC2220,LPC2210/01,LPC2212,LPC2212/01,LPC2214,LPC2214/01,LPC2290,LPC2290/01,LPC2292,LPC2292/01,LPC2294,LPC2294/01,ARM,ARM7,32-bit,MicrocontrollerAbstractUsermanualforLPC2109/19/29/14/24/94andLPC2210/20/12/14/90/92/94including/01partsNXPSemiconductors……