Double flash flip/flop with a PIC12
Notes:
Any switching NPN transistor will work.
U1 = PIC12Fxxx (675/629/684), check your datasheets to see if others will work with this..
code
#include <system.h>
#pragma DATA_CONFIG, _MCLRE_OFF&_WDT_OFF&_INTRC_OSC_CLKOUT
#pragma CLOCK_FREQ 4000000
void main()
{
cmcon =7;
trisio = 0b00001000
gpio = o;
delay_ms(500);
while (1)
{
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(150);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
}
return;
}
Notes:
Any switching NPN transistor will work.
U1 = PIC12Fxxx (675/629/684), check your datasheets to see if others will work with this..
code
#include <system.h>
#pragma DATA_CONFIG, _MCLRE_OFF&_WDT_OFF&_INTRC_OSC_CLKOUT
#pragma CLOCK_FREQ 4000000
void main()
{
cmcon =7;
trisio = 0b00001000
gpio = o;
delay_ms(500);
while (1)
{
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(150);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
delay_ms(50);
gpio.0 = 1;
delay_ms(100);
gpio.0 = 0;
}
return;
}
No comments:
Post a Comment