I had a bad crash an managed to kill the PPM Sum input pin and now and am trying to find the place to change it in the code.
Anyone point me to the section of code where this could be done please

Thanks in advance
Matt
Code: Select all
attachInterrupt(1, rxInt, RISING);
Matt. wrote:Hi Felix,
So after reading up and getting a little familiar with the platform and the multiwii code I have successfully moved the PPM sum input pin to Digital Pin 3.
I am now trying to enable the PWM for digitial pin 5 to replace the motor output lost 3.
So far I have:
Changed the PWM_PIN array to:
uint8_t PWM_PIN[8] = {9,10,11,5,6,8,A2,12}; //for a quad+: rear,right,left,front
Changed the ProMini section of the motor write to :
#if (NUMBER_MOTOR > 3)
#ifndef EXT_MOTOR_RANGE
OCR0B = motor[3]>>3; // pin 5
#else
OCR0B = ((motor[3]>>2) - 250) + 2;
#endif
and changed the initOutput function case to:
TCCR0A = _BV(WGM01) | _BV(WGM00);
TCCR0B = _BV(CS02);
TCCR0A |= _BV(COM0B1); // connect pin 5 to timer 0 channel B
however changing the waveform generation mode bit in the TCCR0A register seems to halt the program.
Can someone assist in how to set up and activate the PWM on Digial Pin 5 correctly please..
Matt
Code: Select all
#ifdef HEX6X // now quad x with pin 9,10,11,6
motor[0] = 1000; // pin 3 .. not used
motor[1] = PIDMIX(-1,+1,-1); //REAR_R -> pin 9
motor[2] = PIDMIX(-1,-1,+1); //FRONT_R -> pin 10
motor[3] = PIDMIX(+1,+1,+1); //REAR_L -> pin 11
motor[4] = PIDMIX(+1,-1,-1); //FRONT_L -> pin 6
motor[5] = 1000; // pin 5.. not used
#endif
QuadBow wrote:Hi all,
I would like to make you aware that the development release r1240 supports the change of the PPM sum input pin.
This feature can be enabled by uncommenting the line
#define PPM_ON_THROTTLE
in the file config.h.
As a result of this change, the sum input has to be made avaliable at the standard throttle pin on MEGA boards (eg. A8 for CRIUS AIO and FLYDUINO MEGA) and PROMICRO boards. Due to my obvervation, there is no big impact to cycle time. Being familiar with the code it should be possible to use another unused INT- or PCINT-pin instead of INT6_vect (PROMICOR) or PCINT2_vect (MEGA), as well (RX.INO).
I think this feature helps those who have an RX/TX issue.
Good luck
First, thanks for trying to help.,.
I don't understand that "#define PPM_ON_THROTTLE" since the ppm was already originaly on the throttle pin.
Eric
Spacefish wrote:You are limited to some pins in the current software, as you can only use pins that generate a interrupt. This is due a hardware limitation (not all pins generate a interrupt).
Another way would be to use the ICPX pins (ICP1-ICP5 on Mega 2560). But you have to change the code / initialize the timers to capture those events..
I have done this for my CRIUS AIO Pro V2 as the PPM pin on the PCB is connected to ICP1 which can´t generate a Interrupt in a way MultiWii currently accepts.. See my Code here: viewtopic.php?f=8&t=4788