just started on pcs this weekend and i've put together this led flasher circuit. It worked for a bit, the timing was much longer than the 500 ms that it was programmed for though(blame it on the breadboard?) at about 2-3 second intervals.
sorry, i don't have a schematic made up. XT is 4mgh, config set to HS. The caps going to ground are 22pf(datasheet says 15 but closes i have is 18)
Here's the code, i used mikroc, also i did not personally author the code
void main()
{
- TRISB = 0xFE; // set direction of RBO to output
//0xFE = 11111110
do // To set infinite loop
{
PORTB.F0 = 1; // Set RB0 to high
Delay_ms(500); // 500 mili seconds delay
PORTB.F0 = 0; // Set RB0 to low
Delay_ms(500); // 500 mili seconds delay
}while(1); // To set infinite loop
}
It was working for several minutes, then just stopped when I wasn't looking. Any ideas?
sorry, i don't have a schematic made up. XT is 4mgh, config set to HS. The caps going to ground are 22pf(datasheet says 15 but closes i have is 18)
Here's the code, i used mikroc, also i did not personally author the code
void main()
{
- TRISB = 0xFE; // set direction of RBO to output
//0xFE = 11111110
do // To set infinite loop
{
PORTB.F0 = 1; // Set RB0 to high
Delay_ms(500); // 500 mili seconds delay
PORTB.F0 = 0; // Set RB0 to low
Delay_ms(500); // 500 mili seconds delay
}while(1); // To set infinite loop
}
It was working for several minutes, then just stopped when I wasn't looking. Any ideas?
Attachments
-
298.6 KB Views: 39