Tech-supplies has no data on the IR pickup they supply, i can't be sure what frequency its for, so i have ordered some 38khz TSOP's from elsewhere which will be here in a week.
In the meantime i built a 555 circuit which seems to solve my problem, it inverts the signal, but goes high during the 38khz square wave. The PICaxe now fires on an interrupt as expected :
D0 = controller output
D1 = 555 timer circuit
D2 = output from PICaxe
The interrupt routine sets D2 high on entry, there is a 'pauseus 130' command and then it sets D2 low again. It rigidly sees this input now, no messing about.
So i tried the pulsin command that Hippy suggested, to read the new low-going pulses, and find that the PICaxe once again isn't consistent, its correct about 70% of the time. The pulsin command seems to ignore a high going pulse every now and then, or see one where there isn't one.
So i tried to use the settimer command in the interupt routine, but i find that this one settimer command takes 2.4ms which is longer that the pulses i'm trying to measure, so use of the settimer command is out of the window.
I'm stil using the SetInt command, could the problems i'm having be down to using this rather than hardware interupt? I'm still using SetInt instead of hardware intrupts because i can specify portC..
Are hardware intrupts only available on the first three pins of portB? Can anyone give me an example of the code for a hardware interupt to replace what i have now :
this one triggers the interupt on a high going signal on pin C.2. Am i missing something basic here?
I'm losing heart with the PICaxe.. can anyone convince me i'm going wrong somewhere and that all is not lost?
In the meantime i built a 555 circuit which seems to solve my problem, it inverts the signal, but goes high during the 38khz square wave. The PICaxe now fires on an interrupt as expected :
D0 = controller output
D1 = 555 timer circuit
D2 = output from PICaxe
The interrupt routine sets D2 high on entry, there is a 'pauseus 130' command and then it sets D2 low again. It rigidly sees this input now, no messing about.
So i tried the pulsin command that Hippy suggested, to read the new low-going pulses, and find that the PICaxe once again isn't consistent, its correct about 70% of the time. The pulsin command seems to ignore a high going pulse every now and then, or see one where there isn't one.
So i tried to use the settimer command in the interupt routine, but i find that this one settimer command takes 2.4ms which is longer that the pulses i'm trying to measure, so use of the settimer command is out of the window.
I'm stil using the SetInt command, could the problems i'm having be down to using this rather than hardware interupt? I'm still using SetInt instead of hardware intrupts because i can specify portC..
Are hardware intrupts only available on the first three pins of portB? Can anyone give me an example of the code for a hardware interupt to replace what i have now :
Code:
setint %00000100, %00000100, C 'Set interupt for PinC.2
I'm losing heart with the PICaxe.. can anyone convince me i'm going wrong somewhere and that all is not lost?