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

High Impedance

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



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

High Impedance
PostPosted: Wed Mar 22, 2023 12:27 am     Reply with quote

When an input pin is in a high impedance (high-z) state, the pin's state cannot be known until that pin is connected to logic zero or logic one.

Well, in the project I am using now, I want to pull the D port, 8 bit data, to high impedance. How can I do that.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 2:43 am     Reply with quote

Your nomenclature is very strange.
A line can't be 'pulled' to high impedance. The point about a high impedance
line is that it is undriven. 'Floating'. No pulling involved. Now a lot of PIC's
do offer a relatively high impedance current source pull-up on some pins
(some of the later PIC's offer pull down as well). Details of this are dependant
on what PIC is involved. If this is what you want, look at the data sheet for
your chip to see if it is available on these pins. If it is, then look at:
port_x_pullups in the manual.
Depending on whether the chip supports individual pullups, or only 'whole
port', this either accepts a numeric value to specify the pattern of bits to
be set, or a simple TRUE/FALSE to turn the whole port on/off. On chips
that support pulldown, the command accepts a second value for these.
If you just want the pins to be high impedance, then just set them as
inputs with TRIS, or output_float.
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 4:42 am     Reply with quote

I just want the pins to be high impedance.
For example, set_tris_d(0xFF); I will do it. Is it true?
if i want to do it alone
output_float(PIN_D0);
output_float(PIN_D1);
output_float(PIN_D2);
output_float(PIN_D3);
output_float(PIN_D4);
output_float(PIN_D5);
output_float(PIN_D6);
output_float(PIN_D7);

pins will be idle to pull it to high impedance. There will be no PULL_UP or PULL_DOWN.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 5:11 am     Reply with quote

FWIW...

A few years ago ( OK ,probably 2 decades.....) Microchip penned an article on how to read the status of any pin that could be 'floated', giving you THREE results, high, low and hi-z.
It was in one of the 'Tips & Tricks' books. Yes, THAT long ago, when books were written... I have a copy of it here, somewhere.....

One very common use of 'float' is with Dallas 'one wire' products,
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 5:26 am     Reply with quote

@ temtronic si how many years have you been dealing with electronic software Smile
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
PrinceNai



Joined: 31 Oct 2016
Posts: 478
Location: Montenegro

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 5:38 am     Reply with quote

Quote:

When an input pin is in a high impedance (high-z) state, the pin's state cannot be known until that pin is connected to logic zero or logic one.


I'd make a little correction here. If you read that pin with let's say input_state() and that pin isn't connected anywhere,you will still read either a 1 or a 0, but it will be a random nonsense value, result of a noise or even a proximity of your finger.

What can't be detected is that this pin is actually floating.
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 5:52 am     Reply with quote

yes it can... google 'microchip tips & tricks'.1st hit, download the PDF, TIP #3, page 1-3.

BTW tip #10(generate high voltage) allows a 3 volt PIC to run a 5 volt LCD module.

There's lots of neat ways to maximize the power of a PIC in the book, everyone should have a copy and re-read it every few months.

FWIW been 'playing with PICs' since late '80s. I bought PCM v2.534. It came with a spiral bound manual. 1st client's product allowed me to retire in '91, so no more commercial interest now, just 'fun'.


Last edited by temtronic on Wed Mar 22, 2023 5:56 am; edited 1 time in total
PrinceNai



Joined: 31 Oct 2016
Posts: 478
Location: Montenegro

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 5:54 am     Reply with quote

https://www.microchip.com/DS01146

Just found the book. I remembered (from 20 years ago) that some switching of the pin is needed.
gaugeguy



Joined: 05 Apr 2011
Posts: 303

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 6:00 am     Reply with quote

Yes, it relies on the capacitance of the pin to hold the pin voltage for a very short time.
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 6:07 am     Reply with quote

I understand. Thank you for all the information. When you retired, I came to the new world. wow.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Mar 22, 2023 8:18 am     Reply with quote

thanks, make the 'dinosaur' feel older ! Smile
My first PICs had pretty quartz windows on top..allowed you to see the electrons moving about.... Wink
Since it took 15 minutes to erase them, it was a great excuse to grab another coffee, and another, and .....
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Thu Mar 23, 2023 12:47 am     Reply with quote

But of course mosr erasers took six or even ten chips. The only time you
had to wait was when you were working with just one or two chips.
Worse though I remember before EEPROMs, when the chips were OTP
only. Got expensive....
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 23, 2023 9:48 am     Reply with quote

sigh...OTP, like the 8223s I have here..
wonder if a PIC could replace them...?

I remember fully reloading diodes onto PDP-8 'boot boards', then snipping out one here, one there to reprogram the board. Wished I'd kept the true 'core' memory modules......hand sewn by women......
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

PostPosted: Thu Mar 23, 2023 3:34 pm     Reply with quote

Those memory "modules" were amazing at the time. I was a PDP jockey
when PDP8 core 64K boards cost $18-26K each. The RIM loader
procedure performed so many times it is burned into my brain is totally useless
now...:-(. I guess I am part of the dying breed that used to also repair the ASR-33
that went with it. Toggle in the RIM loader to read and boot the basic OS from
paper tape on the ASR33 which then read the application assembler code from
DEC dual cassette magnetic tape deck...we have it soooo good now!.
_________________
Google and Forum Search are some of your best tools!!!!
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