Page 1 of 106

er9x development

Posted: Tue Dec 27, 2011 12:17 pm
by Rob Thomson
Right chaps.. lets try keep all 'highly technical' chat to this thread. It will help end users avoid being bombed out by too much techy jargon!

Re: er9x development

Posted: Tue Dec 27, 2011 6:18 pm
by Flaps 30
I seem to recall that a while back, there was talk of using pin 43 on the MCU (via a suitable transistor/FET) to drive the vibrator motor. Has this ever been programmed up and released?

Re: er9x development

Posted: Tue Dec 27, 2011 7:10 pm
by Rob Thomson
Flaps 30 wrote:I seem to recall that a while back, there was talk of using pin 43 on the MCU (via a suitable transistor/FET) to drive the vibrator motor. Has this ever been programmed up and released?

I have all the parts for this - and even the soldering done on my tx. Just not done the code yet.

I should have it working in the next couple of weeks - christmas been keeping me too busy :P

Re: er9x development

Posted: Tue Dec 27, 2011 8:38 pm
by Flaps 30
rob.thomson wrote:I have all the parts for this - and even the soldering done on my tx. Just not done the code yet. I should have it working in the next couple of weeks - christmas been keeping me too busy :P
You are at the same place as I am. Sadly I am not a coder type person. Of course I am also looking forward to any progress on meaningful 'bleeps' to go with the Winged Shadow Thermal Scout.

Most of this can wait until the warmer weather. I don't do cold these days. :)

Re: er9x development

Posted: Tue Dec 27, 2011 8:53 pm
by Rob Thomson
Never fear.. will be done in a few weeks :-)

Re: er9x development

Posted: Tue Dec 27, 2011 8:55 pm
by Rob Thomson
rob.thomson wrote:Never fear.. will be done in a few weeks :-)
Just re-read the original message and realised I missed the point.

Check: http://code.google.com/p/er9x/wiki/Spea ... rateHaptic

The Vibration Alert has been working for ages.

I thought when I skimmed your message that you meant the option to switch on and off two different tx modules from one of the other spare ports.

Rob

Re: er9x development

Posted: Tue Dec 27, 2011 9:15 pm
by Flaps 30
rob.thomson wrote:I thought when I skimmed your message that you meant the option to switch on and off two different tx modules from one of the other spare ports.
Ahh! ... Okay.. Yes. My enquiry concerned the use of pin 43 to drive the motor. I'm guessing the one you are talking about, is the possible use of the other spare pin, that is number 35.

I could suggest that the vibration motor drive might be selected for various functions. Like on the positive climb signal from the Thermal Scout. That would put a smile on my face. :)

Re: er9x development

Posted: Tue Dec 27, 2011 9:20 pm
by man-bis
. I and my colleagues on a hobby from Russia we thank all firmware developers and updatings for the big and good work.
Now I have an interest to sound updating of the transmitter Flysky from Frsky telemetry radio . I consider that it is very important and necessary option. Whether I can hope, what in the near future such updating will be accessible? It would be desirable, that for sound updating the inexpensive sound module with support мр3 files and compatible with telemetry Frsky was used. It would be very useful, if the transmitter a voice message warned about critical options on of an onboard voltages and the power battery, on radio signal level, on voltages of the transmitters battery, the flight timer. I think it not the complete list of possibilities of sound (voice) updating.
Excuse for my English.

er9x development

Posted: Tue Dec 27, 2011 9:20 pm
by Rob Thomson
Flaps 30 wrote:
rob.thomson wrote:I thought when I skimmed your message that you meant the option to switch on and off two different tx modules from one of the other spare ports.
Ahh! ... Okay.. Yes. My enquiry concerned the use of pin 43 to drive the motor. I'm guessing the one you are talking about, is the possible use of the other spare pin, that is number 35.

I could suggest that the vibration motor drive might be selected for various functions. Like on the positive climb signal from the Thermal Scout. That would put a smile on my face. :)
Yes. The function to make it 'vibrate' on a thermal is not in place yet - but due very soon. For now you get vibrations on alerts and trim centers etc

Rob


Sent from my iPhone using Tapatalk

Re: er9x development

Posted: Tue Dec 27, 2011 9:42 pm
by jhsa
Ok, we have a new forum.. now would be nice to have some PCM audio for the er9x :mrgreen: :mrgreen:

Re: er9x development

Posted: Tue Dec 27, 2011 11:25 pm
by uphiearl
This looks good...now to get everyone over here !
Earl

Re: er9x development

Posted: Wed Dec 28, 2011 1:44 am
by deadaim57
uphiearl wrote:This looks good...now to get everyone over here !
Earl
I'm here,site really looks great Rob. :D
Tom

Re: er9x development

Posted: Wed Dec 28, 2011 2:59 am
by Yriy Tumanov
Hello, Rob! Many thanks for ER9! My friend and I figured out a bit with her and look forward to providing EEPROM for general use! :)

Re: er9x development

Posted: Wed Dec 28, 2011 11:33 pm
by Crash_Jim
I'm new to this stuff. I just flashed my 9x and love what you have done so far. I have a question.. One of the other guys verions has added a SD card mod. Are you planning on doing that in the future?

Re: er9x development

Posted: Wed Dec 28, 2011 11:39 pm
by GrootWitbaas
Crash_Jim wrote:I'm new to this stuff. I just flashed my 9x and love what you have done so far. I have a question.. One of the other guys verions has added a SD card mod. Are you planning on doing that in the future?
Yes, actually already done sort of, check this topic for more info

Re: er9x development

Posted: Fri Dec 30, 2011 3:54 am
by Mechcondrid
hey guys hope someone can help me out here im trying to flash my radio witha new revision of er9x and for some reason now the aileron wont report as being on no matter what i do nothing has changed hardware wise so i looked at the code and i did see that someone changed how the pins were selected for the frsky mod version so i tried changing the pins as beest as i figure out and its still acting weird so i put up a issue on the er9x page about a weeks ago and still havent heard back

now i noticed in the code comments there is something about a test at bit 0 for pin 7 i couldnt find anything that referenced that in running code so i disregarded that.
could i have missed something and it is in running code?

Re: er9x development

Posted: Fri Dec 30, 2011 11:02 pm
by MikeB
Can you confirm the following please.
1. You are were and are running the FrSky version of er9x.
2. You have done the mod to move the two switches to other pins.
3. If you go to the main screen that shows THR RUD and ELE down the left and AIL GEA and TRN down the right all the other 5 switches show reverse video/normal video when you switch them and the AIL does not. Which state is the AIL in normal or reverse video?
4. If you put r347 back on then, on the same screen, all 6 switches operate correctly.

Mike.

Re: er9x development

Posted: Fri Dec 30, 2011 11:42 pm
by Mechcondrid
yes to everything and the aileron is normal video as if it was off

Re: er9x development

Posted: Sat Dec 31, 2011 9:34 am
by MikeB
That's Weird then. I've checked back to the source for r347 and it is working the same way. There is a code change I put in that saves some memory, but logically it operates the same way, and works for the throttle cut switch. If it is still working on r347, then the wiring must be OK and the switch is switching. It is working on my Tx. I shall have to give it some more thought, it should be OK.

Mike.

Re: er9x development

Posted: Sat Dec 31, 2011 6:40 pm
by Mechcondrid
i dont use the default pins for the connections could that be it?
i believe i use c6 and g2

Re: er9x development

Posted: Sat Dec 31, 2011 8:21 pm
by MikeB
Mechcondrid wrote:i dont use the default pins for the connections could that be it?
i believe i use c6 and g2
The 'standard' FrSky build expects the moved switches to be on C6 and C7, so that is why your AIL switch is not working. Where did you get your r347 version from? It sounds like it was a 'special'.

Mike.

Re: er9x development

Posted: Sat Dec 31, 2011 9:34 pm
by Mechcondrid
its the regular frsky version i recoded to use those pins it makes it easier to solder with my hands
and i did this with the 646 revision too but its not working right

Re: er9x development

Posted: Sat Dec 31, 2011 10:01 pm
by MikeB
Mechcondrid wrote:its the regular frsky version i recoded to use those pins it makes it easier to solder with my hands
and i did this with the 646 revision too but its not working right
In drivers.cpp is the line:
case SW_AileDR : xxx = PINC & (1<<INP_C_AileDR); //shad974: rerouted inputs to free up UART0
and in er9x.h:
#define INP_C_AileDR 7

These look for the AIL switch on PORTC bit 7. If yours is on PORTG bit 2, then I would expect
In drivers.cpp:
case SW_AileDR : xxx = PING & (1<<INP_G_AileDR); //shad974: rerouted inputs to free up UART0
and in er9x.h:
#define INP_G_AileDR 2
(Make sure you get G not C).

ALSO, in er9x.cpp, PORTG is configured with bit 2 set as an output to drive the HAPTIC motor for vibration alerts.
DDRG = 0x14; PORTG = 0xfB; //pullups + SIM_CTL=1 = phonejack = ppm_in, Haptic output and off (0)
and in audio.h
#define HAPTIC_ON PORTG |= (1<<2)
#define HAPTIC_OFF PORTG &= ~(1<<2)

I suggest you change the line in er9x.cpp to:
DDRG = 0x10; PORTG = 0xfF; //pullups + SIM_CTL=1 = phonejack = ppm_in, Haptic pin is input
and in audio.h:
#define HAPTIC_ON
#define HAPTIC_OFF

Most likely it is the HAPTIC output that is causing you a problem.

Mike.

Re: er9x development

Posted: Sat Dec 31, 2011 10:32 pm
by Mechcondrid
yup that was it ; i was unaware that haptic had been merged into the frsky build thanks a bunch

Re: er9x development

Posted: Tue Jan 03, 2012 11:37 am
by bertrand35
Mike,

In companion9x when I import and compile er9x there is a warning which in my opinion could be solved:

It's in pers.cpp:50
strcpy_P(g_model.name,PSTR("ME "));

If I am not wrong this line is not useful (modelDefault is called some lines below).

Bertrand.

Re: er9x development

Posted: Tue Jan 03, 2012 12:13 pm
by MikeB
You are right the line is wrong, I recently found this when working on the software for the ERSKY9X board.
The line should be:
strcpy_P(g_eeGeneral.ownerName,PSTR("ME "));
I've changed it in er9x, and will commit it soon, we have the DSM2 changes to commit as well and my sources are not quite ready to commit this as well.
Whether this revised line gives you a warning as well remains to be seen, but it performs the correct function of setting a default ownername.

Mike.

Re: er9x development

Posted: Tue Jan 03, 2012 2:18 pm
by bertrand35
Yes it will remove this warning, no problem.

But have a look in eeReadAll (if I am right, this is the only place where generalDefault is called):

Code: Select all

generalDefault();
// alert(PSTR("default ok"));

uint16_t sz = theFile.writeRlc(FILE_GENERAL,FILE_TYP_GENERAL,(uint8_t*)&g_eeGeneral,sizeof(EEGeneral),200);
if(sz!=sizeof(EEGeneral)) alert(PSTR("genwrite error"));

modelDefault(0);  <= here there is a memset(&g_model, 0, sizeof(ModelData));
Then the "ME " or whatever will be overwriten!
Am I missing something?

Bertrand.

Re: er9x development

Posted: Tue Jan 03, 2012 3:37 pm
by MikeB
It looks to me like the code finds the EEPROM is bad, so creates a new (default) general image, and writes that to the EEPROM, then creates a new (default) model and write that to the EEPROM. Originally the "ME" went into the model and did get overwritten, but my correction above puts the "ME" in the ownerName of the general (where it should have been all along) and does get written to the EEPROM.

Mike.

Re: er9x development

Posted: Tue Jan 03, 2012 3:52 pm
by bertrand35
MikeB wrote:It looks to me like the code finds the EEPROM is bad, so creates a new (default) general image, and writes that to the EEPROM, then creates a new (default) model and write that to the EEPROM. Originally the "ME" went into the model and did get overwritten, but my correction above puts the "ME" in the ownerName of the general (where it should have been all along) and does get written to the EEPROM.

Mike.
Understood, another copy paste problem then ;)
But be careful, it will remain that strcpy will copy 10bytes + the '\0' which means that myVers will be overwriten.
I would prefer a strncpy correction on this line 50 and then on line 81 (it will remove the warning that I can see). But I will perfectly understand if you fill the myVers after this line. I am almost sure that it will save flash if you use this last method.

Side note: in gruvin9x all these spaces chars are stored in EEPROM as '\0'. It saves both flash and EEPROM. And warnings :)

Re: er9x development

Posted: Tue Jan 03, 2012 4:30 pm
by MikeB
I agree that strncpy would be better. I'll have a look at storing \0 instead of spaces when I get a moment.

Mike.