Settimer and Pulsin - 28X2

IanH1960

New Member
Hi,

I've been using pulsin on a 28X2 at 40 MHz to read pulse lengths up to about 4 ms in length. When I run settimer at the same time the time base of the pulsin measurement changes.

At 40 MHz the pulsin unit of measurement is nominally 1 us, with settimer running it changes to about 2.16us (a pulse measured originally as 4000 units long changes to 1850 units when settimer is on). This appears to be consistent in the program I'm running so it isn't too much of an issue for me at the moment as I can adjust my sums to suit, however I didn't see any reference to pulsin/timer1 possible conflict issues in the manual.

I'm also using pwm at the same time and this got me wondering if there are any PWM/settimer issues also? Manual indicates PWM uses the timer2 module and settimer uses timer1 so I had assumed no problem.

Ian
 

hippy

Technical Support
Staff member
I'm not sure what the situation should be with PULSIN but there are two options; disrupt the PULSIN timing or disable SETTIMER handling during PULSIN, it appears the former is happening when perhaps it should be the later.

Trying to do two concurrent timed events or handling any interrupt whilst timing poses a problem for a PICAXE and most other microcontrollers. This is what the Appendix in Manual 2 indicates but it doesn't explicitly list PULSIN. I will pass the issue on for further investigation.
 
Top