Same project as described in "Issues with..." below. This related to serial communication between controller and the serial communicator available through the Microcode Studio programming interface.

I use a standard 9 pin, 6 foot serial cable and a native (not converted USB) serial port to issue commands to the PIC (16F877A, 4MHz) - a means to set the time, turn on various channels of lighting, query variables, etc. I interface to the PIC through a tried and true MAX232 module. On the bench, I was using:

'-----SERIAL
DEFINE DEBUG_REG PORTB
DEFINE DEBUG_BIT 1
DEFINE DEBUG_BAUD 2400
DEFINE DEBUG_MODE 0
DEFINE DEBUGIN_REG PORTB
DEFINE DEBUGIN_BIT 2
DEFINE DEBUGIN_ MODE 0

and managed flawless communications - commands echoed back without error and I could read back (from the PIC) multiple lines of formatted data without issue. An example:

IF (CO[0] ="T") AND (CO[1]="I") THEN
REG_VAL[2] = (CO[3]-48) * 10 + (CO[4]-48)
REG_VAL[1] = (CO[6]-48) * 10 + (CO[7]-48)
GOSUB CLK_WRITE
DEBUG "TIME SET: ", #REG_VAL[2], ":", #REG_VAL[1], 10
PAUSE 100
ELSE
DEBUG "TIME ERROR",10
ENDIF

Not a single munged character in dozens - if not hundreds - of trials.

Once the project was moved to near the aquarium (same cord, computer, and module - just "left" about 5 feet)... communications were completely scrambled. I've reduced the baud rate to 1200 and have now LIMITED success... When serial is initiated, the PIC responds perfectly with "WAITING" as expected. Commands are accepted and the routine "falls through" with "EXITING" as it should. The difficulty is that multi-line transmissions are still unintelligible - consistent, but unreadable. This:

IF (CO[0] ="L") AND (CO[1]="P") THEN
FOR LP = 0 to 45 STEP 5
READ LP, word MIN_TEMP, D2
DEBUG "POS: ", DEC2 LP, " MIN: ", DEC4 MIN_TEMP, " PATTERN: ", BIN8 D2, 10
NEXT LP
READ 252, D2, LP3
DEBUG 10, "SET TEMP: ", DEC2 D2, " RANGE: ", #LP3, 10
READ 254, D2
DEBUG "STORED PLUGS: ", BIN8 D2, 10
PAUSE 100
ELSE
DEBUG "DATA READ ERROR",10
ENDIF

--a routine that displays each DATA statement controlling the lighting cycle, fails completely - not a single readable character, until "EXITING" at the end. This:

FOR LP = 0 TO 8
DEBUG DEC2 LP, ":", STR CO[LP]\1, 10
PAUSE 100
NEXT LP
--a routine that displays each character of the command received works without flaw.

I am tempted to reduce the transmission speed further - it need not be fast - but, it bothers me that I don't understand the problem. Anyone see a problem or have some advice?