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

18F67K40 PIN_B0 input problem

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



Joined: 13 Jul 2017
Posts: 4

View user's profile Send private message

18F67K40 PIN_B0 input problem
PostPosted: Sun Nov 04, 2018 11:15 am     Reply with quote

hi,
I designed circuit and i use pin_b0 pin input, but it it not working.

Circuit: Input terminal is 24V, voltage divider(22k - 4k7), 5v1 zener => pin_b0 input. I measure input terminal is 24V but pin_b0 voltage is 0.7V and it does not change. I use set_tris_b(0xFF); and test code
Code:

if(input(pin_b0) == 1)
{
   output_high(led);
}
else
{
  output_low(led);
}

I testing and led is low. help me pls.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Sun Nov 04, 2018 12:30 pm     Reply with quote

If you can, you need to rule out your hardware. If the chip is socketted, remove it, and see if the pin goes high when the PIC is not there.
Something silly, like the zener connected backwards would give that behaviour.
In software, if your test is genuinely simple, and just has the chip waking, sets the TRIS, and tests the bit, then there is no reason for the PIC to hold this low.
Obviously if you have more complex code, the possibility does exist that something in the code is setting the pin as an output and pulling it low. This comes down to investigating every instruction that talks to PortB.
There is no peripheral on PortB, other than simple I/O, that can pull the pin low.
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