| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| MCUprogrammer 
 
 
 Joined: 08 Sep 2020
 Posts: 233
 
 
 
			    
 
 | 
			
				| High Impedance |  
				|  Posted: Wed Mar 22, 2023 12:27 am |   |  
				| 
 |  
				| 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: 19966
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 2:43 am |   |  
				| 
 |  
				| 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: 233
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 4:42 am |   |  
				| 
 |  
				| 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: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 5:11 am |   |  
				| 
 |  
				| 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: 233
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 5:26 am |   |  
				| 
 |  
				| @ temtronic si how many years have you been dealing with electronic software  _________________
 Best Regards...
 MCUprogrammer
 _______________________________
 Work Hard
 |  | 
	
		|  | 
	
		| PrinceNai 
 
 
 Joined: 31 Oct 2016
 Posts: 554
 Location: Montenegro
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 5:38 am |   |  
				| 
 |  
				|  	  | 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: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 5:52 am |   |  
				| 
 |  
				| 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: 554
 Location: Montenegro
 
 
			    
 
 |  | 
	
		|  | 
	
		| gaugeguy 
 
 
 Joined: 05 Apr 2011
 Posts: 350
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 6:00 am |   |  
				| 
 |  
				| 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: 233
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 6:07 am |   |  
				| 
 |  
				| 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: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Mar 22, 2023 8:18 am |   |  
				| 
 |  
				| thanks, make the 'dinosaur' feel older !   My first PICs had pretty quartz windows on top..allowed you to see the electrons moving about....
   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: 19966
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Thu Mar 23, 2023 12:47 am |   |  
				| 
 |  
				| 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: 9588
 Location: Greensville,Ontario
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Thu Mar 23, 2023 9:48 am |   |  
				| 
 |  
				| 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: 1968
 Location: Norman, OK
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Thu Mar 23, 2023 3:34 pm |   |  
				| 
 |  
				| 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!!!!
 |  | 
	
		|  | 
	
		|  |