• AVR Freaks

Hot!LED Switch Gone bad(PIC16F687)

Author
medinaev
New Member
  • Total Posts : 5
  • Reward points : 0
  • Joined: 2019/07/02 12:34:02
  • Location: 0
  • Status: offline
2019/07/06 09:26:02 (permalink)
0

LED Switch Gone bad(PIC16F687)

I made a short C code that I thought turn an LED on when i connected the input pin to VSS( 5V). However the LED is off ALL the time and will only turn off when i disconnect ground. Here is the code i made,
 
#include <xc.h>
#include <stdio.h>
#define _XTAL_FREQ 2000000
 
 void main() {

TRISC = 0b00000001;

if(PORTCbits.RC0==1)
PORTCbits.RC1 = 1;
else if (PORTCbits.RC0==0)
PORTCbits.RC1 = 0;
 
Port RC1 is at 0V (Pin 15)
Port RC0 is at VDD when i want to turn it on (Pin 16)
 
VDD measured is at 5.03V ( Potentoimeter voltage divider)
VSS Measured is 0V (GND from Supply)
 
when i disconnect the ground,  pins 11-20 except the pin 16 ( becasue VDD is connected to it) go to 3V.
 
can i get hints to help me solve the problem?
 
 
 
 
 
 
 
 
post edited by medinaev - 2019/07/08 18:02:13
#1

1 Reply Related Threads

    dan1138
    Super Member
    • Total Posts : 3166
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: LED Switch Gone bad(PIC16F687) 2019/07/08 15:25:06 (permalink)
    0
    This is the earliest post from this member on this topic.
    Response are on this thread: https://www.microchip.com/forums/FindPost/1104040
     
    So now after making a nuisance yourself you are getting replies but at a cost to your reputation.
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5