er9x development

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
User avatar
Rob Thomson
Site Admin
Posts: 4542
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

Re: er9x development

Post by Rob Thomson » Fri Feb 03, 2012 5:30 pm

MikeB wrote: I personally hate the layout:
if(...) {
....
}
I always like to see the { } under each other, I find it helps following the coding flow:
if(...)
{
....
}
.
Oh dear... my code must have been winding you up for months :roll:

I love it the way you hate!

:mrgreen:
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!


User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Fri Feb 03, 2012 5:45 pm

Not really, a lot of the code is done that way. I've been involved in writing a coding standard for 'C' in the past. I think many use that arrangement, because the original "Kernigan and Ritchie" C book used it, and it has just been copied. My editor is set up for the way I like it, it automatically puts in the braces etc, I just have to type if( and it adds the ) and then the { and } under each other below the i of if.
I also have a 'C' beautifier program, I can take a source file, run it through that, and it is all re-arranged to how I like it. Others may not like the way I do code, so I haven't changed er9x sources, except when I edit part of it.
I also use all UPPERCASE for defines, Single first Uppercase character for global variables, and all lowercase for local variables. Er9x appears to use g_ in front of global variables (sometimes).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Sat Feb 04, 2012 12:27 am

memeruiz wrote:Here is my first contribution to the project. A patch for the new frsky sensor FLVS-01 and some other things.
Federico.
OK, I reckon I've got the cell voltage monitoring in, changed a few things, cleared the number of cells when you load a new model, otherwise if you switch models from say 4 cells to 3 cells, the 4th cell may cause an alarm when it isn't there!
Rather than add extra display screens, I've put them on the bottom of the 'GPS' screen for now.
I haven't added the accelerometer info yet, the previous hub protocol indicated a different resolution, so we would need to know which protocol is running, and scale the values accordingly I think. This needs checking.
I'll commit my changes soon, still testing some space saving changes, they are beginning to get slightly more obscure as I've saved so much already. I once heard of someone who was supposed to be able to make any program 10% shorter, the question is "for how many iterations?"
For interest, all the menus use up almost 34K of the flash, and thats just the code, it doesn't include the text.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: er9x development

Post by erazz » Sat Feb 04, 2012 3:36 am

Awesome Mike,

I was thinking about doing an overhaul of the menu system.... Something that we can carry over to ersky9x.
I got some ideas but we're talking about a MASSIVE change.
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!

User avatar
wheelspinner20
Posts: 175
Joined: Tue Dec 27, 2011 6:22 pm
Country: -
Location: Michigan, U.S.

Re: er9x development

Post by wheelspinner20 » Sat Feb 04, 2012 4:06 am

Expanding Possibilities - Expanding balsa (explosively)
Again....... NOT good p.r.! hahahahahahaha
no more quippy little latin phrases.! Its old


User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: er9x development

Post by erazz » Sat Feb 04, 2012 4:21 am

Done.

Can't promise to be nice here though. I expect people who come here to be slightly.... (fill in the blank)
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!

User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

er9x development

Post by cre8tiveleo » Sat Feb 04, 2012 4:39 am


User avatar
wheelspinner20
Posts: 175
Joined: Tue Dec 27, 2011 6:22 pm
Country: -
Location: Michigan, U.S.

Re: er9x development

Post by wheelspinner20 » Sat Feb 04, 2012 4:55 am

sweeeeet you listened .... you made MY day/night.!


you scared me a bit though when you told mike "MASSIVE" changes.! oh well I trust you.... just keep the auto update working and dont make me re-enter all my models, it's all good.!

P.
no more quippy little latin phrases.! Its old

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Sat Feb 04, 2012 9:42 am

erazz wrote:I was thinking about doing an overhaul of the menu system....I got some ideas but we're talking about a MASSIVE change.
I've been thinking about some possible menu changes as well. I just added a single, simple new option and it used 104 bytes flash. Feel free to pass ideas my way. I need to think mine through a bit more.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Sat Feb 04, 2012 12:58 pm

Mike, this one looks like it would be a good enhancement..
Someone is asking for it on google code.. I think it is a good idea. maybe you already seen it..

http://code.google.com/p/er9x/issues/detail?id=359#c1

João
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

er9x development

Post by cre8tiveleo » Sat Feb 04, 2012 1:42 pm

Mine has always given me 'cross hairs' when i do my curves, i love it, move the stick, see on the graph where it is, adjust curve... Its a great feature, it's already there in er9x.

:)


---
I am here: http://maps.google.com/maps?ll=44.003067,-79.457256

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Sat Feb 04, 2012 2:18 pm

jhsa wrote:Mike, this one looks like it would be a good enhancement.
I'm not sure which screen this applies to. Comments to the original issue indicate it is not possible on the curves because they are not attached to any specific input until they are used in a mix. The expo curves already have cross hairs.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Sat Feb 04, 2012 2:59 pm

understand.. the curve has to be assigned to a channel then.. it's logic

João

P.S. - He mentioned the throttle curve.. I also understand why he wants this feature.. it's easier to see the values when you move the sticks..
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Sat Feb 04, 2012 10:25 pm

Just been looking at this little sound board I have (thanks Rob), now I have a SD card (2Gb) that hopefully will work in it. I've been thinking about how to connect to it. We want something that is easy to wire up. Now I just noticed the LCD R/W signal. For driving the LCD, it is ALWAYS low, we only ever write to the LCD. So while we are not writing to the LCD, and the LCD chip select is inactive, we could use it for something else, like the clock to the sound card. It will need inverting for that. For the data, we could use one of the LCD data lines, they are already dropped to 3.3 volts for the LCD. So we could interleave writing to the LCD with writing to the sound board. We need feedback to know the sound board is busy, but we have a spare pin Port C bit 0, pin 35. The LCD reset line could double as the sound board reset line, again already at 3.3V.
So we might be able to connect using a couple of transistors, a resistor, and a 3.3V regulator.
I'm going to try to hook it all up in the next few days for testing (customers permitting), need to make some sound files as well.
I can't remember but I think someone has already done some testing on this board (WTV020-SD 20SS). Whoever it is, if they have any useful info. to help please do (e.g. speaker impedance used).

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
Rob Thomson
Site Admin
Posts: 4542
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

er9x development

Post by Rob Thomson » Sat Feb 04, 2012 10:42 pm

I can sent you some audio files next week. Sounds like a workable solution :)


Sent from my iPhone using Tapatalk
Slope Soaring, FPV, and pretty much anything 'high tech'
...........if you think it should be in the wiki.. ask me for wiki access, then go add it!

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Sat Feb 04, 2012 11:03 pm

Now we're talking.. :mrgreen: :mrgreen:
Thanks Mike and Rob
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

er9x development

Post by cre8tiveleo » Sat Feb 04, 2012 11:24 pm

I'm gonna want to have a welcome message with the splash screen.

Use all star trek sound effects...

'proximity alert'
'does not compute'
'you will be assimilated'


Ooooo...

New slogan for the 9X projects...

'Resistance is futile!'


---
I am here: http://maps.google.com/maps?ll=44.003067,-79.457256

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Sat Feb 04, 2012 11:26 pm

Mike here you find the specification for that module.. Speaker impedance included

http://waytronic.en.ec21.com/WTV020_SD_ ... 81691.html
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Hasse.69
Posts: 141
Joined: Fri Dec 30, 2011 8:59 pm
Country: -
Location: Ostergotland Sweden

Re: er9x development

Post by Hasse.69 » Sat Feb 04, 2012 11:50 pm

Could this be used?
7.45$ incl shipping worldwide.

http://www.ebay.com/itm/MP3-Voice-modul ... 2852wt_920
Attachments
sdcard sound module.jpg
sdcard sound module.jpg (12.96 KiB) Viewed 6447 times
To support the forum:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=82QKZZN5ZC8JE
To support ER9X:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Sun Feb 05, 2012 1:38 am

yeah, I've been looking at that one too.. it's very cheap.. if that would work would be wonderful ;)
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
wheelspinner20
Posts: 175
Joined: Tue Dec 27, 2011 6:22 pm
Country: -
Location: Michigan, U.S.

Re: er9x development

Post by wheelspinner20 » Sun Feb 05, 2012 1:42 am

They both say 1 gig cards though.... are those still available??
no more quippy little latin phrases.! Its old

User avatar
Hasse.69
Posts: 141
Joined: Fri Dec 30, 2011 8:59 pm
Country: -
Location: Ostergotland Sweden

Re: er9x development

Post by Hasse.69 » Sun Feb 05, 2012 1:58 am

This card maybe , it´s standard size.
http://www.ebay.com/itm/1GB-Flash-High- ... 137wt_1005
To support the forum:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=82QKZZN5ZC8JE
To support ER9X:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
erazz
9x Developer
Posts: 682
Joined: Tue Dec 27, 2011 6:25 pm
Country: -
Location: NJ-USA
Contact:

Re: er9x development

Post by erazz » Sun Feb 05, 2012 3:49 am

Now that's a cool solution!

Just to be clear, I'm not making any kind of MASSIVE changes at this time. I just think we're kida pushing the menu system and that it really can do with some twaeks. It's massive because it's a system wide change. Got more pressing things though.
Z

BEWARE - WE ARE IN THE AIR!!!
What goes up... Should be controlled by a 9X!

ReSt
Posts: 1512
Joined: Tue Dec 27, 2011 11:34 pm
Country: -

Re: er9x development

Post by ReSt » Sun Feb 05, 2012 10:00 am

MikeB wrote: I can't remember but I think someone has already done some testing on this board (WTV020-SD 20SS). Whoever it is, if they have any useful info. to help please do (e.g. speaker impedance used).

Mike.

Copied it from the original post
Some more information about the sound module.

I'm testing the module via the parallel port of my PC.

I supply power to the module with a 5 volt BEC and reduce this voltage with two diodes 1N4007 to 3.2 volt
(A single red LED also did work instead of the two diodes.)

From the printer port, I use the databits 0 (pin 2) as clock and databit 1 (pin 3) as data lines.
The 5 volt output signals from the printerport are reduced with voltage dividers of 1.2k + 3.3 k.
For testing purpose, I read back the busy signal of the module pin 13 (via printer port pin 12 'end of paper') to signal my program, when playing a soundfile has stopped.

This is how my program communicates

'command is 2 byte hex value of the filenumber to play
command=&h0027 'play file "0039.ad4" or
command=&hFFF7 'set max volume

Clock and data HIGH
(Delay 2ms)
clock LOW
delay 12ms !!!!does not work below 12 ms !!!

for n=15 to 0 step -1
clock LOW
Set dataline according to bit n of command
delay 200us
clock HIGH
delay 200us
next

data line HIGH



With the above timings, the module sets the busy signal latest 50 msec after the first clock low of the loop.

Timings are not critical, except they are to short. And contrary to what the manual says, the 12msec delay is critical, in that it must not be shorter than 12 msec (That took me nearly a week to find it). It can be extended up to 2 seconds without malfunction (but it delays playing the file accordingly). The 200us delay can be shortened down to 100 us or extended up to 300 msec.

I have tested with wave files of 22Khz 16 bit mono PCM and also 44Khz 16 bit stereo PCM that I converted to ad4 files and they all worked.

Reinhard
Attachments
MP3.zip
Same files but converted to MP3
(1.45 MiB) Downloaded 56 times
AD4.zip
Sample sounds converted to AD4. Calls numbers from 0 to 500
(1.37 MiB) Downloaded 53 times

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Sun Feb 05, 2012 12:49 pm

Thanks for that, great help.
That 12mS is going to be a bother, we don't have 12mS between LCD updates so my idea of using the LCD_R/W line may not be possible. I'd read, like you, that it was only 2mS. Thinking again how to interface it, got the odd idea what I might do.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Mon Feb 06, 2012 11:20 am

Maybe we need to disconnect the LCD R/W line from the LCD, then we can use it for whatever we like.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 18910
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: er9x development

Post by jhsa » Mon Feb 06, 2012 11:28 am

But is it not needed by the LCD?
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Mon Feb 06, 2012 12:40 pm

No, see above viewtopic.php?f=5&t=2&start=90#p3032. It is Always kept at a low level. It can be disconnected simply by removing the first resistor (5K1) in the divider to drop the voltage to to 3.3V for the LCD. The second resistor (10K) will then hold the line low for the LCD. EASY what?
We get a spare pin, and the pad of the removed resistor to solder a wire to :D .

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

er9x development

Post by cre8tiveleo » Mon Feb 06, 2012 12:59 pm

Nice! I really need to get a magnified lamp for this now... Yes, i do everything without any magnification... Yes , i wear xx sized gloves... Yes... Lotsa cussin goes on when i work on boards... No, i don't have a swear jar... But if I did, i'd be a trillionaire!


---
I am here: http://maps.google.com/maps?ll=44.003067,-79.457256

User avatar
MikeB
9x Developer
Posts: 16556
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: er9x development

Post by MikeB » Mon Feb 06, 2012 4:48 pm

GENERAL WARNING - er9x r701, DO NOT USE this version.
I messed up the model structure so safety switches and FrSky alarms are not right.
r703 should sort this when it is available.
Sorry.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!


Post Reply

Return to “er9x”