Go Down

Topic: MAX7456 library update (Read 36399 times) previous topic - next topic


I've made a few updates to the MAX7456 video overlay library.  The begin() function now has a second optional boolean parameter that causes the library to translate from ASCII to the MAX7456 native character set.  This allows you to use the MAX7456 straight out of the box - no character memory reloading required!  Just use osd.begin(SLAVE_SELECT, true); to take advantage of the translation.

It has also been updated to work with the soon to be released Arduino 1.0.

This functionality has not been tested extensively; please PM me if you have problems.

The latest version can be downloaded at http://www.eng.uah.edu/~jdw/avr/MAX7456_lib_2011-10-31.tar.gz .



We have been trying for two days to get the sparkfun max7456 going on some of D Frasers code and have up loaded the new character set.
The funny characters in the picture were there from the start before the new character sets.  we downloaded your library but winzip free trail version barffs on the file format.  Any chance of pointing towards a windows zip file of your work or please if anyone has a clue as to why the characters please let us know.  Skill levels fairly low on our side.  Thank you for your time


kg4wsv, thank for posting the library.

I'll try the library out on my home made OSD shield, once the PCB's come back from the manufacturers.


we downloaded your library but winzip free trail version barffs on the file format.

It's a gzipped tarball; I thought winzip could handle those.  I've extracted it on the web site; it's a directory and two files.  You can grab them and recreate in your libraries folder.


if anyone has a clue as to why the characters

Looks like maybe you were not completely successful in converting the character set, or maybe the character memory didn't get cleared?

Try a sketch with the updated library; if you get the same (garbage) results, you may need to try doing the character set conversion again.



Thanks for the quick response.  The character set is stuck in the old one with the first space character corrupted so if you change the original d fraser code with the mapping in to char32 = any other character in the old table it will put in the correct character.  Using teraterm to up load and it takes the three minutes as suggested.
Downloaded the two files thank you and created a directory in the libraries folder and ran one of your first sample sketches but get this
error as we said fairly low skilled in C.  Any help appreciated

MAX7456_lib_test.cpp: In function 'void setup()':
MAX7456_lib_test:14: error: no matching function for call to 'MAX7456::begin()'
C:\Users\......\Downloads\arduino-0022\arduino-0022\libraries\MAX7456/MAX7456.h:105: note: candidates are: void MAX7456::begin(byte, boolean)
MAX7456_lib_test.cpp: In function 'void loop()':
MAX7456_lib_test:60: error: 'class MAX7456' has no member named 'noblink'
MAX7456_lib_test:67: error: 'class MAX7456' has no member named 'noblink'
MAX7456_lib_test:68: error: 'class MAX7456' has no member named 'noinvert'


ran one of your first sample sketches

Wow, that MAX7456_lib_test is ancient.  It isn't compatible with the library (except maybe an extremely early 0.0.0 alpha version).  Thanks for pointing this out - I'll get rid of it.

Try this code.


Code: [Select]
// video overlay for ATV
// code for the kg4wsv video overlay board
// 8MHz board, internal 8MHz oscillator, MAX7456, 3:1 voltage divider on analog input 3
// kg4wsv at or near gmail

#include "MAX7456.h"
MAX7456 osd;

#define MAX7456_SELECT 10

void setup()

  osd.begin(MAX7456_SELECT, true); // true means we're using the MAX7456 native character set
                                   // remove if you've done the ASCII character set load on your 7456

void loop()
  float voltage;
  // 3:1 voltage divider, 5V reference, 10 bit ADC
  voltage = 4.0 * 5.0 * ((float) analogRead(3)) / 1024.0;

  osd.print("KG4WSV              ");
  osd.println("V    ");

  Serial.print("KG4WSV ");



thanks, compiled and uploaded, have fixed the dud character in the max unit. Still have a little maybe hardware issue where the characters only turn up after the video source is turned off, but the serial output shows that the voltage keeps on being read.  Thanks again will keep on playing


Hello, I have a problem  :smiley-red:, the characters only turn up after the video source is turned off can you help me to solve it please?



This the point where we usually ask for a schematic and your code...

Sounds like a bad video signal, or a hardware problem.  Does the MAX7456 pass the video through while connected?

Is this PAL or NTSC?  THe library is written for NTSC; you'll have to change code in the library to support PAL.

The MAX7456 has 4 "modes" for the output sync signal.  They are:

  • use the eternal source

  • use an internally generated sync

  • use external if it's there, otherwise use the internal

  • no sync; no display

The library uses the third mode (use external if available, internal otherwise) because it allows the most flexibility and it's always worked for me.  Your problem sounds as if there may be a bad signal on the input.



OK PAL or NTSC is the problem. I work with PAL signal and when I imput a NTSC signal the MAX7456 work perfectly and now... What library I have to change and what lines must I change for work perfecly in PAL mode?

sorry for my bad english. Thanks


In the file MAX7456.cpp, look for this code starting at line 152:
Code: [Select]
// make sure the MAX7456 is enabled

Change the line
Code: [Select]

to this
Code: [Select]

Please report back if that solves the problem.  I'm aware that lots of the world uses PAL, but I don't have any hardware to test with, so I haven't added code to switch to PAL mode.  If this works for you, I'll try to add a PALL switch to the library.



I've added a new function to the library:  PALmode().  Call it after begin(), e.g.
Code: [Select]
  osd.begin(MAX7456_SELECT, true);

you can download it at http://www.eng.uah.edu/~jdw/avr/MAX7456_lib_2011-12-18.tar.gz

If you try it, please let me know the results.



Jan 12, 2012, 03:08 am Last Edit: Jan 12, 2012, 03:16 am by btmcmahan Reason: 1
KG4WSV, first I want to thank you for all your hard work on the Max7456.  Maybe you are the one who can help me.  I've tried almost every lib I can find online, and I just can't get mine to work.  I'm using an Arduino Mega 1280 with the Sparkfun max7456 Breakout Board.

In max7456.H,  I changed your code:
Code: [Select]

#define MAX7456_DATAOUT 11//MOSI
#define MAX7456_DATAIN  12//MISO
#define MAX7456_SCK  13//sck
#define MAX7456SELECT 10//ss
#define MAX7456_VSYNC 2// INT0

to this, for the Mega:
Code: [Select]
#define MAX7456_DATAOUT 51//MOSI
#define MAX7456_DATAIN  50//MISO
#define MAX7456_SCK  52/sck
#define MAX7456SELECT 53//ss
#define MAX7456_VSYNC 2// INT0

Next, I changed your sketch code from:
Code: [Select]
#define MAX7456_SELECT 10
Code: [Select]
#define MAX7456_SELECT 53
I have the Max Breakout Board DIN to 50, DOUT to 51, SCK to 52,  CS to 53, and VSYNC to 2.  I feel like I'm making some stupid mistake, because it all seems SO simple.

I'm not getting any kind of text on my screen.  Also, I'm having the same problem as everyone else, my screen only displays for 5 or 10 seconds...and yes, I have Max RST on a 10k resistor to +5V.
I feel like I'm taking crazy pills!  If anyone can help me I will forever be in your debt!


Thanks, but really dfraser and zitron did the hard work - I just packaged their work and changed a bit to suit myself. :)

I don't know of anyone who has used the library to interface with the MEGA - I know I haven't.

Your pins look right, but I wonder if the SPI registers are configured the same on the ATmega1280 as on the ATmega8 family?

FYI, the VSYNC/INT connection isn't used.



Well, that gives me something to look into.  Any ideas about the video going in and out every few seconds?

Go Up