flashing latest er9x

er9x is the best known firmware. It has a superb range of features and is well supported by the community. Well worth trying out.
JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Mon Dec 28, 2015 9:20 pm

Hi everyone,
I've built a M128 board from scratch using serial LCD (http://www.hobbyking.com/hobbyking/stor ... K2_1_.html) with 'Multiprotocol TX' and having problem compiling MBTx to use left vertical trims as per original board (voice module NOT installed).The obvious 'fix' is to use PC0/PC4 for the trim inputs, however PC4 is already used for serial LCD clock line.
Can anyone point me to a compiling options file? Any help appreciated.


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

Re: flashing latest er9x

Post by MikeB » Mon Dec 28, 2015 9:39 pm

If you are getting a file mbtx.hex, then you are compiling for er9x V2. This is still in development, better, for now, to compile V1.
I suggest you do a "make clean", then do "make CPU=128 EXT=FRSKY". You may need to add extra options to get the serial LCD, I'm not sure what as I didn't add that code.This will build the standard er9x for the M128 processor.
If you don't have a voice module, then simply don't set the "Sound Mode" to "Megasound" (AudioHaptic menu), and make sure "M'Sound Serial" is set to OFF in the hardware menu. Then the left vertical trims work as per the original hardware.
Note that recent code disables the hardware menu by default. To enable it just hold the left horizontal trim to the left as you power on.

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

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Tue Dec 29, 2015 3:30 am

Mike,
I could not enable hardware menu on the radio by holding left trim to the left during power-up, but I could disable MegaSoundSerial in eePe and after re-flashing the EEPROM the trims work as expected.
Thanks again

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

Re: flashing latest er9x

Post by MikeB » Tue Dec 29, 2015 12:35 pm

I assume you downloaded the source code from Github. Did you download from the "master" branch or the "next" branch?

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

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Tue Dec 29, 2015 9:44 pm

yes, I have downloaded both master and next from Github. I've compiled and tested both. Neither has offered the hardware menu (or better, I could not find it in the radio setup menus). I have previously "Set fuses to protect EEprom" in eePe, perhaps that is the reason for the behavior.


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

Re: flashing latest er9x

Post by MikeB » Tue Dec 29, 2015 11:31 pm

The hardware menu isn't in the M64-FrSky version due to lack of flash space. It should be in the '128 and '2561 versions.

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

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Wed Dec 30, 2015 12:01 am

I am using and have compiled M128 version. Where does the hardware menu appear?

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

Re: flashing latest er9x

Post by jhsa » Wed Dec 30, 2015 12:04 am

Turn the radio ON while holding both horizontal trims away from each other. The hardware menu should now appear in the radio setup index..

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

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Wed Dec 30, 2015 12:28 am

Thanks João, it works now.

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

Re: flashing latest er9x

Post by jhsa » Wed Dec 30, 2015 12:36 am

;)
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

flybabo
Posts: 143
Joined: Wed May 16, 2012 11:41 pm
Country: United States
Location: SF Bay Area, CA

Re: flashing latest er9x

Post by flybabo » Wed Dec 30, 2015 4:10 am

JanRy wrote:Hi everyone,
I've built a M128 board from scratch using serial LCD (http://www.hobbyking.com/hobbyking/stor ... K2_1_.html) with 'Multiprotocol TX' and having problem compiling MBTx to use left vertical trims as per original board (voice module NOT installed).The obvious 'fix' is to use PC0/PC4 for the trim inputs, however PC4 is already used for serial LCD clock line.
Can anyone point me to a compiling options file? Any help appreciated.
As I wrote the serial LCD driver on er9x and I realized this problem for the serial LCD users.
Actually, LV trim can be rerouted to PC0/PC1 since LCD CS can be permanently tied to GND by removing 5K resistor in 5V-3.3V logic level translator just like PC4 (LCD WR).
But you need modified versions of 'lcd.cpp' and 'driver.cpp'.
I have a working version of 'lcd.cpp' with updated serial LCD code and plz PM me if you're interested in.

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Wed Dec 30, 2015 5:51 am

Hi flybabo,
thanks for writing serial LCD library. It made my project possible (re-using DX4e shell). I am happy with the outcome, since I've had no room for a sound module anyway. All is working now.
I am not entirely sure if CS can be left tied to the ground permanently. According to the data sheet: "Chip Select Input .... in case of serial interface, the internal shift register and the counter are reset."
I've had a minor issue with my KK2 LCD. It would not initialise on power-up, but when power was re-applied within 2sec, it would. So I've added a delay of about 30us holding RES high in lcd_init (2 places) and that fixed my issue.

flybabo
Posts: 143
Joined: Wed May 16, 2012 11:41 pm
Country: United States
Location: SF Bay Area, CA

Re: flashing latest er9x

Post by flybabo » Wed Dec 30, 2015 9:14 am

I think CS can be tied down even for the serial LCD since reset pulse will reset internal shift register and counter after power up.
Once these registers are reset, it is followed by a series of legitimate data transfers and it doesn't need to reset those registers again.
Since entire LCD data lines (PA0-PA7) are not used for a serial LCD, I better to add PA6/PA7 as LV trim rerouting option for serial LCD users to allow them to use the second UART ports for the serial voice card or multi-protocol module.
I also looked into the LCD code and lcd_init() generates 2us reset-low pulse and 1.5ms recovery time with reset-high before starting to set control bits.
Did you put 30us delay before generating 2us reset-low pulse?

flybabo
Posts: 143
Joined: Wed May 16, 2012 11:41 pm
Country: United States
Location: SF Bay Area, CA

Re: flashing latest er9x

Post by flybabo » Thu Jan 07, 2016 6:57 am

I just verified that both serial and parallel LCD code work with permanently tied down CS pin.
Since PC4 is used as SCLK in the serial LCD interface, I'll assign PC0/PC1 for "on-board" LV trim rerouting option to relieve the serial port in upcoming er9x-v2 firmware. Note that current er9x-v2 test version assigned PC0/PC4.
That means PC4 is always available for other application.

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Thu Jan 07, 2016 8:10 am

flybabo,
that's a very good news :D . I'll check with my KK2 LCD too.
I've added crudely 30us delay just before the reset pulse (@ approx line 910 & line 1000):
"
LcdLock = 1 ; // Lock LCD data lines

PORTC_LCD_CTRL |= (1<<OUT_C_LCD_RES);
delay_1_5us(30000);

PORTC_LCD_CTRL &= ~(1<<OUT_C_LCD_RES); //LCD_RES
"

flybabo
Posts: 143
Joined: Wed May 16, 2012 11:41 pm
Country: United States
Location: SF Bay Area, CA

Re: flashing latest er9x

Post by flybabo » Thu Jan 07, 2016 9:39 am

You'd added 30ms delay not 30us delay :)
Does KK2 LCD have a power-on-reset circuitry?

JanRy
Posts: 19
Joined: Mon Dec 28, 2015 8:59 pm
Country: -

Re: flashing latest er9x

Post by JanRy » Thu Jan 07, 2016 10:27 pm

yes, you are right, it is 30ms! When testing, it required minimum of 10ms, so I've added 30ms. Still a very short delay on power up.
The data sheet for KK2 lcd that I found doesn't mention power-on-reset circuitry.


Post Reply

Return to “er9x”