Pages: 1 2 [3] 4   Go Down
Author Topic: MAX7456 library update  (Read 15149 times)
0 Members and 1 Guest are viewing this topic.
Texas
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, I added PALmode( )....someone please let me know if it works, I have no way of testing it!
http://www.filefactory.com/file/c5da981/n/Max7456_osd.zip

Plasmawall : PAL mode should allow you to write 15 rows (instead of 13 for NTSC)  But did you have any luck with the
set_screen ( ) feature?

I'm re-posting a link to the Max font editing program.
http://www.maxim-ic.com/datasheet/index.mvp/id/5569

Also, I found this terminal program very helpful for transmitting my new font files to the arduino. I had to use the XonXoff setting.
http://www.hyperserialport.com/

And here is a good starting ASCII font file, I think dfraser made it, it was on the old forum.  There's plenty of open characters so you can start building your own.
http://www.filefactory.com/file/c3a0f25/n/ascii_font_set.mcm

My setup never worked correctly until I uploaded the ASCII font.
« Last Edit: February 16, 2012, 07:15:51 pm by btmcmahan » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

wondefull!

i'm gonna try pal mode right now! i will let you know in few hours if everything is ok.

anyway my ccd cam ouputs only pal but without input, ntsc works really fine so i think my screen is in bad mood with pal ( religion related i think^^).

i've managed to get a sketch to burn a new font file and then i use teraterm for sending mcm files( very easy, open teraterm and file-> send file-> pick your mcm and here we go!) i can pm you the sketch if you want to.

on my side i'm using the software from remzibi( it was intented to program a osd for a drone) the f2 let you use a great font editor with nice features like miroring characters, and you can see 2 characters at the same time, side to side without gap it's very useful to draw some icons or large letters wich takes 2 normal characters.
 
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay, everything works fine! pal mode is working 100% and the set screen size solved my problem. anyway in pal the osd has a lower resolution( not big difference but the outline of letters are flicking a little, making text not so readable( interlacing problem i think)
thank you so much btmcmahan
a last question, how( if possible) do you write a sentence with 0x** form? the fact is my font table is pretty big and i have to use some unpritable characters, i can use them with" osd.write(0xf1a);" but do i have to set the cursor and osd.write for every character or you, master of the code , have a solution to lighten my burden?

again thanks
Logged

Texas
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you can use this:
osd.put(0xF4,5,7);  will print the character to column 5 row 7
osd.write(0xF5);     will print the character to the next position

So you only have to set the position once with osd.put () and then osd.write () for the other characters.
I'm happy to hear everything else is working good for you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you made my day sir!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello  do you know how i could control two max7456? i know i should declare another slave select pin to send signal on the other max but how should i modify tour library? it's in order to drive a stereoscopic device so the most of characters are the same on both  ic could duplicate your library with another name and another pin for SS and copypaste my code linking to the new lib like:

#include "MAX7456_osd.h"
MAX7456 osdright;
MAX7456 osdleft;
void loop(){
osdright.write(0x91);
osdleft.write(0x92);

but it's memory expensive and pretty slow to run. is there a better way?

thanks for any advice
Logged

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

Define "memory expensive" and "slow".

There are about 7 "byte" variables per instance, and it writes at an SPI rate of1/4 of the system clock.

At least that's how it is in my version of the code.  Not sure about btmcmahan's version.

-j
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

my sketch is pretty large and on the way i'm seeing stereoscopy i've had to double it ( one part for the right and one part for the left camera) so basically it's going to take twice memory and twice time to execute( i'mworking with a mini arduino328) there is maybe a bit of superstition here but i think there is a better/smoother way ( and if i have to change something i don't want to do it twice on my sketch so i was looking to add a "side_byte" for "left" "right" and "both" to "void MAX7456::cursor(byte side,byte x, byte y, byte blink, byte invert, byte char_bg){" ( i've take cursor as an exemple but adding it to all functions and dependencies) right now it's not working.( i'm pretty new to c++ and arduino coding so i make a lot of mistakes and misunderstanding and it takes me times to really comprehend your work^^)


Logged

Texas
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay, I think this will do it.  There was something similar in the kg4wsv-zitron-dfraser version, but I didn't know what it did so I took it out!  Now I know what it did.  This should allow you to use as many OSD's as you want, but I only have one, so you'll have to let me know if it is working correctly.

In your H FILE, insert this:

Code:
class MAX7456 : public Print
{
 public:
  MAX7456();
  void begin();
  void begin(int ss_pin);          //************INSERT THIS LINE
  void slave_select(int ss_pin);   //************INSERT THIS LINE
// Setup Funtions
  void PALmode();

In your CPP FILE, insert this (near the beginning):

Code:
MAX7456::MAX7456(){
  _slave_select = MAX7456SELECT;
  _char_attributes = 0x01;
  _cursor_x = CURSOR_X_MIN;
  _cursor_y = CURSOR_Y_MIN;}

void MAX7456::slave_select(int ss_pin){  //************INSERT THIS LINE
  _slave_select = ss_pin;                //************INSERT THIS LINE
  pinMode(_slave_select,OUTPUT);}        //************INSERT THIS LINE

void MAX7456::begin(int ss_pin){         //************INSERT THIS LINE
  _slave_select = ss_pin;                //************INSERT THIS LINE
  begin();}                              //************INSERT THIS LINE

void MAX7456::begin(){
  byte spi_data;
 // int x;

In your sketch, you will have to "begin" each osd device in the setup:
Code:
osd.begin (14);  // Where one osd has slave select on pin 14
osd.begin (18);  // Where another osd has slave select on pin 18

In your loop, you can switch between each osd like this:
Code:
osd.slave_select(14);
osd.println("Stuff for the left screen");

osd.slave_select(18);
osd.println("Stuff for the right screen");
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yeah it works! i still haven't received my second max7456 but with one , switching between slave select pins and reseting the whole build i have 2 different displays.there is a slight problem,the PALmode() code isn't working on the second osd
the first one i'm using in my sketch is in pal but the second is set in ntsc.
Logged

Texas
Offline Offline
Newbie
*
Karma: 0
Posts: 16
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ya, that makes sense.  You need to upload your settings into each osd board.
You're gonna have to send the osd.PALmode( ) and osd.set_vm1( ) after each osd.begin().
Otherwise each board will begin with the default settings.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

okay i get it .thanks i understand how it works now. well the most of it...^^
Logged

Devon UK
Offline Offline
Jr. Member
**
Karma: 0
Posts: 67
If you dont ask you will never know
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.
Interesting reading...
I have used kg4wsv code with Both formats and they both work.
Many thanks for all the work you people have put in to developing the MAX7456 interface.
I am putting together the control system for my hobby RoV. ( Remotley operated Vechicle)

It's also would be nice to provide people with an example/keyword usage so people like myself can learn how it's done.  BTW this is not critisum of what you do.

Thanks again Antony
Logged

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

Huh, I thought I included an example that last time, but obviously I didn't.  Here's one:

http://www.eng.uah.edu/~jdw/avr/MAX7456_example.pde

This is a basic sketch that is meant for amateur radio callsign overlay (the call is NOCALL in the sketch).  It also displays battery voltage.  Here is the schematic for the hardware it runs on.

-j
Logged

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

Btmcmahan, I tried your most recent library posted here with the demo example, and I can't compile it. I get the following compile errors (and more like these):

/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:123: error: 'byte' has not been declared
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:124: error: 'uint8_t' has not been declared
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:127: error: 'byte' has not been declared
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:130: error: 'byte' has not been declared
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:133: error: 'byte' has not been declared
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:139: error: 'byte' does not name a type
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:140: error: 'byte' does not name a type
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:141: error: 'byte' does not name a type
/Users/macbookpro/Documents/Arduino/libraries/Max7456_osd/MAX7456_osd.h:142: error: 'byte' does not name a type
max7456_demo.pde: In function 'void loop()':
max7456_demo:17: error: 'class MAX7456' has no member named 'println'
max7456_demo:19: error: 'class MAX7456' has no member named 'print'
max7456_demo:21: error: 'class MAX7456' has no member named 'println'
max7456_demo:23: error: 'class MAX7456' has no member named 'println'
max7456_demo:25: error: 'class MAX7456' has no member named 'println'

I have your library loaded in the correct folder and am using Arduino 1.0.2.

Do you have any thoughts? I can usually follow code, but when it comes to libraries and the mapping of characters on screen, I am in the dark for the most part (but am trying to figure it out....).

I also tried the most recent library in this thread by Kg4wsv and the simple code he provided, (without loading the new ascii characters) and it works for the most part. I have noticed if I try to use a capital "C" it does not show, and may make some of the surrounding text disappear.

I would like to use Btmcmahan's library, as I want to put this on a mega (using an uno currently). Otherwise, I could use Kg4wsv's library and I imagine I would have to figure out how to update the pins in the library. I'd also like to figure out how to show the symbols in the Max745, but can't seem to figure that out from Kg4wsv's example.

If anyone has time to help me with any of these questions, I'd appreciate it.
Logged

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