View previous topic :: View next topic |
Author |
Message |
jmann
Joined: 27 Dec 2004 Posts: 21
|
Holding Usart output low |
Posted: Fri Apr 08, 2005 12:06 am |
|
|
So, This is one that I cannot find the answer to: I am using the Usart to drive wireless data transmission. The tansmission only occures in very short bursts every 30 seconds. What I am trying to do is turn off the usart output and pull the output low between transmission. This is because TTL serial has the output remaining high when idle.
to do this I am using:
Code: | TXEN=0; //to turn off the Usart output, and
output_low(pin_c6);// to force the ouput low untill I turn it back on for the next transmission. |
the problem is that this is not working. Output remains high.
by the way this is an PIC16F876.
the datasheet block diagram for port C peipheral pins shows that the output enable of the peripheral is the only thing that switches the pin's mode. So then shouldn't disableing the transmit on the Usart return control to the TRIS and PORT registers?
Any ideas?
thanks as always to the community! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 08, 2005 12:30 am |
|
|
Your assumption is that disabling TXEN will turn pin C6 back into an i/o pin.
That function is actually done by the SPEN bit in the RCSTA register. |
|
|
jmann
Joined: 27 Dec 2004 Posts: 21
|
|
Posted: Fri Apr 08, 2005 12:39 am |
|
|
Though it is not a problem for the transmitter in this project, SPEN=0 would turn off the reciever too. |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Fri Apr 08, 2005 7:31 am |
|
|
I am curious, what is wrong with the TX pin sitting at logic 1? That is the customary TTL serial line idle state.
Do you want to power down the RF module and the input protection diodes are keeping it running? _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Ttelmah Guest
|
|
Posted: Fri Apr 08, 2005 8:59 am |
|
|
You don't say what IO mode you are running in?. I'd try setting C6 low, and also setting the corresponding TRIS bit to '0'.
Best Wishes |
|
|
|