I have an 12F683 , where im trying to make a double alternating strobe on GP0 and GP1 , it works , except it runs through the code 8 times then it stops and i have no idea why .
---------------------------------------------------------------------------
#include <system.h>
#pragma DATA _CONFIG, _MCLRE_OFF&_WDT_OFF&_INTRC_OSC_CLKOUT
#pragma CLOCK_FREQ 4000000
void main()
{ cmcon = 7;
trisio = 0b00001000;
gpio = 0;
delay_ms(500);
{ gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.1 = 1;
delay_ms(100);
gpio.1 = 0;
delay_ms(50);
gpio.1 = 1;
delay_ms(100);
gpio.1 = 0;
return;
}
}
-------------------------------------------------------------------------
So if someone can enlighten me i would really appreciate it.
---------------------------------------------------------------------------
#include <system.h>
#pragma DATA _CONFIG, _MCLRE_OFF&_WDT_OFF&_INTRC_OSC_CLKOUT
#pragma CLOCK_FREQ 4000000
void main()
{ cmcon = 7;
trisio = 0b00001000;
gpio = 0;
delay_ms(500);
{ gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.1 = 1;
delay_ms(100);
gpio.1 = 0;
delay_ms(50);
gpio.1 = 1;
delay_ms(100);
gpio.1 = 0;
return;
}
}
-------------------------------------------------------------------------
So if someone can enlighten me i would really appreciate it.
Last edited: