I didn't realize that just designating a "CLK" pin on the 16F877A is all that was needed. I was under the impression that I had to somehow place a square wave on the "CLK" pin for the DS1802's reference. I used a 4 MHz crystal on the 16F877A. The following relevant code works great for reading pot values from the DS1802 and displaying the pot values on an Optrex LCD:


INCLUDE "modedefs.bas"

@ DEVICE XT_OSC, WDT_OFF, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF

DEFINE LCD_DREG PORTA ' RA to LCD data port
DEFINE LCD_DBIT 0 ' Starting data bit on A0 & last on A3
DEFINE LCD_BITS 4 ' Set 4-bit data bus width
DEFINE LCD_RSREG PORTA ' Set LCD register select port to A
DEFINE LCD_RSBIT 4 ' Set A4 to register select pin
DEFINE LCD_EREG PORTE ' Set LCD enable to port E
DEFINE LCD_EBIT 0 ' Set E0 to LCD enable pin
DEFINE LCD_LINES 4 ' LCD is a 4 line display
DEFINE LCD_COMMANDUS 2000 ' Set LCD command delay time in uS
DEFINE LCD_DATAUS 50 ' Set LCD data delay time in uS

ADCON1 = 7 ' Digital I/O for RA & RE
INTCON.7 = 1 ' Enable all unmasked interrupts (GIE)
TRISB = 255 ' All PORTB pins as inputs for panel switches
OPTION_REG.7 = 0 ' Enable all PORTB internal pull-ups
RST var PORTD.5 ' Set high to read potentiometer settings
RST = 0
CLK var PORTE.1 ' Clock DS1802 to read potentiometer settings
ReadPots var PORTE.2 ' Read potentiometer settings
LPot var byte ' Left channel
RPot var byte ' Right channel

pause 500
LCDOUT 254, 12 ' Turn cursor off & display on
lcdout 254, 1 ' Clear display
pause 200
lcdout 254, 135, "Volume"
gosub update_lcd

MAIN:
if PORTB <> 255 THEN

endif
GOTO MAIN

UPDATE_LCD:
RST = 1
shiftin readpots, clk, LSBPRE, [lpot, rpot]
rst = 0
lpot = lpot & %00111111
rpot = rpot & %00111111
if lpot < 10 then
lcdout 254, 194, "L:-", #lpot, "db ", " R:-", #rpot, "db "
else
lcdout 254, 194, "L:-", #lpot, "db", " R:-", #rpot, "db "
endif
return