Pages: 1 [2] 3 4 ... 13   Go Down
Author Topic: Arduino + MAX7456 OSD  (Read 36082 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, all the characters have a single black pixel outline.  Using the Maxim util you could edit any of them to say have a two pixel black outline if you wanted.  Also by setting a bit in the command sent to the MAX7456, you can just invert the entire character to black.

dfraser
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey your code worked perfectly! (Well, after I changed NTSC to PAL, duh!)

Here's my setup:

Breadboard:


After I got it working on breadboard, I put everything together so it will fit in my RC plane:


Hello World!!


Thanks a lot for sharing your work, much less work for me to get it working!  smiley

Cheers,
-Z-
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you dfraser,

This is an excellent building block for MAX7456 OSD work. I'm just waiting for a breakout board to mount the MAX device now.

Your code will be a magical head start for me in my intended application.

Thank you very much for sharing your code with us all.

With Regards

Mike.

Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Just to return the favour, I've made an easier to use write_to_screen function that allows you to print a string to a (x,y) location on the screen, and set whether you want it to blink or invert colour:

Example:

OSD_write_to_screen("Hello World", 3, 5, 1,0);


Code:
// ============================================================   WRITE TO SCREEN
void OSD_write_to_screen(const char s[], byte x, byte y, byte blink, byte invert){
  unsigned int linepos;
  byte local_count;
  byte settings, char_address_hi, char_address_lo;
  byte screen_char;

  local_count = 0;

  char_address_hi = 0;
  char_address_lo = 0;
  
  /*
  Serial.print(x,DEC);
  Serial.print(" - ");
  Serial.print(y,DEC);
  */
  
  // convert x,y to line position
  linepos = y*30+x;
  
  // divide in to hi & lo byte
  char_address_hi = linepos >> 8;
  char_address_lo = linepos;
  
  // clear the screen
  //OSD_clear();
  
  settings = B00000001;
  
  // set blink bit
  if (blink) {
    settings |= (1 << 4);       // forces nth bit of x to be 1.  all other bits left alone.
    //x &= ~(1 << n);      // forces nth bit of x to be 0.  all other bits left alone.  
  }
  // set invert bit
  if (invert){
    settings |= (1 << 3);       // forces nth bit of x to be 1.  all other bits left alone.
  }

  
  digitalWrite(MAX7456SELECT,LOW);

  spi_transfer(DMM_reg); //dmm
  spi_transfer(settings);

  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);
  
  
  while(s[local_count]!='\0') // write out full screen
  {
    screen_char = s[local_count];
    spi_transfer(DMDI_reg);
    spi_transfer(screen_char);
    local_count++;
  }
  
  spi_transfer(DMDI_reg);
  spi_transfer(END_string);
  
  spi_transfer(DMM_reg); //dmm
  spi_transfer(B00000000);

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

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Check out the video of my FPV OSD testing using the above code (and some more stuff).

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your video looks great.  I've been off on a two week vacation (sans computers) so I was surprised by the activity and what you have done with your OSD MAX7456.

I will try and post some more code in the next week.  Though I have never done one before, I suppose I should look into putting together a MAX7456 library.

That would make it easier for everybody to use.

dfraser
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well work finally let up enough for me to finish up this last MAX7456 util.  This sketch allows you to use the MAX7456 Eval software 'Display Memory File Builder' function.  With it you can quickly create a screen, with attributes, like blink, invert and background and then upload that to the Arduino + MAX7456.  It is very useful if you are using border or underline graphic characters.

(Make sure that the mcm file referenced by the mdm file is in fact the one MAX7456 NVram uses.  Please see the MAX7456_font software above.)


Selecting a character



Setting character attributes



Final display (though it doesn't show in the picture, the word 'TEST' is blinking on and off)



Here is a zip file with the sketch code, the mdm test file and a copy of the arduino.mcm file.
http://home.comcast.net/~ds-fraser/forumimages/mdm_arduino.zip

I hope that this will be of some use to people playing with the Arduino + MAX7456 OSD.

dfraser
Logged

0
Offline Offline
Full Member
***
Karma: 1
Posts: 223
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome! This should be very useful, thanks for the work!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.

I have made an OSD using the MAX chip. The Max chip is connected to a ATMega168 and I'm using the whole system to display an scale overlay on the rear-view camera monitor in my car. The goal is to display the distance from objects, when parking, on the rear-view monitor.
So far I have succeeded in showing information on the monitor using the max chip.
What I need to do is customize the character set to make some custom graphics that I need.
I think that you guys can help me out on this.
 
Is there anyway that I can use the above mentioned programs to program my ATmega168 so that it can burn the custom graphics into the MAX chip?

The board that I'm using has a built in serial port connection using a MAX232 chip.

Can someone please make a small step by step tutorial on how I would go about using the above files with my setup?

 Excuse me for the long post and all the newbie questions :-[
« Last Edit: November 16, 2008, 01:41:52 pm by tolisn » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, if your ATMega168 talks to the MAX7456 via SPI (which if would have to do to display characters) then yes it should be possible to set it up to change the MAX7456's eeprom set.  Having said that I would need to know much more info about your board.

dfraser

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey thanks for replying. What info do you need about my board. I would be more than happy to tell you. smiley
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 40
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well to cut through all the back and forth on this, there are a couple of ways to proceed.

The easiest (and best) would be to get an Arduino + Proto shield and put together a setup like the ones described here.  Then down load the MCM burning code and away you go.

If your MAX7456 is not on a daughter card, then you could still use the Arduino to burn a modified version of the MCM sketch to work with your board (ie changed SPI & serial pin numbers, clock speed, etc).  Swap the Arduino 168 with yours and program the 7456.

If your 168 is not a socket dip, I suppose you could try in circuit programming, if your system allows it, again with a modified MCM sketch.

The sketch code for changing the 7456 eeprom is nothing terribly complex and could be rewritten in straight 'C' to make it more generic.

If none of the above seems workable then I'm at a loss and not sure what to tell you.

I'm afraid, as only you know how you built this system, only you can tell which technique would be the best to use.

dfraser
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok. Let me get his straight.

1. I have to get an arduino board and connect it to my MAX7456 board via the SPI interface
2. I then upload the sketch to the arduino board using the Arduino UI and run it
3. After that I use hyper terminal to send the MCM code to the arduino which in turn decodes it and sends it to the MAX7456 for burning
4. What protocol do you use to send the file from hyper terminal ?
5. Will any arduino board do, or do I have to get a certain model?

Please feel free to fill in the dark spots


Regards and thanks for your time  
« Last Edit: November 17, 2008, 02:50:10 pm by tolisn » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 26
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey this nice!  There are definitely some Amateur Television (ham radio) applications for this!
Logged

Ham radio operator AD8BC
Electrical controls engineer, industrial control panel designer, and Allen Bradley & Modicon PLC Programme

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Hey this nice!  There are definitely some Amateur Television (ham radio) applications for this!
Sure are - the price for an ATV video overlay board borders on obscene.  I figure for the price and size of the last one we bought, the GPS should have been thrown in there, too.

There are general purpose display opportunities, too.  According to the datasheet the MAX7456 can generate output without an input signal.  This could allow some interesting display capabilities (although probably monochromatic).

My Sparkfun order arrived today, and the Digikey order should arrive in a couple of days.  Then I'll have all the parts I need to get started playing.

-j

Logged

Pages: 1 [2] 3 4 ... 13   Go Up
Jump to: