PIC Book's Errata

The following errors were pointed out by Prof. Jian Peng

  1. On pp 29, Figure 1-2 is not printed clearly.
  2. On pp 53, Table 2-3, two instructions are printed wrong. Line 4 the instruction ‘DECFSNZ’ should be ‘DCFSNZ’. Line 7 the instruction ‘INCSNZ’ should be ‘INFSNZ’.
  3. On pp 102, code for Example 3-4. The line “LOP_2 COMPF PORTB, F” should be: “LOP_2 COMF PORTB, F”
  4. On pp 104, under ‘BZ’ instruction, the second line of the short sample code is “JZ OVER”. It should be “BZ OVER”.
  5. On pp 262, Example 7-13, “Write a C18 program to monitor bit PC5.” PC5 should be RC5 to be consistent with PIC naming convention.
  6. On pp 339, “Figure 9-5 Timer 0 16-bit Block Diagram”, the labeling for PSA bit is wrong. (I have noticed that this figure is directly from the PIC datasheet, and it is wrong in the datasheet.) For PSA bit, 0 should be using the prescaler, and 1 should be bypassing the prescaler.
  7. On pp 348, the second line under section “8-bit mode programming of Timer0’, ‘TMRL0’ should be “TMR0L’.
  8. On pp 349, Example 9-16, last sentence of the description, “and the TH value to do that”. TH should be TMR0L. Again, the second line from the bottom, “… when TMR0H=00.” TMR0H should be TMR0L.
  9. On pp 353, Figure 9-10, the line “T1CKPS2:T1CKPS0 D5 D4 Timer1 prescaler selector”. T1CKPS2 should be T1CKPS1.
  10. On pp 355, last paragraph, “In Example 9-23, we are using Timer1 as an event counter that counts up as clock pulses are fed into pin 3.5.” Timer1 should be Timer0, and pin 3.5 should be pin T0CKI/RA4.
  11. On pp 358, Example 9-24. The description of the problem says “Set the initial value of TMR0L to -60”, yet in the code, the initial value is 0. Here is the code snippet from the book:
    HERE MOVLW 0x0 ;TMR0L = 0
    MOVWF TMR0L ;load Timer0

    The description or the code needs modification so that they are consistent.
  12. On pp 361, Example 9-27, there is a code error in the second line from the bottom:
    BCF PIR1, TMR1ON

    This line should be “BCF T1CON, TMR1ON”.
  13. On pp 397, the 6th line from the bottom:
    “Desired Baud Rate = Fosc/64(X+1) = 10 MHz/64(X+1) = 6250 Hz/(X+1)”
    The number 6250 should be 156250.
  14. On pp 400, Figure 10-9, under the description of BRGH bit, “We can double the baud rate…”. The word ‘double’ should be ‘quadruple’.
  15. On pp 436, inside the main(void code):
    INTCONbits.TMR0IE = 1; //enable Timer0 interrupt
    INTCONbits.TMR0IE = 1; //enable Timer1 interrupt

    The second line should be “PIE1bits.TMR1IE = 1”. This line will enable Timer1 interrupt.
  16. On pp 464, the chk_isr code:
    void chk_isr(void)
    {
    if (PIR1bits.TMR1IF == 1) //Timer0 cause interrupt?

    “PIR1bits.TMR1IF == 1” should be “INTCONbits.TMR0IF == 1”.
  17. On pp 465, there are two minor comments mistakes. For the line inside T0_ISR(void)
    myPC0bit = ~myPC0bit; //toggle RB1

    RB1 should be RC0.
    For the line inside T1_ISR(void)
    myPC1bit = ~myPC1bit; //toggle RB1

    RB1 should be RC1.
  18. On pp 510, the last sentence of the first paragraph, “Notice that Tad cannot be faster than 1.6 ms.” ‘1.6 ms’ should be ‘1.6 μs’.

Page Error Name Affiliation
104 JZ should be BZ Prof. Jessica J. du Maine St. Louis Community College
109 JZ should be BZ Prof. Jessica J. du Maine St. Louis Community College