The attached P2asm code automatically detects the P2D2 or P2EVAL boards.
A pull-down resistor is needed on Pin 25 of the P2D2 and not be present on the P2EVAL. There is a ground pad 0.4" from pin 25. I suggest using 10K.
You can change these Pin constants to something other that the values I have chosen.
The program determines whether the pull-dwon exists and sets the xtal and baud appropriately and then outputs a message to the serial port every 1 second, and flashes Pin 0 on the P2D2 (I have a green led on this pin) or flashes the blue led on Pin 56 of the P2EVAL every second.
I have provided duplicate CON calculations for each board and select the appropriate set for further use.
Perhaps someone might like to work out the pasm code to calculate the clock and baud values as variables???