before you go much further ;
how do you plan to get your code into the ECIO28P , it uses some sort of bootloader .
will the bootloader accept a HEX file? ,will it affect operation ? can you ditch the bootloader if you need to?


Not sure what I set the speed to I am wanting to set the speed to 48Mhz. but this is the internal clock. 4Mhz is external. Do I DEFINE OSC 20 'set for 4MHz xtal' ? What about the internal clock? How does one use that?
depends will the bootloader allow you to alter the config words ? most won't
what accuracy do you need intclk is 1-2% acc ,ext 4mhz res ? , original had a xtal and was probably much better than either of these choices

DEFINE LCD_DREG PORTA ' LCD on port a
DEFINE LCD_DBIT 0 ' Data bits A0..A3
DEFINE LCD_RSREG PORTA ' RS on PORTA
DEFINE LCD_RSBIT 1 ' RS on A1
DEFINE LCD_EREG PORTA ' E on PORTA
DEFINE LCD_EBIT 2 ' E on A2

DEFINE LCD_BITS 4 ' LCD 4 bit mode
if porta 0:3 is the lcd data bus
then porta 1 and 2 are already used and cannot be rs and e as well
draw yourself a schematic using the ECIO28P footprint and how you think it will connect to everything else

input portB.3 'set to input as the board connects this pin (9) to the LM358 output pin 7
this means what ? is it the "probe counter output" ?
if so is portb.3 suitable [I don't think so hint timer1 ext clk]