> -----Original Message-----
> From: James Winter [SMTP:
spam_OUTjameswinterTakeThisOuT
INSTRO.COM]
> Sent: Monday, October 14, 2002 12:09 PM
> To:
.....PICLISTKILLspam
@spam@MITVMA.MIT.EDU
> Subject: [PIC]. CCS/16F876 Serial port auto disabling
>
> Hiya folks,
>
> Right - here's an interesting one. I have a 18f876 running some code,
> compiled using CCS C.
>
> I am reading data in from a serial stream at 19200 baud - the system works
> great most of the time.
>
> However, occasionally the usart will stop interrupting me!
>
> This is what I've done. (I can't use the serial port to debug itself as it
> is on a RS485 protocol type bus)
>
> - mirrored the data coming in from the Rx pin onto another pin (so the
> tris values haven't changed)
> - used a pin to indicate that I am in the timer irq, and it's still
> running - timer OK.
> - used a pin to indicate that I am in the serial ISR (the pin wiggles for
> a bit to indicate that I am running, and then stops in the 'out' of irq
> state)
> - used a pin to indicate the state of the PIE, and the serial interrupt
> enable (both are still enabled)
>
> The rest of the code is running fine, I have a diagnostics led in the main
> loop, and it's flashing away quite happily indicating that all is well, it
> just won't get any serial interrupts.
>
> I'm running out of ideas now, especially as I have even put a cleanup
> 'reboot me' routine in the timer interrupt, so that if it hasn't had a new
> character in from the usart in a couple of seconds it reboots. HOWEVER - a
> software reboot does not sort the problem out, the usart is still not
> working on the reboot! (A hardware reboot using MCLR or even the watchdog
> timer does work however!)
>
> Any ideas.... anyone??? (I'm tearing my hair out on this one!). Even
> starting to think of rom/ram page boundary problems and stuff like that
> now!
>
> Cheers
>
> James
>