Errata – First Edition, Second Print

All the following Errata have been corrected in the Second Edition:

  • Page 43: In the little snippet of code at the top of the page, I used the hexadecimal notation:
    i = 0x1234; j = 0x5678;

    but later on, you will notice in the disassembly listing, I used the decimal notation instead:

    i = 1234; j = 5678;

    that explains the literal values #0x4d2 and #0x162e found in the following lines.

  • Page 55: The first paragraph refers to Table 5-1a and Table 5-1b.
    Refer to Table 5-1 (on page 56) and Table 5-2 (on page 57) instead.
  • Page 58: If you are using the MPLAB C compiler for PIC24 v3.00 or later, refer to the Updates page to read about changes to the PIC24 library that require a small change in the code examples of chapter 5.
  • <Page 95: Figure 7-7 caption should read:
    “Figure 7-7. The complete Read Data command timing sequence.”
    the picture should probably be moved to page 99 where the Data Read command is discussed
  • Page 123: In the function write(), replace the line:
    putU2( *(char*)buffer);

    with

    putU2( *(char*)buffer++);
  • Page 133: If you are using the MPLAB C compiler for PIC24 v3.00 or later, refer to the Updates page to read about changes to the PIC24 library that require a small change in the code example.
  • Page 143: The definition of AINPUTS, the analog configuration mask, is incorrect:
    #define AINPUTS 0xffef

    should be replaced with:

    #define AINPUTS 0xffcf

    so that both POT and TEMP inputs can be sensed.

  • Page 179: The PS2STOP case listing (at the top of the page) should read:
    case PS2STOP:
        if ( PS2DAT)                 // verify stop bit
        {
            KBDCode = KBDBuf;        // save the key code in mail box
            KBDReady = 1;            // set flag, key code available
        }
        PS2State = PS2START;
        break;
    

    The code included in the book CDROM is correct.

  • Page 216: In function synchV(), replace the line:
    while ( VCount != 1);

    with

    while ( VState != 1);

    Page 268: In function sendSDCmd(), replace the line:
    writeSPI(  ( unsigned char) a>>24); // msb of the address
    with

    writeSPI( a>>24);  // msb of the address

    The code included in the book CDROM is correct.

  • Page 279: In the code segment at the top of the page replace:
    {   // mismatch
        PORTA = 0xff;
    

    with

    {   // mismatch
        PORTA = 0x55;
    

    The code contained in the book CDROM is correct.

  • Page 332: Figure 15-4: incorrectly represents the Input Compare register contents. Please refer to Register 13-1 found on page 117 of the PIC24 Family Reference manual (DS39747D)