PicBasic Pro
PIC17C756A
Slow Learner

I am using the bottom half of a port to write data to an LCD in 4-bit mode and using the top half to output to another device. My trouble is that everytime I send data to the LCD, it changes the data on the top half of the port. Everthing is displayed correctly on the LCD, and everthing works when controlling the other device, but only after removing the LCDout commands. Your help would be very much appreciated.

TRISB = %00110000
TRISC = %00000100
TRISD = %11111111
TRISE = %1101
TRISF = %00000000
TRISG = %11101110

ADCON1 = %000000000111

ADCON1.7 = 1 'Right Justify the results

DEFINE LCD_DREG PORTF
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTC
DEFINE LCD_RSBIT 7
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 6
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50

DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50

(rest of code removed for clarity)

PORTF = %10110000
LCDOut $FE,1,#B8

(rest of code removed for clarity)

(I get the value of B8 displayed OK, but this intereferes with my attempt to write 1011 to the top half of the port)