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

Input H value?

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



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

Input H value?
PostPosted: Wed Jul 05, 2006 10:28 am     Reply with quote

Hi

I am using the PIC16F873, and I have an input to PIN_B5. The input is the same as an output from another microcontroller (I dont know which one), and is connected to a R and an LED. This unknown uC is running on 3.2V. My PIC is running on 5V.

I would like to monitor when the LED controlled by the unknown uC turns ON. I am using:

Code:

if(input(PIN_B5)){
....
}


My PIC does not pick up when the LED goes on. Has this got something to do with level of H?
Can someone please tell me what I am doing wrong?

Thank you
a.
epideath



Joined: 07 Jun 2006
Posts: 47

View user's profile Send private message

PostPosted: Wed Jul 05, 2006 12:44 pm     Reply with quote

3.2V should be enough to input as a HIGH value. My PIC communicates to a 3.3v MMC without problems. PIC runs on 5V. There might be something else going on with your code or wiring.

Regards
Ttelmah
Guest







PostPosted: Wed Jul 05, 2006 3:06 pm     Reply with quote

Agreed, it should work. Pin B5, has a TTL input buffer,which requires just 2v, to be seen as 'high', when running off a 5v supply. The 'odds' are that the output is not actually getting anywhere near the 3.3v level, because of the LED load, and this may be the problem. You need to check with a scope/meter, what voltage is actually arriving at the PIC. Remember the gounds need to be connected together as well, for this to work.

Best Wishes
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Wed Jul 05, 2006 6:01 pm     Reply with quote

The LED, probably, has a resistor connected in series. Could it be that you are connectin the PIC to the resistor, instead of the actual pin on the uC?
arrow



Joined: 17 May 2005
Posts: 213

View user's profile Send private message

PostPosted: Wed Jul 05, 2006 10:20 pm     Reply with quote

Hi

Thank you for all your replies.

Yes, I am connecting PIN_B5 to the Resistor and not the uC pin (is this important?).
I have also checked with an Oscope what comes in on PIN_B5
and it is 3.2V.

So I am not sure what I am doing wrong.

Once again thank you- and back to the debugging.
a.
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Thu Jul 06, 2006 1:30 am     Reply with quote

arrow wrote:
Yes, I am connecting PIN_B5 to the Resistor and not the uC pin (is this important?).

Since you are reading 3.2V on the pin of a PIC, it's not important, whether you are connected to the pin of the other uC directly of through a resistor.

Some usual (stupid) questions:
- How do you know that your PIC doesn't pick up?
- Do you poll your incoming signal often enough?
- Could you post some more of your code? What happens inside the if(input(PIN_B5)) statement that you have posted originally? Does the code get to this if-statement?
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