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

State Z

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







State Z
PostPosted: Mon Jul 25, 2005 12:18 am     Reply with quote

if an IO pin of an IC required to be Z state for few cycles, how to do that.

Let's say PIN_B1 is connected to the IO pin, what is the command to output the state Z?

output_high? output_low or output_float?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 25, 2005 12:33 am     Reply with quote

The PIC doesn't have an output enable control on its pins,
in the same way that a 74HCT245 bi-directional buffer chip has.
You can't completely disconnect a PIC pin from the internal
circuits inside the PIC.

So the next best thing is to make it into an input pin,
by using the output_float() function. Or use set_tris_x().
The pin will then be in a Hi-Z state, so it won't affect whatever
external circuits are connected to the pin. However, if the
pin is left floating (ie., it's not driven and there's no pull-up
or pull-down resistor), it could float right at the CMOS
switching point which could cause massive noise to be
amplified inside the PIC with unknown effect.

So, the short answer is: Use output_float()
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