I am working on RC aircraft projects. Most of the time I am using the Attiny85.
As you already know, radio control systems use PWM for servo control. Pulses of 1000 - 2000 microseconds every 20 milliseconds tell the servos what to do.
My projects are;
- Kill switch for gasoline engine ignition
- Servo reverser
- Servo slower
- Landing gear door sequencer
- Electronic switch (as a replacement for mechanical switches)
- Landing gear motor controller
All but the last project are working fine. Most of them have been tested for more than one year at the field. But I have problems with the last project.
RC Aircraft systems are being powered by batteries and regulators but there is no fixed standart voltage. So the electronic components must work at voltages between 4.8V and 8.4V. For this reason I always use a low dropout voltage regulator (LM2950) in my projects.
I always use one digital pin of the Attiny85 to read the incoming PWM pulse. I use the "pulseIn()" function of the Arduino IDE most of the time and there are no problems. But in the last project I noticed that the pulseIn() function cannot read the pulse width correctly. The HIGH level of the RC receiver output cannot be recognized as HIGH by the Attiny85. I added a transistor stage at the input and as the polarity of the PWM signal is now reversed I changed the code accordingly. This solved the problem.
What I want to know is...
I am using the same basic circuitry (Attiny85, internal oscillator @ 8 MHz, LM2950 as voltage regulator) in all my projects and I am using similar RC receivers (Hitec Optima series). Why do the first 5 projects work flawlessly and the 6th not?
Any ideas would be welcome...
As you already know, radio control systems use PWM for servo control. Pulses of 1000 - 2000 microseconds every 20 milliseconds tell the servos what to do.
My projects are;
- Kill switch for gasoline engine ignition
- Servo reverser
- Servo slower
- Landing gear door sequencer
- Electronic switch (as a replacement for mechanical switches)
- Landing gear motor controller
All but the last project are working fine. Most of them have been tested for more than one year at the field. But I have problems with the last project.
RC Aircraft systems are being powered by batteries and regulators but there is no fixed standart voltage. So the electronic components must work at voltages between 4.8V and 8.4V. For this reason I always use a low dropout voltage regulator (LM2950) in my projects.
I always use one digital pin of the Attiny85 to read the incoming PWM pulse. I use the "pulseIn()" function of the Arduino IDE most of the time and there are no problems. But in the last project I noticed that the pulseIn() function cannot read the pulse width correctly. The HIGH level of the RC receiver output cannot be recognized as HIGH by the Attiny85. I added a transistor stage at the input and as the polarity of the PWM signal is now reversed I changed the code accordingly. This solved the problem.
What I want to know is...
I am using the same basic circuitry (Attiny85, internal oscillator @ 8 MHz, LM2950 as voltage regulator) in all my projects and I am using similar RC receivers (Hitec Optima series). Why do the first 5 projects work flawlessly and the 6th not?
Any ideas would be welcome...