Mywk
Newbie level 5
Hey all, new here so please no flaming just because I'm newbie in what concerns to electronics, I'm just a programmer trying to learn.
16V -> Diode -> 5V Voltage regulator -> Pic VDD
4Mhz Oscillator I found from spare parts correctly connected to port 16/15
Led + to Port B2
Here is the code I'm using:
It sometimes did work when I had my finger above the Microcontroller (static?), but since i tried 3 different ones I don't think that is the problem.
I tried to use a PIC16F628 and it works without any problem, basically same ports/connections, here is the 628 code:
What could be the problem? Maybe the configuration of the Fuses?
Thanks In Advance!
16V -> Diode -> 5V Voltage regulator -> Pic VDD
4Mhz Oscillator I found from spare parts correctly connected to port 16/15
Led + to Port B2
Here is the code I'm using:
Code:
#include <16F716.h>
#fuses XT,NOWDT, NOBROWNOUT
#use delay(clock=4000000)
#byte PORTB = 6 // PIC16F62X Data Sheet, Bank0
void main(void)
{
set_tris_b(0);
PORTB = 0;
while( 1 )
{
output_high(PIN_B2);
delay_ms(200);
output_low(PIN_B2);
delay_ms(200);
}
}
It sometimes did work when I had my finger above the Microcontroller (static?), but since i tried 3 different ones I don't think that is the problem.
I tried to use a PIC16F628 and it works without any problem, basically same ports/connections, here is the 628 code:
Code:
#include <16F628.h>
#FUSES NOWDT,NOPUT,NOBROWNOUT,NOMCLR,NOLVP,XT //INTRC_IO (Not using internal clock)
#use delay(clock=4000000)
#byte PORTB = 6 // PIC16F62X Data Sheet, Bank0
void main(void)
{
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_b(0);
PORTB = 0;
while( 1 )
{
output_high(PIN_B2);
delay_ms(200);
output_low(PIN_B2);
delay_ms(200);
}
}
What could be the problem? Maybe the configuration of the Fuses?
Thanks In Advance!