DanT29
Newbie level 4
- Joined
- Jul 5, 2011
- Messages
- 7
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,345
Hey guys can someone tell me what I'm doing wrong with the simple led blinking program. I'm using the PIC16f628a, Hi-Tech C complier(Lite), pickit 2 and MPLAB v8.88.
I have also used this code and it does not work:
I have 5 volts going into VDD and VSS connected to ground while RB0(pin 6) is connected to a resistor which is connected in series with an LED that goes back to ground.
What's odd is when I remove VSS from ground it light's up slightly but doesn't blink. Thanks for the help guys!
Code:
#include<htc.h>
#define _XTAL_FREQ 4000000
void main (void){
TRISB=0b00000000;
PORTB=0b00000001;
while(1){
PORTB=0b00000000;
__delay_ms(1000);
PORTB=0b000000001;
__delay_ms(1000);
}
}
I have also used this code and it does not work:
Code:
#include<htc.h>
#define _XTAL_FREQ 4000000
void main (void){
TRISB=0x00;
PORTB=0xFF;
while(1){
PORTB=0x00;
__delay_ms(1000);
PORTB=0xFF;
__delay_ms(1000);
}
}
I have 5 volts going into VDD and VSS connected to ground while RB0(pin 6) is connected to a resistor which is connected in series with an LED that goes back to ground.
What's odd is when I remove VSS from ground it light's up slightly but doesn't blink. Thanks for the help guys!
Last edited: