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] [/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
Port B7 Problems [Solved]
Moderator: Benj
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: Port B7 Problems
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
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
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: Port B7 Problems
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] [/img]
John
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] [/img]
John
- JLeith
- Posts: 537
- Joined: Wed Nov 14, 2012 7:49 pm
- Location: British Columbia Canada
- Has thanked: 146 times
- Been thanked: 26 times
- Contact:
Re: Port B7 Problems
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] [/img]
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] [/img]