For the sake of testing, can you try moving the code in the getchar subroutine to the actual place where the GOSUB getchar is? In other words, don't use a GOSUB just place the actual code "in line" instead.

It's just a hunch but when you GOSUB getchar, where the HSERIN times out and jumps back to main you have an "unresolved" GOSUB/RETURN "pair". The number 27 happens to match the number of nested GOSUBs you can have on an 18F series, I think that's more than a coincidence.

/Henrik.