I've encountered an odd variant of the Serin2/Timeout hang problem.

The subroutine in question is entered via an interrupt and is
supposed to get some serial input and then do some fascinating
things depending on those commands. BUT -

If I ground my serial-IN pin through a 10k resistor to ensure it's low
and noise free, Serin2 won't timeout.

If I let the (true) serial line pull the pin up, Serin2 causes the PIC
to reset.

I've scoped everything looking for low and high-frequency noise and
the pulled-down input is absolutely silent. In theory, it SHOULD
timeout. I'm aware that if the pin is held high the timeout won't
work ... I suppose I'd have to double-invert to make it normally
low with the terminal attached.

Anyway, I don't *think* I'm doing anything unusual, and I've tried
a number of variants of the code, all with the same negative effects.

Program for PIC 16F88 using 4 Mhz internal RC clock.

The shortened code looks like :

.................................................. ..............
Define SER2_BITS 8

SDA var byte[8] ' serial-data-array (command-assembly buffer)

TRISA = %11111111 ' Set PORTA0-7 to input
TRISB = %11011111 ' Set PORTB0-4,6-7 to input (b2=serIN,b5=serOUT)
INTCON = %10000000 ' disable most interrupts

{program start}

ON INTERRUPT GOTO INTRPT
DISABLE ' disable interrupts here
INTCON = %10010000 ' enable rb0 as interrupt pin

WAITLOOP:
{interrupt waiting loop}

INTRPT:
{interrupt subroutine}

SEROUT2 PORTB.5,396,["I"] ' 2400,N81,True,Driven ... proves interrupt happened

serin2 PORTB.2,396,1500,T_OUT,[WAIT(42), SDA[1]]

SEROUT2 PORTB.5,396,["D"] ' 2400,N81,True,Driven ... shows serin2 dropped through

GOTO REZUM ' skip-over timeout stuff

T_OUT:

SEROUT2 PORTB.5,396,["T"] ' 2400,N81,True,Driven ... shows serin2 timed-out

REZUM:

SEROUT2 PORTB.5,396,["X"] ' 2400,N81,True,Driven ... shows normal exit from sub

RESUME WAITLOOP
{end interrupt sub}
.................................................. .

The interrupt worked first time (good for picbasic) as do SerOUT statements and
Pause() statements - but SERIN2 either hangs when it shouldn't or causes a reset
when it should. I suppose I could loop SERIN2, polling for input for a finite number
of loops, but that increases the chances of missing something.

Any clues ?

-Jimbo

p.s. - a new mode for serin/serin2 - "Wait for ANY input (until timeout if specified)" would
be a nice improvement for PBP since you don't always know what your first input byte
will be ........