Hi all.
Before I start, I just want to say how impressed I am by the picaxe system itself and the forums as well. I have had many questions answered already, thanks to your patient and knowledgeable efforts. Thanks in advance for any advice!
So, I am working on an RF project, trying to create a modulation circuit for a 13.56 MHz system. I am hoping that I can use a picaxe to generate the control signal, but am running into some timing difficulties. Specifically, I need to be able to generate 50, 100, and 150 microsecond high pulses, separated by 10us lows. So far, I have been able to do everything except the 50us high using the pulsout command. Essentially, I am using the inherent processing time between commands for my timing. I am using a 28x1 with an external 16MHz crystal. The code below is test code, just trying to get the pulses sorted out.
What I am seeing on the oscilloscope is a high signal, with 10 us low pulses separated by approximately 96us or 175us, both of which are within tolerance for the modulation. The remaining problem, though, is that the entire signal must be "framed" by a 50us high followed by a 150us high at the start, and ended with a 50us high followed by a 100us high.
Are there any tricks out there to cut down the processing time? Maybe (although I don't want to) converting it to assembler code and making some strategic changes? I do not have a 28x2 on hand, or I would try going to 32MHz or 40MHz.
Also, I am wondering how reliable the timing would be with varying temperature, etc.
Thank you, again, for any advice you may have!
-Scott
Before I start, I just want to say how impressed I am by the picaxe system itself and the forums as well. I have had many questions answered already, thanks to your patient and knowledgeable efforts. Thanks in advance for any advice!
So, I am working on an RF project, trying to create a modulation circuit for a 13.56 MHz system. I am hoping that I can use a picaxe to generate the control signal, but am running into some timing difficulties. Specifically, I need to be able to generate 50, 100, and 150 microsecond high pulses, separated by 10us lows. So far, I have been able to do everything except the 50us high using the pulsout command. Essentially, I am using the inherent processing time between commands for my timing. I am using a 28x1 with an external 16MHz crystal. The code below is test code, just trying to get the pulses sorted out.
Code:
' *************************************
' * Testing of pulsewidths *
' * 50us, 100us, and 150us pulses *
' * are desired, with 10us low pauses *
' *************************************
setfreq em16
high 1
zero: '100us pulse desired
pulsout 1, 4 'gives approx. 10us low
pulsout 1, 4
one: '150us pulse desired
pulsout 1, 4
pauseus 1
pulsout 1, 4
' ***
' * Sring together to get total signal
' ***
example: 'binary 0010110
pulsout 1, 4 'start of modulation
pulsout 1, 4 '0
pulsout 1, 4 '0
pauseus 1
pulsout 1, 4 '1
pulsout 1, 4 '0
pauseus 1
pulsout 1, 4 '1
pauseus 1
pulsout 1, 4 '1
pulsout 1, 4 '0
pauseus 10 'finish modulation
Are there any tricks out there to cut down the processing time? Maybe (although I don't want to) converting it to assembler code and making some strategic changes? I do not have a 28x2 on hand, or I would try going to 32MHz or 40MHz.
Also, I am wondering how reliable the timing would be with varying temperature, etc.
Thank you, again, for any advice you may have!
-Scott