Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 19th April 2008, 07:33 AM   (permalink)
Experienced Member
neelam29 is infamous around these parts
Default rpm with pic 877

sooryyyyy rubbbish code ...was stupid mistake.please dont follow the code below..its wrongsooory again to bother

Last edited by neelam29; 19th April 2008 at 11:15 AM.
neelam29 is offline   Reply With Quote
Old 19th April 2008, 07:53 AM   (permalink)
Experienced Member
 
futz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to allfutz is a name known to all
Default

Is this what you meant to ask?
Code:
unsigned int TimerOverFlow;
float countLeft,TimerTimeLeft,TotalTimeTaken,RPM,x;

static void interrupt isr()
{
	if(INTF)
	{
		if(TMR1ON==0)
		{
			TimerOverFlow=0;
			TMR1H=0xFB;
			TMR1L=0x1D;
			TMR1ON=1;
		}
		else
		{
			TMR1ON=0;
			INTE=0;
			countLeft=(TMR1H*256+TMR1L)-0xFB1D;
			TimerTimeLeft=countLeft/125000;
			TotalTimeTaken=TimerOverFlow*0.01+TimerTimeLeft;
			x=countLeft;
			RPM=60/TotalTimeTaken;
			TimerOverFlow=0;
			TMR1H=TMR1L=0;
			INTE=1;
			TMR1ON=1;
		}
		INTF=0;
	}
	if(TMR1IF)
	{
		TMR1H=0xFB;
		TMR1L=0x1D;
		TimerOverFlow++;
		TMR1IF=0;
	}
}

//////////////////////////////////

void main(void){
	unsigned RPMReadingHold;
	TRISA = TRISC = 0x00;
	PORTA = PORTC = 0x00;

	INTCON=0xC0;
	INTE=1;
	T1CON=0X30;
	TMR1H=0xFB;
	TMR1L=0x1E;
	INTEDG=1;
Please use code tags when posting code, or it turns into the mess in your post. Just click on the # in the menu just before pasting your code. With proper code tags the code will hold its formatting (mostly) and be readable.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline   Reply With Quote
Old 19th April 2008, 11:13 AM   (permalink)
Experienced Member
neelam29 is infamous around these parts
Default

sorry the code is wrong...got the stupid mistake
neelam29 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Hall-Effect -> PIC rackley General Electronics Chat 9 2nd March 2008 10:21 AM
Quik PIC Programming kit Krumlink General Electronics Chat 5 27th January 2008 11:27 PM
Capturing and reproducing audio with a PIC Fred.Amoson Micro Controllers 14 14th December 2007 08:21 PM
Problems switchin relay with PIC Andy1845c General Electronics Chat 5 17th November 2007 06:13 PM
High ADC sampling rate PIC, 18F needed? bananasiong Micro Controllers 24 28th October 2007 12:13 PM



All times are GMT. The time now is 10:33 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.