ERSKY9X Coding

erskyTx runs on many radios and upgrade boards
ersky9x was a port of er9x for use on the sky9x board.
User avatar
Rob Thomson
Site Admin
Posts: 4543
Joined: Tue Dec 27, 2011 11:34 am
Country: United Kingdom
Location: Albury, Guildford
Contact:

ERSKY9X Coding

Post by Rob Thomson »

Not off the top of my head. You could try open a cmd console and type sam-ba /?


---
I am here: http://tapatalk.com/map.php?hlnazc
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
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

steblerjun wrote:I have to wait about 30sec. everytime I start SAM-BA to get the ersky9x-board to be detected... (win7 64bit)
Is anybody using hardware debbuging? Which tools do you use?
For SAM-BA, I use the following batch file:

Code: Select all

@ECHO OFF
:: Start SAM-BA
START sam-ba.exe \USBserial\COM8 at91sam3s4-9x
:: Wait a second more details here http://www.robvanderwoude.com/wait.php pipe output to nul so ping doesnt display
PING 127.0.0.1 -n 2 > NUL
:: End the tasklist process preventing SAM-BA from opening
TASKKILL /F /IM tasklist* > NUL
This gets round the long delay before the SAM-BA window opens. Change the COM8 into whatever com port you need to use.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
steblerjun
Posts: 9
Joined: Wed Jun 06, 2012 6:00 am
Country: -
Location: Zuerich, Switzerland

Re: ERSKY9X Coding

Post by steblerjun »

Thank you Mike!!! Now it needs about 2sec!!

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

Re: ERSKY9X Coding

Post by MikeB »

steblerjun wrote:Is anybody using hardware debbuging? Which tools do you use?
I'm not! I have a debug task that communicates with a serial port I use for debugging. The code is in debug.cpp. I don't describe the commands because I change them depending on what I'm testing/debugging.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
Hexperience
Posts: 190
Joined: Fri Feb 17, 2012 4:48 pm
Country: -
Location: Keswick, Ont. Canada

Re: ERSKY9X Coding

Post by Hexperience »

***Sorry... didn't read all the replies...***
deleted.
Sky9X: One radio to rule them all, and in the darkness BIND them.

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

Re: ERSKY9X Coding

Post by MikeB »

Making some progress with VOICE on ersky9x. I've managed to get one word spoken! However this means the low level code to drive the output is all working, as is reading the .WAV file from the SD card. Just need to package it up a bit, and port the VOICE selection.generation over from the er9x VOICE mod.
At this point I used an 8-bit unsigned WAV file at 11025 Hz. I will try to handle other sample sizes (e.g. 16-bit) and other speeds (e.g. 16000 Hz), shouldn't be too difficult to do. Ideally, we would like 12-bit values but this is non-standard so we would need to have a special program to convert them. Unless we don't have enough processing power to handle 8 or 16-bit WAV files we might as well stay with them.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
RCHH
Posts: 467
Joined: Sun Jun 24, 2012 2:48 pm
Country: -
Location: Plymouth

Re: ERSKY9X Coding

Post by RCHH »

Have tried the sound with latest update - R90 - uploaded files to a SanDisk 4GB Micro SD-HC. Card shows as ready, but no folders/files are visible, just the usual 'Ready 0008' and the CID, CSR & SCR data. Formatted the card to FAT32 in WinXP with default allocation unit size - reloaded files and no different. Does the fact it is an HC card have any bearing?
The simpleton asked "Hows about ErSky9X for Horus???". And the Genius from Dorset replied "Why not indeed? I shall get right onto it!" And then there was light on Horus! And it was good!
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: ERSKY9X Coding

Post by cre8tiveleo »

You won't see files and folders with er9x for skyboard. (Or er9x either)

If you go to Safety Switches on teh model menu. You can now choose, S,A or V. Select V, now a switch, now the third is a number 00 to whatever. The cvs file in the voices directory (or sound zip file) lists what file is for what sound.

You can also setup speaker voice and beeper voice in teh radio main screen.

Image

Image

Sorry about the poopy pics, just have my wingcam... point and shoot, hope it was infocus... :roll:
steblerjun
Posts: 9
Joined: Wed Jun 06, 2012 6:00 am
Country: -
Location: Zuerich, Switzerland

Re: ERSKY9X Coding

Post by steblerjun »

Hey Mike,
can you have a look at the DisplayScreenIndex-function? (menus.cpp, the index on the right upper screen)

I have perceived that the index is not written correctly: the slash is not showing all it's 5 bytes and the last inverted bar after the "count"-number is shown in the next screen line...

I have changed the DisplayScreenIndex-function like this:

void DisplayScreenIndex(uint8_t index, uint8_t count, uint8_t attr)
{
uint8_t x ;
lcd_outdezAtt(DISPLAY_W-1,0,count,attr); // amount of indexes, DISPLAY_W = 128 (lcd.h)
x = 1+DISPLAY_W-FW*(count>9 ? 3 : 2) ;
lcd_putcAtt(x,0,'/',attr);
lcd_outdezAtt(x-1,0,index+1,attr); // index
}

that looks now good to me...

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

Re: ERSKY9X Coding

Post by MikeB »

Thanks, I'll see what I can do.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
CharlesB
Posts: 11
Joined: Tue Dec 27, 2011 5:21 pm
Country: -
Location: Ohio , USA
Contact:

Re: ERSKY9X Coding

Post by CharlesB »

Hi MikeB we got our ersky9x up and running with BT .
I can tell it even seams like the Servo's are even reacting faster with the new board.

We like the Custom Display we can all most get all we want on the Display.
We would like a readout of Watts.

What were lacking is Watts { A1(Volts) * (A2)Amps}

Or to be able to put a math statement with the use the the menu of Custom Display.
Like to make one line like this.
(A1= ) * (A2=) = "Watts"

That would display the watts then "Watts" text after it.
Or something like it.
If that could be done then a person could even do Watt hours. Or just about anything. on custom display.
You could even display Peek Max/Min of any thing. If we had some Variables available for more complex.
Just thinking out loud.

I think we can make it happen But it will take some time . Hi HI

It took a little time to find all the setups on BT and the display backlight to get it all running .
You ALL have done a OUTSTANDING job on this Project.

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

Re: ERSKY9X Coding

Post by MikeB »

Thank you.

You should have mAh avaliable by the way.

Take a bit of time to think about and code, but I think you are asking for some "CUSTOM VARIABLES", a bit like "CUSTOM SWITCHES", although we will need to be careful to avoid arithmetic overflow.
So you have:
VAR1 MUL A1 A2 W
Where the MUL could be ADD, SUB, or DIV (maybe other functions as well, not sure what though).
A1 is a telemetry variable and A2 is either a telemetry variable or a constant (may need MULC, ADDC etc to specify that)
and the W is the 'unit' of the result, to be displayed with the value (I'm not sure you could fit the whole word "Watts" on the display.
Then VAR1 (or VAR2 etc) should be available as 'telemetry' values everywhere else they are available, including as inputs ot other VARs.

Could be quite a nice, flexible way to do scaling of values. I have some hard coded conversions, like metres to feet, or deg C to deg F, maybe I could remove them and let the user work them out for themselves with this.

Oh yes, we may need a voice file index for the units to be able to say the value as well.

I need more time for all this! Must get some other bits finished first.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
gfnk357
Posts: 33
Joined: Fri Feb 17, 2012 9:37 pm
Country: -

Re: ERSKY9X Coding

Post by gfnk357 »

I was looking at the ppm out on a soundcard oscilloscope and noticed that the ppm shift is reversed between er9x and ersky9x. The shift sel neg on ersky9x corresponds to shift sel pos on er9x and vice versa. I don't know if it really matters but I thought you would like to know.
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

I'll look into it.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

r107 released.

voice_numeric - add thousands and 2 decimals - needs new/changed voice files - see stock voice thread for details.
Correct startup timing for Optrex LCD - reset pulse was too short.
Bluetooth baudrate settings(Linvor) - find current baudrate of BT module, change it to required setting.
WSHH say 'metres' if metric set
Rotary encoder divide 2 option - needed for encoder that replaces the 4 standard buttons.
Fix Bluetooth baudrate setting bug - UART hardware is slightly different from USART.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
olafnew
Posts: 99
Joined: Thu May 31, 2012 2:52 pm
Country: -
Location: Russia, Moscow
Contact:

Re: ERSKY9X Coding

Post by olafnew »

Mike, i believe there is a bug in Voice audio and haptic feedback. While using voice - there is no haptic on alarm condition(as an example - TX battery low alarm). Running r107. As i recall, on previous versions there were no such thing, and both audio and haptic worked simultaniously. In R107 i believe hapic doesent wok(and the screen is not flashing) when voice alarm is active. Could you please check/verify?
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

OK, I've never used the haptic so it's not easy to test, but I'll look into it.

Mike.

Edit: Yes, the haptic only works along with the audio, not voice. This is because the audio and haptic are coded together, the voice is separate. The same applies to er9x, same mechanism.
At present, if you need a haptic output, you need to set it up on a safety switch set for audio, and generate one of the haptic warnings.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

I've just found a problem with accessing the EEPROM from SAM-BA with ersky9x. It appears there is something missing from the applet initialisation of the SPI interface, no idea what though. The problem is occuring since I changed the code to see that the USB interface was active early on in the boot process. This is also before ersky9x does anything with the SPI interface to the EEPROM. The initialisation code looks to be the same in the applet, but the EEPROM is not responding.
The fix, for now, appears to be to move the USB test to after ersky9x has initialised the SPI interface, then the applet works OK.

I'll release the fix as soon as possible, but I'm busy tomorrow morning at least so not sure when exactly.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
PNaz
Posts: 142
Joined: Tue Dec 27, 2011 5:28 pm
Country: -
Location: Kaleden (Twin Lake), British Columbia

Re: ERSKY9X Coding

Post by PNaz »

I have just received 2 FrSky FAS100 amp sensors. With ersky r109 the volts are reading correctly but the amps are reading about 1/2 (probably .524) of the readings on my multimeter. The readings do vary up and down on both the screen and multimeter by about .5 amps. I also tried my eagletree data recorder and a Turnigy dlux 30 esc with data logging. Both confirmed the FAS100 is significantly low on the amp reading. It appears that the 20/11 correction on the last revision has been applied to both the volt and the amp readings. I think it was only needed for the volts.

The WSHH altimeter is still only reading out feet when selected to metres. The numeric readings are correct just the voice for feet or metres is incorrect.

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

Re: ERSKY9X Coding

Post by MikeB »

I don't appear to scale the FAS100 current reading at all. I wonder if FrSky have changed something in it again, perhaps to read higher currents?
Anyone else with a FAS100 on ersky9x able to confirm the current readings are wrong? I thought they were OK and I'm not aware I've changed anything.

Please confirm, your WSHH sends metres, but the voice output always says feet, even if you set the value on the second telemetry menu to MET?

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
PNaz
Posts: 142
Joined: Tue Dec 27, 2011 5:28 pm
Country: -
Location: Kaleden (Twin Lake), British Columbia

Re: ERSKY9X Coding

Post by PNaz »

My FAS100 has the 20k and 1k resistors in it. Those resistors were different from the original R2 and R5 resistors and caused the voltage scaling problems. I would not have noticed the amps reading low except that when I first hooked them up to previously unpaired motor/prop/esc/battery combo I also used the eagletree data recorder to see how accurate the FAS100 was. It was only after trying other ammeters that I realized the FAS100 was the one that was out by a large amount.

Yes, the WSHH output always says feet even when the WSHH is set for metres and MET selected on the second telemetry menu.

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

Re: ERSKY9X Coding

Post by MikeB »

Bit worrying, I reckon I put the WSHH metres/feet in, but I'm not sure the compiler generated the correct code, it seemed to use register r8 in a compare, yet it hadn't put anything in r8 first, unless I missed it.
Anyway, I've coded the same thing a bit differently and now I believe the code generated. It will go in the next revision.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Just committed r112

CHECK YOUR CUSTOM SWITCHES - the extra AND switches have changed

Add 3POS as mixer input - ID0/1/2 like FULL except -100, 0, +100
Fix altitude voice feet/metres - as previous post
Extra AND switches on custom switches changed - instead of SW1=SWC you have THR,RUD,ELE,ID0,ID1,ID2,AIL,GEA,SW1-SW7
Fix Condensed bug on LCD - didn't space characters properly
Sync. custom timer to AND switch - A custom switch timer is now held OFF, and starts within 1 second of the AND switch turning ON
Changed Ymodem for testing - not visible to users, this may be removed if/when mass storage USB is added.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Committed r114.

r113 improved/fixed voice output.

r114 Added stick analog gain option (for normal pots on the sticks). This is selectable, on a stick specific basis, on the RADIO SETUP2 menu at the bottom.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

No new release (yet), but I've been working on using the co-processor as a Real Time Clock. I've got the 32 kHz crystal going, and it is counting time (in seconds).
I've also hooked up a 5 FARAD super cap (2*10 FARAD, 2.7V in series) to the battery backup pins. By hooking the main 3.3 volt supply into one of the spare inputs, I can monitor for TX power off, and then switch to a low power mode. Seems to be working. Now testing to see for how long the supercap keeps it going. I'm not sure it will be long enough, I may have to try to reduce the power even further somehow.

Mike.

Looks like it's using 60 to 70 uA at present.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
olafnew
Posts: 99
Joined: Thu May 31, 2012 2:52 pm
Country: -
Location: Russia, Moscow
Contact:

Re: ERSKY9X Coding

Post by olafnew »

Mike - drop the suprecap approach. I've successfully used these (http://www.sii.co.jp/components/battery ... ecordID=75) in ultra-low power applications, much cheaper, and much more capacity and in much less occupied space(actually they are tiny!). Resistor and a diode work well as a charging circuit, lithium manganese batteries are much more resilient for "stupid" charging, that's why a resistor and a diode approach work well.

P.S. Maybe worth asking Brent to implement pads for the battery in v.3 revision of the board. Maybe not to have the battery soldered(to keep the costs down), but just to route a few pads, so that a user in need of RTC could of soldered one himself.
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

We have a 3-pin connector to allow the user to connect whatever they like as 'battery backup'. The current in standby mode is too high at the moment, the supercaps didn't last overnight! Even a 5.5mAh battery won't last more than a few days. In both cases, the charge time might not be long enough if the Tx is not switched on for a reasonable time.

Still working on this.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
olafnew
Posts: 99
Joined: Thu May 31, 2012 2:52 pm
Country: -
Location: Russia, Moscow
Contact:

Re: ERSKY9X Coding

Post by olafnew »

Mike - as a matter for discussion - what currents(in standby) we are talking about? tens of uA?
It maybe reasonable just to make a drop-in connector and a CR123 battery(non rechargeable). I am sure it will last for years, and opening a case once every 12-18 months, for a diyer, whom has fitted the board in the first place - shouldn't be a big problem.
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

I've only estimated the current by the rate of discharge of the supercap, but at the moment it looks to be between 50 and 100 uA. Ishould be able to improve on that, just need to disable or power down all parts not needed in standby, and maybe use a slower clock when woken up every second to keep the time. I could also only wake it up every 2 seconds.
I'll organise measuring the standby current and try all these to get the lowest standby current I can. I'd like to get down to 10uA or less.

Mike.
erskyTx/er9x developer
The difficult we do immediately,
The impossible takes a little longer!
User avatar
MikeB
9x Developer
Posts: 18015
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset, UK

Re: ERSKY9X Coding

Post by MikeB »

Well, I think I have the current down below 10uA now. Running from a power supply on the backup, with a 120 ohm resistor in series, I measure less than 1mV across the resistor (can my meter read that low accurately?).
On a scope, I can see a 100mV pulse occuring for about 100uS every second as the timer interrupt kicks the chip out of sleep mode to count another second. This is less than 1mA for 100 uS, spread over a whole second is less than 0.1uA.
Left the supercap on for some hours, it dropped 0.052 volts in 4.75 hours. For 5 Farads, that would be 15uA, some of which might be self discharge. I disconnected the charge wire in case there was some leakage back through the diode in that circuit.

Still got some more experiments to do, but this is looking promising.

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

Post Reply

Return to “erskyTx (was ersky9x)”