
April 12, '98
I2C Routines (Revised on April 24, '98)
LCD_V5_0.ASM - For PORTB, Bit 3
After class on April 20, I corrected my error such that this version will interface with RB.3 on PIC terminal 9.
Please share this with other students.
I have debugged the interface with the 24LC32.
Two points.
1. We were apparently clocking too fast. I have added delays to the common I2C routines. Please download the new version from above.
2. When reading from the EEPROM, there is no ACK just prior to the STOP.
That is;
START A0 NACK R_H NACK R_L NACK START A1 NACK READ ACK READ ACK READ ACK READ STOP ^ Note no ACK

April 7, '98
Latest Versions of LCD_TST and LCD_V4_6

Feb 12, 98

Feb 16, '98

Feb 19, '98

Latest Version of LCD_TST and LCD_V4_6 - April 6, '98 Feb 25, '98

Mar 12, '98

Mar 26, '98
Please call this to the attention of other students.
I have discovered another bug. Todd, Isaac, Kofi and Mischelle. This should solve your problems.
Prior to making the call to the lookup table, the PCLATH must be loaded with the page of where the RETLW (DT) is located. This is shown below. The new line are marked with xxx.
xxx MOVLW 02H ; set high bits of program counter to 02 xxx MOVWF PCLATH MOVF R_L, W ; pass the index in W CALL LOOKUP xxx CLRF PCLATH ; back to 00
I am not sure I entirely understand this. Hopefully, I will by next week.

I don't want to make a career out of this exercise. Thus, please make arrangements to show me whatever you have either Thursday or Friday. Whether it works or not. This is actually quite a sophisticated exercise. I sure learned a great deal.
For your info, it appears that LCD_V45.ASM is functional.

April 4, '98
New Machines
Thanks to Paul, we now have new machines on line and of course, there are bound to be some initial problems. However, they have proven to be few.
One problem is the location of the #include file. In the past this was;
#include <c:\mplab\p16f84.inc>On many new machines, the MPLAB directory has been installed in the Program Files. The best advice is to use Windows Explorer to get this file on your floppy and then use;
#include <a:\p16f84.inc>
Some machines are not on the network. Thus, if you cannot use Netscape, you probably cannot print from that machine either.
Initially there some problems with the new machines interfacing with the PIC-START. However, we found some software to fix this problem and I think we have installed it on all of the machines.

Debugging
Please use the debugging capabilities provided by LCD_V45.ASM.
Look particularly at LCD_DEBUG which displays the contents of variables 10H through 17H and it also prints the character in location 40H.
Thus you might have calls such as this in your code;
... code .. MOVLW "1" MOVWF 40H CALL LCD_DEBUG ... code ... MOVLW "2" MOVWF 40H CALL LCD_DEBUG ... etc ...ADC0831
Life sure is full of surprises.
I had originally thought that we could scale V_ref to 1.0 Volts using a simple voltage divider in a ratio of 4 to 1 (10K to 2.5K). However, it turns out that the input impedance of the A/D is quite low (~3K).
In working with a student, we were able to get close to one volt by using a divider in the ratio of one to one (10K and 10K).
In addition, there is just something that I am not seeing on the operation of the A/D. The CS High, CLK low, etc sequence.
However, on Friday, I will use an emulator to get to the route of the problem.
The solution will be posted here by Saturday morning.
