jonnybgood
Full Member level 4
Hi,
I will use an ISR that is restricted to 2μs. I will use PIC18F/PIC24F.
In this ISR the uC will be:
-Firing timer 1 (system clock)
-Stop CTMU current source (1 clock cycle)
-Perford ADC connversion (will use system clock)
-Save ADC to somewhere else (not in the original buffer)
-Drain ADC sampling cap (will only take 2 clock cyles)
-Switch on CTMU (will only take 1 clock cycle)
-I will then have to wait for the other rising edge(new input cycle) to stop the timer. How much latency will there be?
This whole cycle will happen only once - it is not repetitive.
If I will use a 20Mhz crystal, I will have 20clock cycles in 2μs. Am i right?
2/20Mhz=0.1μs.
What advantages would I have if I where to code the ISR in assembly language.
In C, MPLAB SIM I usually use stop watch to calculate exactly the clock cycles.
Any hints would be appreciated a lot.
thanks
I will use an ISR that is restricted to 2μs. I will use PIC18F/PIC24F.
In this ISR the uC will be:
-Firing timer 1 (system clock)
-Stop CTMU current source (1 clock cycle)
-Perford ADC connversion (will use system clock)
-Save ADC to somewhere else (not in the original buffer)
-Drain ADC sampling cap (will only take 2 clock cyles)
-Switch on CTMU (will only take 1 clock cycle)
-I will then have to wait for the other rising edge(new input cycle) to stop the timer. How much latency will there be?
This whole cycle will happen only once - it is not repetitive.
If I will use a 20Mhz crystal, I will have 20clock cycles in 2μs. Am i right?
2/20Mhz=0.1μs.
What advantages would I have if I where to code the ISR in assembly language.
In C, MPLAB SIM I usually use stop watch to calculate exactly the clock cycles.
Any hints would be appreciated a lot.
thanks