MultiWii OSD - MWOSD

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
DUKE40
Posts: 16
Joined: Sat Apr 07, 2012 6:40 am

Re: MultiWii OSD - MWOSD

Post by DUKE40 »

Hi,

I got the following issue, I get no signal on Video Out of my MinimOSD.
Got the following configuration:
Flip32+ with Cleanflight 1.9
Ublox GPS connected to FC.
MinimOSD with MW OSD 1.4.1
Fatschark 600 TVL configured for PAL.

As long as RX and TX on the OSD is not connected to the FC I have a signal on Video Out of the OSD.
As soon as I connect RX and TX on the OSD with the corresponding pins on the FC, there is no signal anymore on Video Out.

I have no more idea where to look for the cause of this behaviour.
I have checked and double checked the setting of the FC, but with no success.

Anybody an idea what I should check and where the issue might be?

Would really appreciate any help or hint.

Regards,
DUKE40

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

shikra wrote:Yes, confirmed this is bug just introduced in previous. Thanks for highlighting. Fixed on Github and ,waiting for testing:
“Although I have 11 satellites they and arrow / distance are not showing up in this state”
...


Tested with v1.4.2.8 today. It seems top be fixed :)

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

@ Leo - brill - thanks
Also there may be an issue with saving rc and pid on .8 I hope fixed on the latest. i am waiting to get to my garage to test on a copter.

@ duke
Assuming this isnt a wiring issue, most likely is you have a blank screen layout selected. I can't think of any other cause. I've been caught out with that before!

DUKE40
Posts: 16
Joined: Sat Apr 07, 2012 6:40 am

AW: MultiWii OSD - MWOSD

Post by DUKE40 »

shikra wrote:@ Leo - brill - thanks
Also there may be an issue with saving rc and pid on .8 I hope fixed on the latest. i am waiting to get to my garage to test on a copter.

@ duke
Assuming this isnt a wiring issue, most likely is you have a blank screen layout selected. I can't think of any other cause. I've been caught out with that before!

What do you mean by blank screen layout selected? Without fc connected everything is showing right. Only when fc connected Mo signal in output! So this should neither be a wiring nor a screen layout issue. It looks rather like a configuration issue, but i have not found it despite a lot of tests.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

When osd is connected to the fc, it is able to ready the RC commands from the tx. If the RC channel used for switching OSD layouts is set to a blank one, it maybe that this then selects a different screenlayout which is set to show no data.

Set all the HUD - xx values to 0 on top RHS of display and click "write" to verify this.

You could also try disabling #define VSYNC in config.h

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Well, well well... I just installed v1.4.2.10 and guess what... NO more problems with clicking on the buttons using your compiled exe file :)
I can now also click in the GUI lag free.

I should add that when I click on "Simulate OSD" the GUI is unresponsive and I have to close the program.

Changing the frame rate e.g. to 30 or 60 doesn't cause any problems on my side.

However we are getting closer to some nice software :D

Now all you have to do is to find a fix for the font upload problem :)

DUKE40
Posts: 16
Joined: Sat Apr 07, 2012 6:40 am

AW: MultiWii OSD - MWOSD

Post by DUKE40 »

shikra wrote:When osd is connected to the fc, it is able to ready the RC commands from the tx. If the RC channel used for switching OSD layouts is set to a blank one, it maybe that this then selects a different screenlayout which is set to show no data.

Set all the HUD - xx values to 0 on top RHS of displ'ay and click "write" to verify this.

You could also try disabling #define VSYNC in config.h

Thanks for this hint, I will check it when back Home in two weeks.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

@ Leo - mad some changes to the GUI simulator handling. I cant replicate the issue which makes it difficult to resolve...

If you could try the latest compiled gui from release 11 it would be appreciated.
Try running it and if it still locks up, edit gui.cfg in data folder and change "Simtype to 0. Then restart the GUI

https://github.com/ShikOfTheRa/scarab-osd/releases

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

OK, I tested it on one of my computers at work. Per default I have near the same problems. GUI works until I click on sim. Then I have the problems.

When I change Simtype to 0 everything works perfectly. I can click on the buttons without delay while sim is activ.

I'll verify this later on my home computer.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

OK, thats interesting. I guess will have to make that default. Its not an issue - just makes the simulator less realtime / like a genuine controller. Of more value for me when developing
I have had a look through and can't see why. May never get to the bottom of this one.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Confirmed on my home PC as well. Simtype = 1 causes problems. Simtype = 0 works.

My home PC is a Intel Quadcore running at 3.2 GHz. My GFX is a Geforce GTX Titan.

Both PC's run on Win 7 in English. You are French right? You think that could be a compatibility problem? ;) :lol:

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Ha actually I did wonder if it was because you were French too! Serious -locale issues with France I have seen before.
I wonder if forcing the locale to be US might fix? I'll try it for future ones. See if any feedback...

I was born in England, lived in Wales all my life and my family is Italian :).
So I don't know what I am ... I guess whichever team is winning the football/rugby at the time! lol

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

No, I'm a born Canadian now living in Germany. Don't really know what I am either ;)

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Canada? - thats one of the US states yeah? :)

Been to Ottawa many times although not for a couple of years.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

shikra wrote:Canada? - thats one of the US states yeah? :)
...


:evil:

:lol:

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

I work for a Canadian company. Work with them every day.
I keep calling them Yanks or asking what the weather is like in the US. I have so much fun with them. Its been going on for 15 years and only a handful realise I'm joking with them! Makes me smile every time.

This is a long shot but the master contains a version compiled on my pc with locale forced to US. Might even be Java version related. Worth a shot.
https://github.com/ShikOfTheRa/scarab-o ... master.zip

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

shikra wrote:I work for a Canadian company. Work with them every day.
I keep calling them Yanks or asking what the weather is like in the US. I have so much fun with them. Its been going on for 15 years and only a handful realise I'm joking with them! Makes me smile every time.


Haha, try that with me once, twice.... the third time I'd make sure you spend the rest of your time with the bears way up in Nunavut :D

shikra wrote:This is a long shot but the master contains a version compiled on my pc with locale forced to US. Might even be Java version related. Worth a shot.
https://github.com/ShikOfTheRa/scarab-o ... master.zip


Just tried it. No luck. Using the default freezes the program as soon as I hit sim. The red button moves over but doesn't turn green.

AngryTraveler
Posts: 5
Joined: Thu Jul 30, 2015 2:47 am

Re: MultiWii OSD - MWOSD

Post by AngryTraveler »

Guys, I hope you can help me, I am beyond frustrated... I have a Naze32 Acro connected to a MinimOSD through the center serial port.

PROBLEM 1 - I am getting the flashing DISARMED alternating with NO DATA on the screen. I cannot seem to get the MinimOSD to pick up any flight data. I've combed the forums looking for any clues, but have so far come up empty.

I can write the firmware to the MinimOSD through the Arduino app, and have it loaded with Shiki-OSD r1.4, which shows up briefly on the screen upon boot. So I know the MinimOSD ports are alive.

Trying to run the MW_OSD_GUI for 32-bit Windows, version R1.4, it appears that I am getting a connection, but it is flashing "Waiting FC" which I assume is normal, because the FC is unplugged when I am using the USB port. HOWEVER...

PROBLEM 2 - If I press READ I don't get any indication that anything is happening. If I change a few settings and hit WRITE, I don't see anything happening either. If I disconnect and shut the program down, reconnect and press READ nothing I put in previously. It appears that the GUI is not talking to the MinimOSD at all.

So to summarize:

1) MinimOSD talks to the laptop through the Arduino app.
2) No communication between the MinimOSD and the GUI app.
3) No communication between the MinimOSD and the Naze32 Acro.

Baud rates are all 115,200, BTW.

Any ideas?

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Angryman:

Can be many reasons including config of the Naze.

FAQ #11 11 The OSD always shows DISARMED and one or more other items do not work

This usually means the OSD is not getting information from the Flight Controller
Ensure your connections are correct. Especially tx/rx orientation
Makes sure you are using the correct baud rate - 115k is default
You cannot share serial with other devices like telemetry
Note if using AIRPLANE mode it can be disabled in config.h
Baud rate in config.h MUST match baud rate in GUI (access via comsettings button)
BASEFLIGHT USERS - remove telemetry as follows:

feature -TELEMETRY
CLEANFLIGHT USERS - remove telemetry and enable GPS as follows:

feature -TELEMETRY
set serial_port_1_scenario = 5
set serial_port_2_scenario = 2
SAVE setting port 1 to 5 equates to MSP, CLI, GPS-PASSTHROUGH setting port 2 assigns it for gps , feature GPS will also need to be enabled
HARAKIRI USERS - ensure protocol set as follows:

tele_prot=0

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

@ leo. Love Canadians - give me so much entertainment! They haven't hit me yet....

For this issue. I just don't know where to go next. Have looked over the code many times and just can't see the problem area.
At least its the GUI - and I'll keep the working sim method as default unless I can fix it.

AngryTraveler
Posts: 5
Joined: Thu Jul 30, 2015 2:47 am

Re: MultiWii OSD - MWOSD

Post by AngryTraveler »

Shikra,

I have checked all those items, but I think the real issue is communication on the MinimOSD, as I cannot talk to it with the GUI either. I can upload from Arduino with no issues (although I get a memory warning error) and I can upload fonts (at least they appear to be uploading) but as I stated in my earlier posts, I cannot change any settings through the GUI. It looks to be completely uncommunicative. So if the laptop can't talk to it, presumably the FC cannot either.

Any ideas on that issue?

Trav

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

If using frsky rssi connected to the osd, unplug it.
swap tx/rx wires around on connector going to osd.

All I can think of really

Batperson
Posts: 18
Joined: Mon May 11, 2015 2:52 pm

Re: MultiWii OSD - MWOSD

Post by Batperson »

Hi,

I managed to set up a current sensor for my MW2.4 flight controller and got reasonably accurate values in MultiWiiGui, but only 0 in MWOSD. I also noticed someone was having a similar problem earlier in the thread. I think I may have found the culprit

Line 794 in MW_OSD.ino has:

Code: Select all

amperage = MWAmperage / 100;


Which is assuming that the value from the MSP_ANALOG message is in milliamps, but it is in 1/10 of amps - the same scale that MW Osd uses.
When I removed the / 100 from that line and recompiled, I got the same values in the OSD as MultiWiiGui. I hope this is able to help somebody.

AngryTraveler
Posts: 5
Joined: Thu Jul 30, 2015 2:47 am

Re: MultiWii OSD - MWOSD

Post by AngryTraveler »

Shikra,

SUCCESS! Since I was getting memory warnings from the Arduino loader, I disabled the features I wasn't using (like GPS) and recompiled. The new upload worked, and now everything's working. In fact, I uploaded it to the MicroMinim that I had on the shelf (because I couldn't get it working) and now that one works too.

Did they recently make a hardware change that would affect the memory availability? I bought mine through readytoflyquads.

Traveler

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Update on my part. I've updated my laptop to Win 10.
Using v1.4.2.11 I've executed the 32bit GUI with "Simtype = 0" and "Simtype = 1". On both instances the program ran without any issues. I now have to conclude the problems I have with some Win 7 machines is an isolated issue.
In my opinion you need not look further into it.

Sadly even with Win 10 the fonts won't upload :(
Now I have to ask: You just load the specific file and then click on Upload, correct?

PatrikE
Posts: 1957
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: MultiWii OSD - MWOSD

Post by PatrikE »

Batperson wrote:

Code: Select all

amperage = MWAmperage / 100;


Which is assuming that the value from the MSP_ANALOG message is in milliamps, but it is in 1/10 of amps - the same scale that MW Osd uses.
When I removed the / 100 from that line and recompiled, I got the same values in the OSD as MultiWiiGui. I hope this is able to help somebody.


I have same problem.

Tanx

AngryTraveler
Posts: 5
Joined: Thu Jul 30, 2015 2:47 am

Re: MultiWii OSD - MWOSD

Post by AngryTraveler »

On another issue: combed the forums and can't find a definitive answer: With a naze32 and a spectrum satellite received, how do you get RSSI? It looks like it's transmitted over the serial data link, but it's not showing up on the OSD when I configure it to use MW RSSI. Has anyone got this working?

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Because I'm most active in this thread atm I thought I'd post here that I won't be testing future OSD updates anytime soon....


(It's unlisted as what I'm doing is a bit illegal in Germany)

Oh, I'm not upset or anything at all... These things happen and I will be flying again... :)

csurf
Posts: 65
Joined: Mon Dec 23, 2013 5:59 am

Re: MultiWii OSD - MWOSD

Post by csurf »

Leo wrote:(It's unlisted as what I'm doing is a bit illegal in Germany)

Oh, I'm not upset or anything at all... These things happen and I will be flying again... :)


This is ridiculous and very stupid.
you admit that it's illegal, and yet you don't even bother to setup RTH and failsafe features, you just allow your quad to to randomly and irresponsibly crash into the ground, possibly causing damage or serious damage if it happens to hit something/someone. It's people like you and behavior like this that are ruining the hobby for the rest of us. Get a clue.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

What are you talking about??

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

– thanks for feedback on the GUI –it’s strange – have had one other report of similar issue so maybe there is a bug – or some common windows issue. Glad its solved.
- For fonts mmm I wonder if the voltage is dropping low when programming? Maybe when its rebuilt could measure to see if getting a good 5v on the OSD?. I will maybe try to build a sketch to load the font without a GUI. It would be a useful test.

@Patrik / Batperson
- For incorrect hardware sensor current from multiwii2_4 controller, this was from some misinformation from previous testing. Should be resolved in beta from v1.4.2.7 onwards

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

shikra wrote:...
- For fonts mmm I wonder if the voltage is dropping low when programming? Maybe when its rebuilt could measure to see if getting a good 5v on the OSD?. I will maybe try to build a sketch to load the font without a GUI. It would be a useful test.
...


I just measured V, W and A while uploading the fonts (v1.4.2.11). Absolutely no change. Constant 5.04V, 0.201W and 0.04A.

Edit: Just tried 1.5.0.0. Font upload still didn't work for me.

BTW:

// Mode bits
struct {
uint8_t armed;
uint8_t stable;
uint8_t horizon;
uint8_t baro;
uint8_t mag;
uint16_t camstab;
uint16_t gpshome;
uint16_t gpshold;
uint16_t passthru;
uint32_t osd_switch;
uint32_t llights;
uint32_t gpsmission;
uint32_t gpsland;
---> ;}mode;

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

thanks for the ";" ! I'll remove

For fonts...
For those having issues uploading via GUI, have created a sketch that will upload fonts. May look to see if can incorporate this in the main file at some point

Its in "Other" folder" simple instructions in the sketch.
https://github.com/ShikOfTheRa/scarab-o ... master.zip

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Scotty... we have a new problem...

I used the new font uploader, recycled the OSD and then uploaded OSD firmware.

When I connect to the OSD with the GUI "Waiting OSD..." flashes forever.


Update:

Now I'm in trouble!

I reverted back to 1.4.2.11 by uploading the firmware. I am now unable to connect to the OSD with 1.4.2.11 GUI as well.

Maybe I'm doing this all wrong???

Update 1:

I finally got the GUI to talk with the OSD.

I used "#define LARGE" in the font upload script but I still have the standard fonts showing in the GUI.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

For fonts - as its not changing using that sketch, it sounds like something is not right with the OSD - or power.

Just doublechecking ... is the OSD board powered by battery instead? rather than 5v? Not having it connected is most common cause of OSD font not updating.


You have some weird stuff going on! Maybe there is something not right with the OSD / programmer or cable. Although doesn't explain why can upload a sketch OK?

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Update 2

I'm using the voltage coming from the USB and it measures 5.04V.

I have 2 OSD's and both are v2.0.

The above tests were done on a computer at work.

Now I did tests on a computer (Win 7) AND on a laptop (Win 10) at home with a different USB cable.

I went through all the processes on both boards and the fonts will not change. I can change any other settings in the GUI and they all work.

I'm using Arduino 1.6.5 r2 and Processing 2.2.1.

I give up :(

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Is the max chip powered by 12v or vbat?
or is it via 5v (and the jumpers bridged with solder) ?

If its uploading sketch OK and can read / write all other settings it really sounds like something is not right with this.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Here is the board:

Image

I am powering the board via USB 5V when programming.

I'm starting to get this awful feeling.... does the video chip need to be powered by 12V in order to be able to program it? :?

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Needs to be powered same way it is when working in copter. Not quite sure from your pic.

edit- looking at your board I think that mod converts it to 5v so should be OK. But think maybe its somehow related. Has to be!

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

On my copter it is also being powered with 5V.

Edit: Well then I will have to give it a try and add 12V to the board and see what happens.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Well, I decided not to test the 12v variant as it is unnecessary because the chip is getting 5v.

I did use below code to upload Fonts from the same source and that seemed to work.
I tried your font file but it's not compatible.

Maybe you want to compare it with your code?

Code: Select all

// Thanks to doofusdog.org for this whole code !!

// Code to copy a MCM font file to the Arduino + Max7456 OSD
//
// MAX7456_font Sketch
// at 9600 baud it take about 1.5min to download a mcm file
// http://www.maxim-ic.com/tools/evkit/index.cfm?EVKit=558
// max7456 evaluation kit software



//******************************************   Define your OSD Board   ****************************************/
// Added by Carlonb (NEB). Select the harware you have
#define MINIMOSD
//#define RUSHDUINO

//*******************************************************************************************



#define DATAOUT 11//MOSI
#define DATAIN  12//MISO
#define SPICLOCK  13//sck

#if defined MINIMOSD
  #define MAX7456SELECT 6//ss
  #define MAX7456RESET 10//RESET
#endif

#if defined RUSHDUINO
  #define MAX7456SELECT 10//ss
  #define MAX7456RESET 9//RESET
#endif

#define VSYNC 0x02// INT0

//MAX7456 opcodes
#define VM0_reg   0x00
#define VM1_reg   0x01
#define DMM_reg   0x04
#define DMAH_reg  0x05
#define DMAL_reg  0x06
#define DMDI_reg  0x07
#define CMM_reg   0x08
#define CMAH_reg  0x09
#define CMAL_reg  0x0A
#define CMDI_reg  0x0B
#define STAT_reg  0xA0

//MAX7456 commands
#define CLEAR_display 0x04
#define CLEAR_display_vert 0x06
#define END_string 0xff
#define WRITE_nvr 0xa0
// with NTSC
#define ENABLE_display 0x08
#define ENABLE_display_vert 0x0c
#define MAX7456_reset 0x02
#define DISABLE_display 0x00

// with PAL
// all VM0_reg commands need bit 6 set
//#define ENABLE_display 0x48
//#define ENABLE_display_vert 0x4c
//#define MAX7456_reset 0x42
//#define DISABLE_display 0x40

#define WHITE_level_80 0x03
#define WHITE_level_90 0x02
#define WHITE_level_100 0x01
#define WHITE_level_120 0x00

#define MAX_font_rom 0xff
#define STATUS_reg_nvr_busy 0x20
#define NVM_ram_size 0x36

// with NTSC
//#define MAX_screen_rows 0x0d //13

// with PAL
#define MAX_screen_rows 0x10 //16

volatile byte screen_buffer[MAX_font_rom];
volatile byte character_bitmap[0x40];
volatile byte ascii_binary[0x08];

volatile byte bit_count;
volatile byte byte_count;
volatile int font_count;
volatile int  incomingByte;
volatile int  count;

float xx=0;

//////////////////////////////////////////////////////////////
void setup()
{
  byte spi_junk;
  int x;
  Serial.begin(9600);
  Serial.flush();
  pinMode(MAX7456RESET,OUTPUT);
  digitalWrite(MAX7456RESET,HIGH); //disable device
 
  pinMode(MAX7456SELECT,OUTPUT);
  digitalWrite(MAX7456SELECT,HIGH); //disable device

  pinMode(DATAOUT, OUTPUT);
  pinMode(DATAIN, INPUT);
  pinMode(SPICLOCK,OUTPUT);
  pinMode(VSYNC, INPUT);

  // SPCR = 01010000
  //interrupt disabled,spi enabled,msb 1st,master,clk low when idle,
  //sample on leading edge of clk,system clock/4 rate (4 meg)
  SPCR = (1<<SPE)|(1<<MSTR);
  spi_junk=SPSR;
  spi_junk=SPDR;
  delay(250);

  // force soft reset on Max7456
  digitalWrite(MAX7456SELECT,LOW);
  spi_transfer(VM0_reg);
  spi_transfer(MAX7456_reset);
  digitalWrite(MAX7456SELECT,HIGH);
  delay(500);

  // set all rows to same character white level, 90%
  digitalWrite(MAX7456SELECT,LOW);
  for (x = 0; x < MAX_screen_rows; x++)
  {
    spi_transfer(x + 0x10);
    spi_transfer(WHITE_level_90);
  }

  // make sure the Max7456 is enabled
  spi_transfer(VM0_reg);
  spi_transfer(ENABLE_display);
  digitalWrite(MAX7456SELECT,HIGH);

  incomingByte = 0;
  count = 0;
  bit_count = 0;
  byte_count = 0;
  font_count = 0;

  //display all 256 internal MAX7456 characters
  for (x = 0; x < MAX_font_rom; x++)
  {
    screen_buffer[x] = x;
  }
   count = MAX_font_rom;
   write_new_screen(); 

  Serial.println("Ready for text file download");
  Serial.println("");
  Serial.println("Please Send the MW_OSD_Team.mcm file ");
  Serial.println("");
  delay(100); 
}

//////////////////////////////////////////////////////////////
void loop()
{
  byte x;
 
  if (Serial.available() > 0)
  {
    // read the incoming byte:
    incomingByte = Serial.read();

    switch(incomingByte) // parse and decode mcm file
    {
      case 0x0d: // carridge return, end of line
        //Serial.println("cr");
       if (bit_count == 8 && (ascii_binary[0] == 0x30 || ascii_binary[0] == 0x31))
       {
          // turn 8 ascii binary bytes to single byte '01010101' = 0x55
          // fill in 64 bytes of character data
         character_bitmap[byte_count] = decode_ascii_binary();
         byte_count++;
         bit_count = 0;
       }
       else
         bit_count = 0;
      break;
      case 0x0a: // line feed, ignore
        //Serial.println("ln");   
      break;
      case 0x30: // ascii '0'
      case 0x31: // ascii '1'
        ascii_binary[bit_count] = incomingByte;
        bit_count++;
      break;
      default:
      break;
    }
  }
 
  // we have one completed character
  // write the character to NVM
  if(byte_count == 64)
  {
    write_NVM();   
    byte_count = 0;
    font_count++;
    xx+= 0.390;
    Serial.print((int)xx, DEC); 
    Serial.println("% done");
  }
   
 

  // we have burned all 256 characters in NVM
  if(font_count == 256)
  {
    font_count = 0;
      pinMode(MAX7456SELECT,OUTPUT);
  pinMode(MAX7456SELECT,HIGH);
    // force soft reset on Max7456
    digitalWrite(MAX7456SELECT,LOW);
    spi_transfer(VM0_reg);
    spi_transfer(MAX7456_reset);
    digitalWrite(MAX7456SELECT,HIGH);
    delay(500);

   // display all 256 new internal MAX7456 characters
   for (x = 0; x < MAX_font_rom; x++)
   {
      screen_buffer[x] = x;
   }
    count = MAX_font_rom;
    write_new_screen();
   
    Serial.println("");
    Serial.println("Done with file download");
    Serial.println("");
    Serial.println("You can now put the new KV_Team_OSD code via Arduino");
  }
}

//////////////////////////////////////////////////////////////
byte spi_transfer(volatile byte data)
{
  SPDR = data;                    // Start the transmission
  while (!(SPSR & (1<<SPIF)))     // Wait the end of the transmission
  {
  };
  return SPDR;                    // return the received byte
}

//////////////////////////////////////////////////////////////
void write_new_screen()
{
  int x, local_count;
  byte char_address_hi, char_address_lo;
  byte screen_char;
 
  local_count = count;
 
  char_address_hi = 0;
  char_address_lo = 60; // start on third line
 //Serial.println("write_new_screen");   

  // clear the screen
  digitalWrite(MAX7456SELECT,LOW);
  spi_transfer(DMM_reg);
  spi_transfer(CLEAR_display);
  digitalWrite(MAX7456SELECT,HIGH);

  // disable display
  digitalWrite(MAX7456SELECT,LOW);
  spi_transfer(VM0_reg);
  spi_transfer(DISABLE_display);

  spi_transfer(DMM_reg); //dmm
  //spi_transfer(0x21); //16 bit trans background
  spi_transfer(0x01); //16 bit trans w/o background

  spi_transfer(DMAH_reg); // set start address high
  spi_transfer(char_address_hi);

  spi_transfer(DMAL_reg); // set start address low
  spi_transfer(char_address_lo);

  x = 0;
  while(local_count) // write out full screen
  {
    screen_char = screen_buffer[x];
    spi_transfer(DMDI_reg);
    spi_transfer(screen_char);
    x++;
    local_count--;
  }

  spi_transfer(DMDI_reg);
  spi_transfer(END_string);

  spi_transfer(VM0_reg); // turn on screen next vertical
  spi_transfer(ENABLE_display_vert);
  digitalWrite(MAX7456SELECT,HIGH);
}

//////////////////////////////////////////////////////////////
byte decode_ascii_binary()
{
  byte ascii_byte;

  ascii_byte = 0;
 
  if (ascii_binary[0] == 0x31) // ascii '1'
    ascii_byte = ascii_byte + 128;

  if (ascii_binary[1] == 0x31)
    ascii_byte = ascii_byte + 64;

  if (ascii_binary[2] == 0x31)
    ascii_byte = ascii_byte + 32;

  if (ascii_binary[3] == 0x31)
    ascii_byte = ascii_byte + 16;

  if (ascii_binary[4] == 0x31)
    ascii_byte = ascii_byte + 8;

  if (ascii_binary[5] == 0x31)
    ascii_byte = ascii_byte + 4;

  if (ascii_binary[6] == 0x31)
    ascii_byte = ascii_byte + 2;

  if (ascii_binary[7] == 0x31)
    ascii_byte = ascii_byte + 1;

  //Serial.print(ascii_byte, HEX);

  return(ascii_byte);
}

//////////////////////////////////////////////////////////////
void write_NVM()
{
  byte x;
  byte char_address_hi, char_address_lo;
  byte screen_char;

  char_address_hi = font_count;
  char_address_lo = 0;
 //Serial.println("write_new_screen");   

  // disable display
  digitalWrite(MAX7456SELECT,LOW);
  spi_transfer(VM0_reg);
  spi_transfer(DISABLE_display);

  spi_transfer(CMAH_reg); // set start address high
  spi_transfer(char_address_hi);

  for(x = 0; x < NVM_ram_size; x++) // write out 54 (out of 64) bytes of character to shadow ram
  {
    screen_char = character_bitmap[x];
    spi_transfer(CMAL_reg); // set start address low
    spi_transfer(x);
    spi_transfer(CMDI_reg);
    spi_transfer(screen_char);
  }

  // transfer a 54 bytes from shadow ram to NVM
  spi_transfer(CMM_reg);
  spi_transfer(WRITE_nvr);
 
  // wait until bit 5 in the status register returns to 0 (12ms)
  while ((spi_transfer(STAT_reg) & STATUS_reg_nvr_busy) != 0x00);

  spi_transfer(VM0_reg); // turn on screen next vertical
  spi_transfer(ENABLE_display_vert);
  digitalWrite(MAX7456SELECT,HIGH); 
}

neokiller62
Posts: 2
Joined: Wed Aug 05, 2015 7:13 pm

Re: MultiWii OSD - MWOSD

Post by neokiller62 »

Dear all,

After fond load, i've got theses strange characters on screen.
How to correct it?

Thank you
Attachments
mwosd.jpg

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

Well, I FINALLY got the new fonts uploaded to the OSD! :)

Here is how to do it:

1. Download the modified "default large" font file: http://www.leo.nutz.de/images/helicopters/forums/default_large_CR.mcm (Carriage return is required in each line)
2. Compile the code found in my last post to the OSD.
3. Download (http://ttssh2.osdn.jp/index.html.en) and run "Teraterm". Select the com port of your OSD and then under "File" -> "Send file..." upload the font file to your OSD.
4. Now you can upload the latest MWOSD firmware.
5. Enjoy

Since this has worked for me I must conclude that there is a software glitch in MWOSD for uploading fonts.

DUKE40
Posts: 16
Joined: Sat Apr 07, 2012 6:40 am

Re: MultiWii OSD - MWOSD

Post by DUKE40 »

shikra wrote:When osd is connected to the fc, it is able to ready the RC commands from the tx. If the RC channel used for switching OSD layouts is set to a blank one, it maybe that this then selects a different screenlayout which is set to show no data.

Set all the HUD - xx values to 0 on top RHS of display and click "write" to verify this.

You could also try disabling #define VSYNC in config.h


Hi Shikra,

back home, I tested a few things today, and this is what I found:
* only GND and 5V connected to FC, still no signal on Video Out.
* Powered by external battery, not connected to FC, everything is fine.

So, it is not linked to the signal coming from the FC, it seems rather to be an issue with the power coming from the FC.
Could it be that it provides not enough power for it to work? Despite the LEDs showing no unusual signs! Blue LED always on and green LED blinking fast.
Could it be, that I need to power the OSD directly from a 5V source and not through the FC?
The FC is powered through a StepDown with 600mA, which is powering the receiver and the GPS as well, maybe I should change it to a 1A StepDown.
What do you think?

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

Duke - yes quite possibly. max chip takes a lot of power. Can tell by how hot it gets.
I think its up to 450ma from memory - but can also depends upon impedance of camera and transmitter it is connected to.

Just have to try it to find out...

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

@leo,

today this has been added to maybe assist in working around this bug until find the cause:
//#define LOADFONT_DEFAULT // Uncomment to force an upload of default font instead of using GUI
//#define LOADFONT_LARGE // Uncomment to force an upload of large font instead of using GUI

Its in latest dev:
https://github.com/ShikOfTheRa/scarab-o ... master.zip

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: MultiWii OSD - MWOSD

Post by shikra »

@neokiller62 - please check the faq. fonts need to be uploaded, but there are some notes to go with it.

good luck

neokiller62
Posts: 2
Joined: Wed Aug 05, 2015 7:13 pm

Re: MultiWii OSD - MWOSD

Post by neokiller62 »

@shikra - I have done a font update, it didn't change anything...

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

shikra wrote:@leo,

today this has been added to maybe assist in working around this bug until find the cause:
//#define LOADFONT_DEFAULT // Uncomment to force an upload of default font instead of using GUI
//#define LOADFONT_LARGE // Uncomment to force an upload of large font instead of using GUI

Its in latest dev:
https://github.com/ShikOfTheRa/scarab-o ... master.zip


OK, using your new build here are my results:

1. Forced LOADFONT_LARGE upload
2. Uploaded MWOSD firmware
3. Hooked up OSD to my (rebuilt :D ) Quadcopter
4. Turned on QC and FPV goggles -> WE HAVE LARGE fonts! YEA 8-)
5. OK, so now to see if they show up in the GUI as well. Loaded GUI and connected to the OSD. GUI shows default fonts :(

Next... the same steps except I forced DEFAULT fonts. Everything AOK. Goggles show DEFAULT font on the screen.

HHmmmmm.....

Lets try uploading the LARGE fonts via GUI. Restarted the GUI and connected to the OSD. Fonts in the GUI show DEFAULT version... Darnit!

OK, lets hook up the OSD to the QC and see what the screen shows. Plugged power to the Screen and then to the QC. Looked into the screen and said quietly... WTH!! It showed the LARGE fonts on the screen!

To confirm I ran the GUI once more and upload BOLD fonts via the GUI. After that I restarted the GUI and connected to the OSD. GUI showed DEFAULT fonts.
I then hooked up the OSD to the QC and and showed the BOLD fonts! So GUI upload in this version is working but only shows the DEFAULT fonts in the GUI screen. In teh past that used to be different. The uploaded font version on the OSD would show correctly in the GUI.

I am a bit of a lose right now..... but I hope my explanation helps you out.

User avatar
Leo
Posts: 372
Joined: Wed Sep 17, 2014 7:01 am
Location: Germany
Contact:

Re: MultiWii OSD - MWOSD

Post by Leo »

neokiller62 wrote:@shikra - I have done a font update, it didn't change anything...


Neo... before you do anything else download the latest build which shikra posted above.

Use the GUI to upload e.g. LARGE fonts. Hook up your OSD to your Multicopter and and let us know what you see in your goggles.

Oh, and don't forget to power the OSD with 5V from the FC and 12V from an external source (but only if you haven't done the 5V OSD mod!)

Post Reply