Hi all,
I’m new to the forum and to PICAXE. I have been doing some reading in the manuals with more to go…
I have a model receiver outputting pulse width varying from 0 to 656usec every 1.020ms. I would like to use PICAXE 08m capabilities to build a converter to read those 0 to 656usec pulses and convert those pulses to 1 to 2 msec at 20msec period, f=50hz.
After studying the manual initially, I am confused about the units (sec, msec, usec ???) in the pwmout, and pwmduty command.
I also tried to place 50hz in the pwmout wizard to automatically calculate the command. The wizard indicated 50hz was outside the calculation range.
Also any clarification or reading guidance on what unit of time should be used in the pwmout and pwmduty would be helpful.
Below is a real rough initial brainstorming draft before I go the wrong direction too far. Anyone have any ideas or some handy commands for this type project I could study further would be great...
Tks.
INIT:
pwmout C.2, 20msec, dc ; PWMOUT pin, period, duty cycle initialized at 20msec
STICK:
Pulsin C.1, 1, pulse1 ; Read pulses in usec form from receiver output
If pulse1 =>10usec and <20usec then DC=1.00 msec ;33 segments convert usec to msec pulses
If pulse1= >160usec and <180usec then DC=1.25 msec
If pulse1 =>640usec and <660usec then DC=2.00 msec
Pwmduty C.2, dc ; generate msec pulses
Goto STICK
I’m new to the forum and to PICAXE. I have been doing some reading in the manuals with more to go…
I have a model receiver outputting pulse width varying from 0 to 656usec every 1.020ms. I would like to use PICAXE 08m capabilities to build a converter to read those 0 to 656usec pulses and convert those pulses to 1 to 2 msec at 20msec period, f=50hz.
After studying the manual initially, I am confused about the units (sec, msec, usec ???) in the pwmout, and pwmduty command.
I also tried to place 50hz in the pwmout wizard to automatically calculate the command. The wizard indicated 50hz was outside the calculation range.
Also any clarification or reading guidance on what unit of time should be used in the pwmout and pwmduty would be helpful.
Below is a real rough initial brainstorming draft before I go the wrong direction too far. Anyone have any ideas or some handy commands for this type project I could study further would be great...
Tks.
INIT:
pwmout C.2, 20msec, dc ; PWMOUT pin, period, duty cycle initialized at 20msec
STICK:
Pulsin C.1, 1, pulse1 ; Read pulses in usec form from receiver output
If pulse1 =>10usec and <20usec then DC=1.00 msec ;33 segments convert usec to msec pulses
If pulse1= >160usec and <180usec then DC=1.25 msec
If pulse1 =>640usec and <660usec then DC=2.00 msec
Pwmduty C.2, dc ; generate msec pulses
Goto STICK
Last edited: