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

tachometer with pic16f887
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 04, 2009 12:25 pm     Reply with quote

Quote:
void main()
{

lcd_init();
//porturi();

while(1)
{
//front_display2();
//temperatura();
//ccp1_isr();
ccp1_isr();

turometru();
//voltmetru();
//rezervor();
//alternator();
//temperatura();
}

Here, you are attempting to call the isr. Don't do that.
The isr is called automatically when an interrupt occurs. You don't
call it yourself. You need to learn about micro-controllers.

Also, you are constantly calling your turometru() routine. That routine
initializes everything. You don't do that. You initialize everything one
time, at the start of the program.

Look at the thread on the tachometer code. You will not see all the stuff
that you're doing above, in that code. Please follow the code example.
soulraven



Joined: 08 Feb 2009
Posts: 72
Location: campulung muscel

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Mar 04, 2009 12:39 pm     Reply with quote

and how should I call subrutina? turometru ();
where ....
if you get out of while (1)
no longer works

Quote:
Also, you are constantly calling your turometru() routine. That routine
initializes everything. You don't do that. You initialize everything one
time, at the start of the program.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Mar 04, 2009 12:46 pm     Reply with quote

This is the original thread. Look at the code that I posted in that thread.
It shows how to do it.
http://www.ccsinfo.com/forum/viewtopic.php?t=29963
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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