Kommentar: Einfügen von HTML im Kommentar: Link einfügen: <a href="LINKURL" target="_blank">LINKTITEL</a> Bild einfügen: <img src="BILDURL"> Text formatieren: <b>fetter Text</b> <i>kursiver Text</i> <u>unterstrichener Text</u> Kombinationen sind auch möglich z.B.: <b><i>fetter & kursiver Text</i></b> C Quellcode formatieren: <code>Quellcode</code> BASIC Quellcode formatieren: <basic>Quellcode</basic> (Innerhalb eines Quellcodeabschnitts ist kein html möglich.) Wichtig: Bitte mache Zeilenumbrüche, bevor Du am rechten Rand des Eingabefeldes ankommst ! -> I > I want to measure the time between two pulses, from a Hall sensor. and send it via Rs232 to the PC. > To be used For measuring of an engine speed. > Code: > word PM_Value; > void Timer1_ISR(void) > { > int irqcnt; > PM_Value=Timer_T1GetPM(); > irqcnt=Irq_GetCount(INT_TIM1CAPT); > } > > void main(void) > { > byte n; > Serial_Init(0,SR_8BIT|SR_1STOP|SR_NO_PAR,SR_BD9600); > Irq_SetVect(INT_TIM1CAPT,Timer1_ISR); > Timer_T0PWM(100,PS0_64); // Start Pulse Generator Timer 0 > // Measurement starts here > // Output Timer0 OC0(PortB.3) connect to ICP(input capture pin, PortD.6) > PM_Value=0; > // Set mode to Pulse Width Measurement and determine prescaler > Timer_T1PM(0,PS_64); > while(PM_Value==0); // Measure Pulse Width or Period > Serial_Write(0,PM_Value); // Output Measuring Value > } > Is an there incorrect in this code? > Regards, Bram