CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

disable tx pin using 18f67k22

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
overmindx



Joined: 06 Oct 2008
Posts: 43

View user's profile Send private message

disable tx pin using 18f67k22
PostPosted: Fri Jan 27, 2012 2:49 am     Reply with quote

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
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Fri Jan 27, 2012 3:00 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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