AnsweredAssumed Answered

Timing measurement

Question asked by Julian Cox on Jun 30, 2017
Latest reply on Jul 14, 2017 by Carlos_Mendoza

I am using a comparator to measure the time for a capacitor to charge up through a resistor, the other end of which is tied to a port pin. The time measured is then used to determine the value of the resistor (actually a NTC thermistor) and hence the temperature. The comparator uses component CMP1 with the on-chip bandgap voltage as the + input. I am using FC161:GetTicks16 to measure the time taken for the comparator to switch. Using the DEMOQE board everything worked fine and I was getting values of 19000 @ 25 degs and 300 @ 150 degs (comparable to results on a different processor type). I then moved over to a target board (S08SH4) which used identical components, but the values were 390 and 250. The comparator input waveforms were the same in both cases and I could see that the comparator tripped at the same point in time and voltage. It would appear that there is a timing issue as not only are the values different but the %ag change is also different.

Any help would be gratefully received.