View previous topic :: View next topic |
Author |
Message |
overmindx
Joined: 06 Oct 2008 Posts: 43
|
disable tx pin using 18f67k22 |
Posted: Fri Jan 27, 2012 2:49 am |
|
|
hi, im trying to disable the tx pin in my software uart.
can i disable my tx pin (PIN_E2) using this code?
Code: |
#byte TXEN = 0xAC // location of TXSTA1 register
#use rs232(force_sw,invert,baud=1200,BRGH1OK, parity=e, bits=7, stop=1,xmit=PIN_E2,rcv=PIN_E3, stream=SDI12)
void disableXT()
{
bit_clear(TXEN,5) // disable transmit
}
|
please help.. thanks |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19382
|
|
Posted: Fri Jan 27, 2012 3:00 am |
|
|
Using a _software UART_, which you are doing, _none_ of the internal registers come into play at all. Hence changing TXEN, does absolutely nothing.
Seriously, with a software UART, if you don't use the output, you can drive the pins completely normally. If you want the pin to go high, just set pin_e2 high. If you want it to be an input, just read from it.....
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|