View previous topic :: View next topic |
Author |
Message |
in_nursery
Joined: 25 Oct 2012 Posts: 51
|
16F18344 (Solved) |
Posted: Tue Dec 15, 2015 8:43 am |
|
|
Hi all
I try to make this work but the clock seems not running.
Code: | #include <16F18344.h>
#fuses NOEXTOSC
#fuses ECH
#fuses RSTOSC_HFINTRC
#use delay(internal=8MHz)
#define PIN_GREEN PIN_C3 // Green LED
void main()
{
//Setup Clock
setup_oscillator(OSC_HFINTRC_8MHZ);
while(TRUE)
{
output_high(PIN_GREEN);
delay_ms(1000);
output_low(PIN_GREEN);
}
} |
The green LED start and that's all, the prog is not running, what did I miss ?
Last edited by in_nursery on Tue Dec 15, 2015 10:07 am; edited 2 times in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9224 Location: Greensville,Ontario
|
|
Posted: Tue Dec 15, 2015 9:56 am |
|
|
{
output_high(PIN_GREEN);
delay_ms(1000);
output_low(PIN_GREEN);
}
you should add another delay_ms(1000);
after the output_low(PIN_GREEN);
as coded it turns on LED for 1 second then turns it off then on again.....
a 'scope would see it 'flash', but not us humans !
Jay |
|
|
in_nursery
Joined: 25 Oct 2012 Posts: 51
|
|
Posted: Tue Dec 15, 2015 10:05 am |
|
|
Oh NOOOOO I'm so bad , I focus on everything else and I haven't seen that.
Thanks Temtronic |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9224 Location: Greensville,Ontario
|
|
Posted: Tue Dec 15, 2015 12:57 pm |
|
|
Hate to say WHY I know about this .......
Welcome to the club!!
Jay |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Wed Dec 16, 2015 10:47 pm |
|
|
Yep - been there, done that
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|