CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

16F18344 (Solved)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
in_nursery



Joined: 25 Oct 2012
Posts: 51

View user's profile Send private message

16F18344 (Solved)
PostPosted: Tue Dec 15, 2015 8:43 am     Reply with quote

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: 9142
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 15, 2015 9:56 am     Reply with quote

{
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

View user's profile Send private message

PostPosted: Tue Dec 15, 2015 10:05 am     Reply with quote

Oh NOOOOO I'm so bad Evil or Very Mad , I focus on everything else and I haven't seen that.
Thanks Temtronic
temtronic



Joined: 01 Jul 2010
Posts: 9142
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 15, 2015 12:57 pm     Reply with quote

Hate to say WHY I know about this .......

Welcome to the club!!

Jay
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Wed Dec 16, 2015 10:47 pm     Reply with quote

Yep - been there, done that Shocked

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group