Hello!
I have found an application for blinking LED here:
http://www.oz1bxm.dk/PIC/628LED.htm
The application has been uploaded and working. I have also recompiled code and uploaded my HEX file, works also...
The problem appears when I try to code in C. This is what I get:
It does not work...
The code in the attachment. I have also included the 16F628A.h file. You can see my bread board on the image included. I do not have a pullup resistor. How critical is it?
I know assembler, but would preffer to write in C for now. Could you help me to rewrite the code into C? I am new in microcontroller programming.
Thank you!
I have found an application for blinking LED here:
http://www.oz1bxm.dk/PIC/628LED.htm
The application has been uploaded and working. I have also recompiled code and uploaded my HEX file, works also...
The problem appears when I try to code in C. This is what I get:
Rich (BB code):
#include <16F628A.h>
#use delay(clock=4000000)
#fuses NOWDT, HS, PUT, NOPROTECT, BROWNOUT, MCLR, NOLVP, NOCPD
void main(void)
{
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
set_tris_b(0b11111110);
while( 1 )
{
output_low(PIN_A2);
delay_ms(500);
output_high(PIN_A2);
delay_ms(500);
}
}
The code in the attachment. I have also included the 16F628A.h file. You can see my bread board on the image included. I do not have a pullup resistor. How critical is it?
I know assembler, but would preffer to write in C for now. Could you help me to rewrite the code into C? I am new in microcontroller programming.
Thank you!
Attachments
-
30.5 KB Views: 207
-
101.7 KB Views: 235