Perhaps I should make my problem a little simpler: -
I have a capacitor being charged through a resistor. The resistor is fed by a port pin. and the capacitor voltage is fed to Comparator CPM1 - pin and the + pin is connected to the internal bandage supply.
I calculate that the time for the comparator to switch should be approx. 9ms and when I measure the time on an oscilloscope it is approx. 9ms.
When I activate the charging process I also reset and start component FC161:FreeCntr16. In the comparator ISR I read register TPM1CNT.
Using my DEMOQE I read approximately 18000 ticks which, with a 4MHz clock gives a tick frequency of 2MHz, which equates to 18000 ticks for 9ms. So far - so good.
Using my target S08SH4 board the comparator switches after 9ms, but I only get a tick count of 350.
I have checked everything I can, but where do I go next