Page 1 of 1
Port B7 Problems [Solved]
Posted: Mon Oct 09, 2017 2:31 am
by JLeith
Hello All
Going loopy trying to figure out why I can;t get a Steady Signal Logic 1 on Port B7.
I can see the action in Flowcode 6 but it won't translate to Chip.
I tried to now read the port on my LCD as a confirmation and it will not register the State of Port B 7
I missing something but it is escaping me
Picture and the Flowcode
[img]

- Port B7.jpg (56.99 KiB) Viewed 3689 times
[/img]
And the Flowcode
The flowcode flow is Main---Home Swithes---LCD and back.
I used a old program for my Halloween Fog Machines.
John
Re: Port B7 Problems
Posted: Mon Oct 09, 2017 9:15 am
by LeighM
Hi
To read port B pin 7 you should use $PORTB.7 not $PORTB7
Are you sure that is what you want to do?
Why are you trying to read the input state of Port B.7 when you have B.7 connected to an LED?
You set it high, which will light the LED, but then doing an input will turn the port into a high impedance input
and that will most likely then read the port as low.
Hope that helps
Leigh
Re: Port B7 Problems
Posted: Mon Oct 09, 2017 7:09 pm
by JLeith
Hello Leigh
Thank you I was able to get the Print of 1 when I changed the $Portb.7
As I indicated I was sure I had done it before and could not get my fingers to find the anwser.
I was using a old PCB board to read the input from a Pathway detector then send a PortB.7 Logic 1 to a Relay board that would drive the Fog Machines in a design order.
I can't see why my PortB.7 will NOT put out a High Logic 1 state like in Flowcode.
I have a Logic Scope on the Portb7 and it doesn't show it going High. Evan placed a LED on Portb7 and it won't trigger.
I had the PCB from another project that is why I have the 2 pic's.
Maybe next Halloween I will build a New PCB with 1 PIC.
The PortB7 is a OUTPUT.
I'm trying to activate the Fog Machine when a Ghost Trick or Treater comes to our door. Triggers the Detector which then Sends a Switch detect in the 16F1937 which then send a PortB7 Logic 1 to 16F1827 that activates the Fog Machines in a special order.
[img]

- Halloween Trigger.jpg (64.74 KiB) Viewed 3668 times
[/img]
John
Re: Port B7 Problems
Posted: Tue Oct 17, 2017 6:20 pm
by JLeith
Hello Leigh
I found the cause with PortB.7
The design for the PicKit2 is to have a Bias resistor of 10K to 5V. That was causing the portB7 to not work with a Logic 1 because the 10K was holding the Port to Logic 1.
I changed my code to send a Logic 0 and now I can trigger the other PIC.
All the Best
Not sure how to make this topic as Closed or Sloved
john
[img]

- Portb High.jpg (14.26 KiB) Viewed 3641 times
[/img]