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 support@ccsinfo.com

spurious voltage on input pin

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



Joined: 13 Aug 2004
Posts: 58
Location: Turkey

View user's profile Send private message Visit poster's website

spurious voltage on input pin
PostPosted: Wed Jan 16, 2013 3:07 am     Reply with quote

Hi to everybody,

I am doing a project with PIC18F6310.
my program beginning is as follow

Code:

setup_wdt(WDT_OFF);
   setup_adc(ADC_OFF);
   setup_adc_ports(NO_ANALOGS);
   setup_vref(FALSE);
   setup_psp(PSP_DISABLED);
   setup_spi(SPI_SS_DISABLED);
   //setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8|RTCC_8_BIT);
 
   setup_timer_1(T1_DISABLED );
   setup_timer_2(T2_DISABLED, 0xFF, 0x10);
   setup_timer_3(T3_DISABLED);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   setup_low_volt_detect(LVD_21);
   setup_oscillator(OSC_16MHZ);
   
set_tris_a ( 0xFF );
set_tris_b ( 0xFE );
set_tris_c ( 0xC1 );
//set_tris_c ( 0x81 );
set_tris_d ( 0xFF );
set_tris_e ( 0xFF );
set_tris_f ( 0xFF );
set_tris_g ( 0x04 );
clear_interrupt(int_LOWVOLT);
clear_interrupt(int_ext1);


Most of my ports are defined as input and pulled down with 4K7 resistors.

When an input except PIN_A0 is set HIGH, a voltage about 0.2V or more sometimes is measured on PIN_A0. As I set more inputs to HİGH, the voltage increases on PIN_A0 until it makes PIN_A0 be detected HIGH. What could be the problem?

thx
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Wed Jan 16, 2013 8:42 am     Reply with quote

I'm afraid it is not at all clear what you are seeing/saying.

'set HIGH'. If you set a pin high, then you are making it an output, not an input.

Are you sure your '4K7 resistors' go back to the same ground point you are using for your voltage measurements?.

It sounds to me as if you are perhaps using a rather resistive breadboard, and when pins go high they start pulling 'up' the common point to which the pull-down resistors are attached.

Best Wishes
scanan



Joined: 13 Aug 2004
Posts: 58
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 17, 2013 1:37 am     Reply with quote

All pin defined as input are pull DOWN with 4K7 resistor.
when these input ARE CONNECTED TO +5vOLT EXCPET pın_a0 which nothing is connected just doing measyrment on this pin. I measure some voltage however I should measure 0 volt because it is pulled down.
scanan



Joined: 13 Aug 2004
Posts: 58
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Thu Jan 17, 2013 1:38 am     Reply with quote

Ttelmah wrote:
I'm afraid it is not at all clear what you are seeing/saying.

'set HIGH'. If you set a pin high, then you are making it an output, not an input.

Are you sure your '4K7 resistors' go back to the same ground point you are using for your voltage measurements?.

It sounds to me as if you are perhaps using a rather resistive breadboard, and when pins go high they start pulling 'up' the common point to which the pull-down resistors are attached.

Best Wishes



All pin defined as input are pull DOWN with 4K7 resistor.
When these input ARE CONNECTED TO +5volt EXCEPT pın_a0 which nothing is connected just doing measurement on this pin. I measure some voltage however I should measure 0 volt because it is pulled down.
Ttelmah



Joined: 11 Mar 2010
Posts: 19338

View user's profile Send private message

PostPosted: Thu Jan 17, 2013 2:35 am     Reply with quote

Repeat the same comment. The fault is almost certainly a wiring problem outside the PIC. Unplug it, and repeat the test.

Best Wishes
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Thu Jan 17, 2013 2:47 am     Reply with quote

Can I add.

Measure the impedances to all grounds with, or without, the PIC in place.

Mike
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