arduino simple start stop timer with high resolution < 0.5 us

Hello,

I am a relatively new user of Arduino. I like to measure the capacitor discharge time using timer as counter by directly reading the analog voltage comparing with a threshold.

if I want to measure capacitance of pF, then I need timer accuracy of 0,5us or even less than this. I believe one can get higher resolution timing with Timer1 than timer0 and 2.

Also, I always see that the timers are used

  1. to generate interrupt by changing the pin state
  2. to run on fixed interval eg., Output Compare Match:
  3. to count pulse on the pins and PWM generation

But I could not find a simple timer which can be started and stopped at user's will.
In my case I like to start the timer when the capacitor is just started charging and stop at the point at which capacitor voltage reached a threshold.

I think the code given by @dc42 (posted in this thread High Precision Timing / Feasibility - Project Guidance - Arduino Forum) suits my requirement, but I could not understand the code. Can anyone provide detailed comments for his code (present just one above this message)? Alternatively, if someone can help me with using timer1 to configure (with < 0,5us resolution), start and stop when required by user without using interrupts.

have a nice day guys..

Thanks in advance
-Muthu

Hello Tom,

Thanks for your quick reply.

I created a new thread..

ques: envisaging the pF capacitance measurement

I just used a resistor and the capacitive sensor connected in series as shown in the attachment.

one can either measure the time constant (which then later used to find the unknown capacitance) during charging or discharging and the formula to calculate the capacitance is shown in attachment.

During charging (refer to attachment and pin designation)
Dig Pin 2 : OUTPUT (configured)
value : HIGH

During discharging
Dig Pin 2 : OUTPUT (configured)
value : LOW (so that capacitor starts discharging through resistor.
Ana A0 gives 100Mohm input impedance good enough to measure the voltage (of the cap)

ques: How much charging current?

I didnt measure it and as the input impedance is fixed I am not concerned.

ques: What charging reference voltage will you use?
Power supply for the capacitance charging is 5V (supplied by Ard. Uno)

Thanks
Muthu

schematics.jpg

cap_charging.jpg

Starting the charging process and the timer with 62.5ns resolution when setting pin 2 HIGH is trivial.

Timer is in normal mode with prescaler = 1. In this mode you will only be able to count for a little over four milliseconds before the timer rolls over. Dealing with rollover to preserve the resolution for longer time periods will complicate the code.

void startMeasurement()
{
TCCR1B = 0;//stop timer
TCNT1 = 0;//clear timer counts
digitalWrite(2, HIGH);// this is best done with a register command and not digitalWrite()
TCCR1B = 1<<CS10;// start time with prescaler = 1. 62.5ns per count
}

How will you know when to stop the timer and read the value of TCNT1??

Hello "Cattledog",
Thank you very much for your suggestion, which I have incorporated in my code.

Hello All,

I have incorporated the capacitive measurment using two Digital pins instead of using one digital and an analog pin, which was for reading the voltage transition.

I try to use the digital pin with "attach interrupt" function in mode - FALLING. I am using Timer1 with prescaler =1 and starting the timer just when the discharging starts and stop when the voltage across the capacitor makes a transition from High to Low. But the timer counts across consecutive discharging cycles is varying erroneously.
Can anyone tell me what might be the Problem in the code as the timer counts are not the same (stable) or atleast with in a good tolerance.

circuit schematics : a resistor is connected between pin 4 and pin2, a capacitor is connected between pin2 and GND. Digital pin2 and Analog A0 are shorted (to measure the capacitance voltage - for debugging purpose).

I provide my code here.

float capVolt;
float capVolt_raw;

// unsigned long startvalue; // long int max value 4,294,967,295
unsigned long timer1_currentvalue;
unsigned long dischargeTime_ns;
unsigned long capacitance_pF;

int ISR_read =0;
int outputpin = 4;
int timer_running =0;

const byte interruptPin = 2;

void setup() {
  // put your setup code here, to run once:

  // two IO pins required for capacitance measurement
  // Digi Pin 4 is configured as Output to charge the unknown capacitance.
  pinMode(outputpin,OUTPUT);
  digitalWrite(outputpin,LOW);
  // Digi Pin 2 (an interrupt pin) is configured as Input to measure the unknown capacitance.
  // digital pin as input provides high impedance state
  pinMode(interruptPin,INPUT);

  // while the Cap discharge, its voltage transition from High to Low at 2,42V triggers the ISR.
  
  // attachInterrupt(digitalPinToInterrupt(interruptPin), ISR_state_high_to_low, FALLING);  

  attachInterrupt(0, ISR_state_high_to_low, FALLING);  

  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:

  // discharge cap if any charge left
  // digitalWrite(outputpin,LOW);
  PORTD = PORTD & B11101111; 
  
  delay (500);
  
  
     // R-C measurement, R = 1M ohm; Capacitance value eg., 10pF  
    
     // start charging capacitor  ===================================================
     // digitalWrite(outputpin,HIGH);
     PORTD = PORTD | B0010000; 
     delay (1000); 
     // now capacitor is fully charged=================================================
    
    
     // start discharging capacitor  ===================================================
       // digitalWrite(outputpin,LOW);
       PORTD = PORTD & B11101111; 

       if (timer_running == 0)
       {
          // Congigure Timer1
         TCCR1B = 0;//stop timer
         TCNT1 = 0;//clear timer counts
        TCCR1B = 1<<CS10;// start timer with prescaler = 1;  62.5ns per count
        timer_running =1;          
       }
       
       while (ISR_read == 0)
       {
       readVoltage();      
       }
       
       if (ISR_read == 1)
       {
          ISR_read =0;
                
          TCCR1B = 0;//stop timer
           TCNT1 = 0;//clear timer counts
           readVoltageISR();
    
           
           Serial.println("timer1 counts ");
           Serial.println(timer1_currentvalue);

           
         /* dischargeTime_ns = timer1_currentvalue; // 1 count = 62.5ns 
           dischargeTime_ns = (dischargeTime_ns * 62.5);
           Serial.println("Capacitor dischargeTime ns ");
           Serial.println(dischargeTime_ns);
           
           // ln (V1 / V tl) = ln (5V/2.42V) = 1,378
           capacitance_pF = (dischargeTime_ns * 1378)/1000;
           Serial.println("Capacitor value fF ");
           Serial.println(capacitance_pF);
           capacitance_pF = capacitance_pF/1000;
           Serial.println("Capacitor value pF ");
           Serial.println(capacitance_pF);*/
       } 
         // to stop serial communication , user must input 'a' 
              if(Serial.available() > 0)
              {   char ch = Serial.read();
                  if(ch == 'a')
                  {  while(1);          
                  }        
              }
          delay(1000);  
          
    
  }

void readVoltage()
{
  
  capVolt_raw = analogRead(A0);
  capVolt = capVolt_raw * ( 5.0 / 1023.0);
  Serial.println("Cap current value (V)");
  Serial.println(capVolt);
}

void ISR_state_high_to_low()
{
   TCCR1B = 0;//stop timer
  timer1_currentvalue = TCNT1;
  ISR_read = 1;
  timer_running =0;
}
  

void readVoltageISR()
{
   Serial.println("ISR triggered");
  /*capVolt_raw = analogRead(A0);
  capVolt = capVolt_raw * ( 5.0 / 1023.0);
  Serial.println("ISR triggered Cap voltage value");
  Serial.println(capVolt);*/
}

Also I like to provide you with the code output (obtained through serial communication) with code tagging, so to avoid scrolling and not making it a big page..
Please look at the TImer1 counts value (which is not stable)

Cap current value (V)
4.80
Cap current value (V)
4.42
Cap current value (V)
4.07
Cap current value (V)
3.64
Cap current value (V)
2.63
ISR triggered
timer1 counts 
32
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.23
Cap current value (V)
3.77
Cap current value (V)
2.72
ISR triggered
timer1 counts 
226
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.23
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
54
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
194
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
217
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
219
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.77
Cap current value (V)
2.72
ISR triggered
timer1 counts 
27
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.23
Cap current value (V)
3.77
Cap current value (V)
2.72
ISR triggered
timer1 counts 
196
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.22
Cap current value (V)
3.77
Cap current value (V)
2.72
ISR triggered
timer1 counts 
19
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.23
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
130
Cap current value (V)
4.98
Cap current value (V)
4.58
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
67
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
171
Cap current value (V)
4.98
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
248
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.77
Cap current value (V)
2.73
ISR triggered
timer1 counts 
5
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.23
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
242
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.23
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
18
Cap current value (V)
4.99
Cap current value (V)
4.58
Cap current value (V)
4.22
Cap current value (V)
3.77
Cap current value (V)
2.72
ISR triggered
timer1 counts 
226
Cap current value (V)
4.99
Cap current value (V)
4.59
Cap current value (V)
4.22
Cap current value (V)
3.78
Cap current value (V)
2.72
ISR triggered
timer1 counts 
18

Could be problem with the timer configuration. I am doubtful in the way I read the timer counts. I just stopped the timer when the ISR hits and take this value to multiply with 62,5ns to get the time in ns.

Do my code is not optimised enough to make 62,5ns resolution measurement or the oscillator is not stable with prescalar "1".

Kindly give your suggestions.

Thanks in advance
muthu.

I believe that you are overflowing the timer and are seeing small variations in a large number of counts.

I see that you get five serial printouts at 115200 baud during the discharge period.

Cap current value (V)
3.77

Lets say that is 25 characters at 10 bits per character(one byte plus stop/start). 25510 = 1250
1250/115200 is approximately 11 milliseconds. The 16 bit timer with prescaler 1 will overflow in a bit over 4 ms.

To test this out, you can set the prescaler to 8, and you will avoid overflow. Resolution will be .5 microseconds instead of .0625 microsecond. See if this change stabilizes the readings.

//TCCR1B = 1<<CS10;// start timer with prescaler = 1;  62.5ns per count
TCCR1B = 1<<CS11;// start timer with prescaler = 8;  .5us per count

I you want to keep the higher resolution you will need to work with a timer overflow interrupt and keep track of the overflow counts.

What is the value of your capacitor/resistor and the expected discharge time?

void ISR_state_high_to_low()
{
  TCCR1B = 0;//stop timer
  timer1_currentvalue = TCNT1;
  ISR_read = 1;
  timer_running =0;
}

The three variables changed within the isr and referenced outside of the isr should be declared as volatile. The timer1_curentvalue can be an unsigned int and the flag variables should be declared as bytes.

volatile unsigned int timer1_currentvalue;
volatile byte ISR_read =0;
volatile byte timer_running =0;

There maybe an issue with your code and the Timer 0 interrupts used for the millis() timer, can possibly change some of the timing of the execution of the external interrupt triggering the timer stop. Once you get the program working with more stability, you can address the issues of fine timing. It's possible that using the input capture interrupt on the timer will work with less latency than the external interrupt.

Thank you very much for your suggestions - "cattledog"

I found that with prescalar = 8, the timer counts are in a good range (so stable) and hence I would conclude that the oscillator is not stable with prescalar =1.

So the max resolution I can get is only 0.5us. When I need 5ns resolution (100 x more resolution ), then which controller board of Arduino can I use?

Also, I tried measuring 21,55 pF capacitance and I got timer counts of 239 (average of 10 consecutive measurements) and when I went for 43 pF, then the timer counts were only around 10 (counts) and I suppose that the timer counter needs to be accessed with TCNT1L and TCNT1H instead of TCNT1. But i tried with this code (given below) but the same results

timer1_currentvalue = (TCNT1H<< 8) | (TCNT1L); // instead of timer1_currentvalue = TCNT1

If my understanding is correct then please tell me how to read the 16 bit counter. If not , then what would be the reason that I get few counts when I go for higher capacitance.

I am facing parasitic capacitance with my measurement setup as I am in pF range measurement. I am working with my measurement setup now and will update more results on coming Monday.

until then
bye from Muthu...

I found that with prescalar = 8, the timer counts are in a good range (so stable) and hence I would conclude that the oscillator is not stable with prescalar =1.

No you misunderstand. The issue with the prescaler =1 is that there is TCNT1 rollover in the range of your time period measurements. You can use the .0625 us (16Mhz) count resolution if you use a timer overflow interrupt and count the overflows, and correct the readings to include the overflow amounts.

I would advise you study of Nick Gammon's timer tutorial which has several example of counting and accomodating overflow counts. Gammon Forum : Electronics : Microprocessors : Timers and counters

When I need 5ns resolution (100 x more resolution ), then which controller board of Arduino can I use?

With a 16MHz processor you can resolve 62.5 ns. There are other issues of "latency", that is, the time it takes for the code to execute instructions. So you are basically looking for something at 180MHz or greater. There are probably some ESP32 boards or Teensy 3.6 which might be of adequate speed. I have no experience with faster processors than the AT328, and can't really advise you.

Can you please explain what your project is all about, and what you are trying to achieve. I think that you are getting into difficult territory trying to resolve 5 ns. It will involve significant research on your part. There maybe external hardware timer/counters which could be controlled by an Arduino.

Making accurate Picofarad capacitance measurements with rc time constants with a triggered timer/counter is not trivial. Do you have an oscilloscope to use to help confirm what you are doing?

I suppose that the timer counter needs to be accessed with TCNT1L and TCNT1H instead of TCNT1.

No. The Arduino IDE takes care of properly reading the high and low register when you read or set TCNT1.

If not , then what would be the reason that I get few counts when I go for higher capacitance.

Perhaps you are experiencing timer rollover. What is missing from your posts, is the capacitance and resistance you are using, the expected time constant, and what counts you would expect for the interrupt to trigger. Do your measurements make physical sense?

Thank you very much again for your suggestions - "cattledog"

cattledog:
Can you please explain what your project is all about, and what you are trying to achieve.

I have already explained in detail about my project in the beginning along with circuit schematic. I am just charging a resistor and unknown capacitor connected in series and try to measure the voltage across the capacitor when it is discharging.

I have used pin header to fit many standard capacitors (lead type), connecting to Arduino pin2 and ground. This I do to simulate the change in unknown capacitance.

I have done measurements -each capacitance for 20 cycles and made average and is available in the attached file. Config: timer prescalar =8 ie., 0,5us resolution

Also, i provide the output data log from my code.

info: open capacitance measurement(when no standard capacitor(s) connected)


Cap current value (V)
3.19
ISR triggered Cap voltage value
0.12
timer1 counts
470
==================================
Cap current value (V)
2.94
ISR triggered Cap voltage value
0.12
timer1 counts
485
==================================
Cap current value (V)
2.92
ISR triggered Cap voltage value
0.15
timer1 counts
485
==================================
Cap current value (V)
3.26
ISR triggered Cap voltage value
0.15
timer1 counts
465
==================================
Cap current value (V)
3.26
ISR triggered Cap voltage value
0.12
timer1 counts
467
==================================
Cap current value (V)
3.26
ISR triggered Cap voltage value
0.12
timer1 counts
467
==================================
Cap current value (V)
2.91
ISR triggered Cap voltage value
0.12
timer1 counts
487
==================================
Cap current value (V)
3.33
ISR triggered Cap voltage value
0.12
timer1 counts
462
==================================
Cap current value (V)
2.89
ISR triggered Cap voltage value
0.12
timer1 counts
487
==================================
Cap current value (V)
3.00
ISR triggered Cap voltage value
0.00
timer1 counts
482
==================================
Cap current value (V)
3.40
ISR triggered Cap voltage value
0.15
timer1 counts
458
==================================
Cap current value (V)
3.37
ISR triggered Cap voltage value
0.15
timer1 counts
460
==================================
Cap current value (V)
3.34
ISR triggered Cap voltage value
0.12
timer1 counts
462
==================================
Cap current value (V)
3.22
ISR triggered Cap voltage value
0.12
timer1 counts
468
==================================
Cap current value (V)
2.88
ISR triggered Cap voltage value
0.12
timer1 counts
490
==================================
Cap current value (V)
2.94
ISR triggered Cap voltage value
0.12
timer1 counts
485
==================================
Cap current value (V)
3.00
ISR triggered Cap voltage value
0.00
timer1 counts
480
==================================
Cap current value (V)
3.18
ISR triggered Cap voltage value
0.15
timer1 counts
470
==================================
Cap current value (V)
3.37
ISR triggered Cap voltage value
0.14
timer1 counts
460
==================================
Cap current value (V)
3.18
ISR triggered Cap voltage value
0.12
timer1 counts
470
==================================
Cap current value (V)
3.17
ISR triggered Cap voltage value
0.12
timer1 counts
470
timer counts mean value
473
timer counts max value
490
timer counts min value
458
----------------------------------------------------------------------------------------------
info : when 10pF connected

Cap current value (V)
3.62
ISR triggered Cap voltage value
0.10
timer1 counts
578
==================================
Cap current value (V)
3.28
ISR triggered Cap voltage value
0.09
timer1 counts
595
==================================
Cap current value (V)
3.26
ISR triggered Cap voltage value
0.11
timer1 counts
597
==================================
Cap current value (V)
3.29
ISR triggered Cap voltage value
0.12
timer1 counts
595
==================================
Cap current value (V)
3.56
ISR triggered Cap voltage value
0.11
timer1 counts
582
==================================
Cap current value (V)
3.68
ISR triggered Cap voltage value
0.10
timer1 counts
575
==================================
Cap current value (V)
3.26
ISR triggered Cap voltage value
0.10
timer1 counts
597
==================================
Cap current value (V)
3.44
ISR triggered Cap voltage value
0.09
timer1 counts
587
==================================
Cap current value (V)
3.19
ISR triggered Cap voltage value
0.09
timer1 counts
602
==================================
Cap current value (V)
3.62
ISR triggered Cap voltage value
0.11
timer1 counts
578
==================================
Cap current value (V)
3.60
ISR triggered Cap voltage value
0.00
timer1 counts
580
==================================
Cap current value (V)
3.30
ISR triggered Cap voltage value
0.11
timer1 counts
595
==================================
Cap current value (V)
3.48
ISR triggered Cap voltage value
0.09
timer1 counts
585
==================================
Cap current value (V)
3.56
ISR triggered Cap voltage value
0.09
timer1 counts
580
==================================
Cap current value (V)
3.30
ISR triggered Cap voltage value
0.11
timer1 counts
595
==================================
Cap current value (V)
3.38
ISR triggered Cap voltage value
0.09
timer1 counts
590
==================================
Cap current value (V)
3.51
ISR triggered Cap voltage value
0.11
timer1 counts
583
==================================
Cap current value (V)
3.65
ISR triggered Cap voltage value
0.12
timer1 counts
577
==================================
Cap current value (V)
3.62
ISR triggered Cap voltage value
0.12
timer1 counts
578
==================================
Cap current value (V)
3.49
ISR triggered Cap voltage value
0.10
timer1 counts
585
==================================
Cap current value (V)
3.46
ISR triggered Cap voltage value
0.10
timer1 counts
587
timer counts mean value
586
timer counts max value
602
timer counts min value
575
-----------------------------------------------------------------------------------------

As you can see in the excel file, the range of the timer counts is around 25 when measuring capacitance of tens of pF. I wanted highly repeatable counts so that I can be good a resolutions.

one can also see that the baselined value (column G) do not show proportional increase. this may be because of the pin header contributing to small additional capacitance.

Second major problem, I see is that the ISR triggering voltage is not the same for different capacitance values and even for a particular capacitance measurement deviation is ~ 20mV (which is not accectable for accurate measurement). I know that there is an offset between the voltage at which iSR triggers and the value that we see in serial communication. This is not a problem for me, but the offset should be the same and there should be some way to know this voltage at which transition (high to low) or ISR trigger occurs, so that the capacitance can be calculated with correction.

For small capacitance the ISR voltage that we see is very meagre , may be very few charges are stored and it gets discharged in few ns and as the analog read takes more time to read it miss the transition level by large time.

I plan to repeat the measurement of small cap with prescalar =1. I will post the results later on 1st May, as I am going on vacation.

info : 10 +10 pF measurement
Cap current value (V)
3.73
ISR triggered Cap voltage value
0.07
timer1 counts
710
==================================
Cap current value (V)
3.54
ISR triggered Cap voltage value
0.08
timer1 counts
718
==================================
Cap current value (V)
3.84
ISR triggered Cap voltage value
0.09
timer1 counts
703
==================================
Cap current value (V)
3.45
ISR triggered Cap voltage value
0.09
timer1 counts
723
==================================
Cap current value (V)
3.77
ISR triggered Cap voltage value
0.09
timer1 counts
707
==================================
Cap current value (V)
3.88
ISR triggered Cap voltage value
0.08
timer1 counts
702
==================================
Cap current value (V)
3.51
ISR triggered Cap voltage value
0.08
timer1 counts
720
==================================
Cap current value (V)
3.90
ISR triggered Cap voltage value
0.09
timer1 counts
702
==================================
Cap current value (V)
3.66
ISR triggered Cap voltage value
0.08
timer1 counts
712
==================================
Cap current value (V)
3.52
ISR triggered Cap voltage value
0.09
timer1 counts
718
==================================
Cap current value (V)
3.63
ISR triggered Cap voltage value
0.09
timer1 counts
713
==================================
Cap current value (V)
3.55
ISR triggered Cap voltage value
0.10
timer1 counts
717
==================================
Cap current value (V)
3.84
ISR triggered Cap voltage value
0.08
timer1 counts
705
==================================
Cap current value (V)
3.81
ISR triggered Cap voltage value
0.07
timer1 counts
705
==================================
Cap current value (V)
3.51
ISR triggered Cap voltage value
0.08
timer1 counts
720
==================================
Cap current value (V)
3.45
ISR triggered Cap voltage value
0.08
timer1 counts
723
==================================
Cap current value (V)
3.51
ISR triggered Cap voltage value
0.09
timer1 counts
720
==================================
Cap current value (V)
3.41
ISR triggered Cap voltage value
0.09
timer1 counts
725
==================================
Cap current value (V)
3.65
ISR triggered Cap voltage value
0.09
timer1 counts
713
==================================
Cap current value (V)
3.72
ISR triggered Cap voltage value
0.08
timer1 counts
708
==================================
Cap current value (V)
3.71
ISR triggered Cap voltage value
0.08
timer1 counts
710
timer counts mean value
713
timer counts max value
725
timer counts min value
702
-----------------------------------------------------------------------------------------
info : 2150 nF measurement

Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26670
==================================
Cap current value (V)
4.97
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26606
==================================
Cap current value (V)
4.96
Cap current value (V)
3.67
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26596
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.68
ISR triggered Cap voltage value
1.97
timer1 counts
26616
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.68
ISR triggered Cap voltage value
1.97
timer1 counts
26624
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26607
==================================
Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26669
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.98
timer1 counts
26611
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26253
==================================
Cap current value (V)
4.97
Cap current value (V)
3.65
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26668
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.67
ISR triggered Cap voltage value
1.97
timer1 counts
26661
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26581
==================================
Cap current value (V)
4.97
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26554
==================================
Cap current value (V)
4.95
Cap current value (V)
3.66
Cap current value (V)
2.71
ISR triggered Cap voltage value
1.99
timer1 counts
26612
==================================
Cap current value (V)
4.95
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26625
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26618
==================================
Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.67
ISR triggered Cap voltage value
1.97
timer1 counts
26246
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26206
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26568
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.98
timer1 counts
26662
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26596
timer counts mean value
26562
timer counts max value
26670
timer counts min value
26206
--------------------------------------------------------------------------------------
info : 1460 pF measurement

Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26670
==================================
Cap current value (V)
4.97
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26606
==================================
Cap current value (V)
4.96
Cap current value (V)
3.67
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26596
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.68
ISR triggered Cap voltage value
1.97
timer1 counts
26616
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.68
ISR triggered Cap voltage value
1.97
timer1 counts
26624
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26607
==================================
Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26669
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.98
timer1 counts
26611
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26253
==================================
Cap current value (V)
4.97
Cap current value (V)
3.65
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26668
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.67
ISR triggered Cap voltage value
1.97
timer1 counts
26661
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26581
==================================
Cap current value (V)
4.97
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26554
==================================
Cap current value (V)
4.95
Cap current value (V)
3.66
Cap current value (V)
2.71
ISR triggered Cap voltage value
1.99
timer1 counts
26612
==================================
Cap current value (V)
4.95
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26625
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26618
==================================
Cap current value (V)
4.95
Cap current value (V)
3.64
Cap current value (V)
2.67
ISR triggered Cap voltage value
1.97
timer1 counts
26246
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.98
timer1 counts
26206
==================================
Cap current value (V)
4.96
Cap current value (V)
3.65
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.99
timer1 counts
26568
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.70
ISR triggered Cap voltage value
1.98
timer1 counts
26662
==================================
Cap current value (V)
4.96
Cap current value (V)
3.66
Cap current value (V)
2.69
ISR triggered Cap voltage value
1.97
timer1 counts
26596
timer counts mean value
26562
timer counts max value
26670
timer counts min value
26206
----------------------------------------------------------------------
info : 4771pF measurements

Cap current value (V)
4.75
Cap current value (V)
4.15
Cap current value (V)
3.62
Cap current value (V)
3.15
ISR triggered Cap voltage value
1.97
timer1 counts
15261535
==================================
Cap current value (V)
4.99
Cap current value (V)
4.33
Cap current value (V)
3.76
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59290
==================================
Cap current value (V)
4.98
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59309
==================================
Cap current value (V)
4.99
Cap current value (V)
4.35
Cap current value (V)
3.78
Cap current value (V)
3.30
ISR triggered Cap voltage value
2.06
timer1 counts
59205
==================================
Cap current value (V)
4.98
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59235
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59224
==================================
Cap current value (V)
4.98
Cap current value (V)
4.34
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59256
==================================
Cap current value (V)
4.99
Cap current value (V)
4.35
Cap current value (V)
3.76
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.05
timer1 counts
59180
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.06
timer1 counts
59200
==================================
Cap current value (V)
4.98
Cap current value (V)
4.33
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59305
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
58738
==================================
Cap current value (V)
4.98
Cap current value (V)
4.34
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59282
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
59225
==================================
Cap current value (V)
4.99
Cap current value (V)
4.33
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.06
timer1 counts
59241
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
59341
==================================
Cap current value (V)
4.98
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
59235
==================================
Cap current value (V)
4.98
Cap current value (V)
4.33
Cap current value (V)
3.76
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.05
timer1 counts
59310
==================================
Cap current value (V)
4.98
Cap current value (V)
4.33
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
59280
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.77
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.05
timer1 counts
58810
==================================
Cap current value (V)
4.99
Cap current value (V)
4.35
Cap current value (V)
3.76
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.06
timer1 counts
59235
==================================
Cap current value (V)
4.98
Cap current value (V)
4.33
Cap current value (V)
3.77
Cap current value (V)
3.28
ISR triggered Cap voltage value
2.05
timer1 counts
59307
==================================
Cap current value (V)
4.99
Cap current value (V)
4.34
Cap current value (V)
3.78
Cap current value (V)
3.29
ISR triggered Cap voltage value
2.05
timer1 counts
59234
timer counts mean value
59210
timer counts max value
59341
timer counts min value
58738

can anyone reply for my post above.

Thanks in advance

Read here:
https://www.google.com/search?q=atmega328+transistor+tester+pdf
:slight_smile: