PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jan 21, 2004 1:41 pm |
|
|
Quote: | What I want to do is to make the PIC seem like it's turned off to the outside world i.e. output pins low and a high output impedance |
Those two states are mutually exclusive. If a PIC pin is in a
high impedance state, it cannot also be driving the pin low.
You're using the PIC to talk to a cell phone, and you said the phone
hangs, sometimes. If you reset the PIC, then it cures the problem.
I'm wondering if it's the PIC that is locking up, due to errors
in the USART receiver ? Try adding the ERRORS parameter
to your #use rs232 statement. Example:
#use rs232(baud = 9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
This only works with the hardware USART.
Quote: | There's a conflict happening somewhere but what I would like would be to have a timer watching out for this occurence and when it senses that communications have stopped: |
The watchdog timer could be used for this. It's intended to reset
the PIC if the program locks up for some unknown reason. When
you use it, you have to be careful to put a restart_wdt() statement
in your main loop, and make sure that statement is normally
executed at a rate which is faster than the WDT timeout period.
However, I would concentrate on finding the real cause of the lockups
rather than trying to paper it over. You will learn more by doing do. |
|