- Posts: 4402
Deviation for Devo F4?
- PhracturedBlue
- Offline
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
xJustiinsane wrote: Cool! I ordered an 7E couple weeks ago. I'm waiting for that to build that module in. I'd like to get one from the Cheerson CX-10 controller, is that the same? (Same protocol, yes, but does harvesting work the same and how?)
That transmitter you would have to cut the actual PCB the module is on, and I'm not even sure it's harvestable just like that... you're probably best getting a new module because you can get the nRF24L01+PA+LNA which has a power amplifier which will give you a lot more range, as well as being compatible with a lot more models because it is the "+" version.
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
PhracturedBlue wrote: Also, you should note that I'm sure very bad things will happen if you run out of space. the code has absolutely not been tested in an out of space condition, so make sure you don't get there.
What I would do is export the FS file every couple of models so i can check on its size to make sure it doesn't go above 59kb (the 60 you said with a margen). Also, if the video is setup outside of the individual model and as a common-to-all models, that would be a couple of lines saved per model, no? hehehe
Mainly I would be using the transmitter for Naze32 based quads (max 7 channels) and FPV flying wings (max 4 channels), both of which are pretty simple as far as mixes go, so they aren't complicated or long .ini files... as I've said many times, for other models, including more complicated, non-FPV ones, I have my 7E and my MPX
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
I just tested my F7 with the original firmware (0.6A) and as soon as I turn on video, the screen goes blank. I do not see any text overlay. When I press 'EXT' I get the menu back (and the video switches off). Once I ht 'EXT twice more to get back to the main display, the video turns back on and I get a completely blue screen with no text at all. If I turn on the Receiver, I think the text will come back once a signal is received, but I can't seem to ever see the text if there is no video signal available.
This matches with what I see in Deviation Tx. If this is the same behavior as the F4, that implies there is no way around it, and we need to setup a method to toggle in and out of video (on Th F7 this is most easily done by assigning a switch). If the F4 can display the menu when in video mode without a signal present I want to see that behavior.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
It maps the left-vertical trim-up to be a toggle for the video display. Press the left-vertical-trim-up once to toggle video mode on, and the same button again to toggle video mode off. That assumes you use Mode2 (throttle on left). If you want to change to throttle on right, go to the Model->Trim and change the 'Virt1' Trim from 'VERT-L+' to 'VERT-R+' (note that the '+' shows as a solid box, since the Devof4 font doesn't have a '+' character)
This should be sufficient for you to test out the video on the F4.
Note that the trim state is sticky, so if you turn off your Tx with the Video on, it will still be on when you power back on. Just press the trim button to switch it off again.
Let me know if this works for you.
Note: To install the model.ini:
start the Tx in USB mode,
extract the filesystem with 'buildfs -x'
copy the included file to the extracted dir as models/model1.ini (overwrite the existing file)
rebuild the fs with 'buildfs -c'
Make sure to unmount the drive in Windows before turning it off, otherwise your data could be lost
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
Please Log in or Create an account to join the conversation.
- SirDomsen
- Offline
Once I'm back home, I could try out devention. The only thing that could bother is that I din't have a working vTX at the moment. Needs a little solder time, too.
But doing a video without vTX would be no problem this evening
@PB: I have a few toggle switches on the way to me. Could you explain how the switches are wired on the F7? Do the switches push GND to the CPU Pins or how does that stuff work out? Looking at the circuit diagram for the F4 someone posted here, I cans see a few unused pins on which at the devoF7 the switches are wired to. So if switches could be attached the F7 way, it would be far easier to use more than just 2 additional switches as on the 7e.
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
I'm experimenting with some Arduino code right now, seeing if I can figure it out, but I'm not much up on code (as you've probably already figured out), but I'm trying to aim for a 2x2-way switch, 2x3-way switch and 2xpot on an Arduino via PPM input, which should be able to use for a variety of things... but if the FMODE and HOLD switches can be figured out, then that's 2 switches saved from going through an Arduino, and the code that I'm basing the sketch from was originally 2 pots and 2x 3-way switch, and it was a working sketch.
Those unused pins you mention I saw them to, but I have no idea what they connect to, although I would assume it's GND, but not sure if it's direct or via something other than the switch...
Here's the code if you want to look it over see what you think of it...
// Devo 7e PPM input
// For use with Arduino Nano V3.0
// Based on sketch by Ian Johnston
// Analog pin assignments
int AI_Pin_A1 = 2; // potentiometer #1 pin
int AI_Pin_A2 = 3; // potentiometer #2 pin
int AI_Raw_A1; // Analog In raw var - 0->1023....
int AI_Raw_A2;
int A1_uS = 750; // potentiometer #1 us
int A2_uS = 750; // potentiometer #2 us
int sw1_uS = 750; // 3-way switch #1 us
int sw2_uS = 750; // 3-way switch #2 us
int sw3_uS = 750; // 2-way switch #1 us
int sw4_uS = 750; // 2-way switch #2 us
int Fixed_uS = 300; // PPM frame fixed LOW phase
int pulseMin = 750; // pulse minimum width minus start in uS
int pulseMax = 1700; // pulse maximum width in uS
// Digital pin assignments
int outPinPPM = 10; // PPM out
int inPinD2 = 2; // 3-way switch #1 pin for position 1. Positions 1 and 3 combine for middle position.
int inPinD3 = 3; // 3-way switch #1 pin for position 3
int inPinD4 = 4; // 3-way switch #2 pin for position 1
int inPinD5 = 5; // 3-way switch #2 pin for position 3
int inPinD6 = 6; // 2-way switch #1 pin for position 1
int inPinD7 = 7; // 2-way switch #2 pin for position 1
ISR(TIMER1_COMPA_vect) {
ppmoutput(); // Jump to ppmoutput subroutine
}
void setup() {
pinMode(outPinPPM, OUTPUT); // sets the digital pin as output
pinMode(inPinD2, INPUT); // sets the digital pin as input
digitalWrite(inPinD2, HIGH); // turn on pull-up resistor
pinMode(inPinD3, INPUT);
digitalWrite(inPinD3, HIGH);
pinMode(inPinD4, INPUT);
digitalWrite(inPinD4, HIGH);
pinMode(inPinD5, INPUT);
digitalWrite(inPinD5, HIGH);
pinMode(inPinD6, INPUT);
digitalWrite(inPinD6, HIGH);
pinMode(inPinD7, INPUT);
digitalWrite(inPinD7, HIGH);
// Setup timer
TCCR1A = B00110001; // Compare register B used in mode '3'
TCCR1B = B00010010; // WGM13 and CS11 set to 1
TCCR1C = B00000000; // All set to 0
TIMSK1 = B00000010; // Interrupt on compare B
TIFR1 = B00000010; // Interrupt on compare B
OCR1A = 22000; // 22mS PPM output refresh
OCR1B = 1000;
}
void ppmoutput() { // PPM output sub routine
// Channel 1 - Analog 1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(A1_uS); // Hold for A1_uS microseconds
// Channel 2 - Analog 2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(A2_uS); // Hold for A2_uS microseconds
// Channel 3 - 3-way switch #1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw1_uS); // Hold for sw1_uS microseconds
// Channel 4 - 3-way switch #2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw2_uS); // Hold for sw2_uS microseconds
// Channel 5 - 2-way switch #1
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw3_uS); // Hold for sw3_uS microseconds
// Channel 6 - 2-way switch #2
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH);
delayMicroseconds(sw4_uS); // Hold for sw4_uS microseconds
// Synchro pulse
digitalWrite(outPinPPM, LOW);
delayMicroseconds(Fixed_uS); // Hold
digitalWrite(outPinPPM, HIGH); // Start Synchro pulse
}
void loop() { // Main loop
// Read analog pins
AI_Raw_A1 = analogRead(AI_Pin_A1);
AI_Raw_A2 = analogRead(AI_Pin_A2);
// Map analog inputs to PPM rates for each of the channels
A1_uS = AI_Raw_A1 + pulseMin;
A2_uS = AI_Raw_A2 + pulseMin;
// Potentiometer limits
if (A1_uS <= 750) A1_uS = 750; // Min
if (A1_uS >= 1625) A1_uS = 1625; // Max
if (A2_uS <= 750) A2_uS = 750;
if (A2_uS >= 1625) A2_uS = 1625;
// 3-way switch #1
if (digitalRead(inPinD2) == 0) {
sw1_uS = 750;
}
if ((digitalRead(inPinD2) == 1) && (digitalRead(inPinD3) == 1)) {
sw1_uS = 1190; // Center us, may need to adjust this
}
if (digitalRead(inPinD3) == 0) {
sw1_uS = 1625;
}
// 3-way switch #2
if (digitalRead(inPinD4) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD4) == 1) && (digitalRead(inPinD5) == 1)) {
sw2_uS = 1190; // Center us, may need to adjust this
}
if (digitalRead(inPinD5) == 0) {
sw2_uS = 1625;
}
// 2-way switch #1
if (digitalRead(inPinD6) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD6) == 1) && (digitalRead(inPinD6) == 1)) {
sw2_uS = 1625;
}
// 2-way switch #2
if (digitalRead(inPinD7) == 0) {
sw2_uS = 750;
}
if ((digitalRead(inPinD7) == 1) && (digitalRead(inPinD7) == 1)) {
sw2_uS = 1625;
}
}
Please Log in or Create an account to join the conversation.
- xJustiinsane
- Offline
- Posts: 10
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
If you want to use the open pins on the MCU, the digital switches just tie the signal to ground when switches. The analog dials are just tied to the center lead of a potentiometer that is tied 3.3V to GND
But to wire them to the tx will require some delicate soldering directly to the MCU pins. Certainly not for the faint of heart.
The arduino method is probably much easier to actually do. If you don't want to sacrifice the PPM port, it may be possible to attach to the SPI1 prot, but I've not thought that all the way through.
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- PhracturedBlue
- Offline
- Posts: 4402
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
I need to order some switches first!!
Please Log in or Create an account to join the conversation.
- SirDomsen
- Offline
Will they work with the current verSion of the f4 code or means that that you'll have to change there, PB?
I'm not afraid of soldering direct to the MCU, and just thought, if everything in the code and in the hardware is already there, why not use it?
The arduino method seems to be interesting, too. Just read a little around that in the corresponding 7e thread. Crazy what some people do with their 7e
edit: is the video of the video function still required? I could do it later...
Please Log in or Create an account to join the conversation.
- Epitaph
- Topic Author
- Offline
- Posts: 291
Right now, I have in mind what I would like to do with the F4, and we are VERY close to it now the video is working, I just need to get switches and pots to solve that, I already have it working with LiPo so no voltage issues for the Arduino inside, and I think it's going to be a very pleasing, cheap and nasty transmitter hehehe
I might get my hands on a Devo 10 to keep up with development and for expanding into, but I haven't decided yet...
Please Log in or Create an account to join the conversation.
- SirDomsen
- Offline
Concerning powering arduino: Have you ever heard about pololu?
watch here:
www.pololu.com/product/2119
Please Log in or Create an account to join the conversation.
- Home
- Forum
- Development
- Development
- Deviation for Devo F4?