Pages: 1 ... 10 11 [12] 13   Go Down
Author Topic: Arduino + MAX7456 OSD  (Read 37784 times)
0 Members and 2 Guests are viewing this topic.
Denmark
Offline Offline
Newbie
*
Karma: 0
Posts: 27
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yapahoe@
All the files and schematic you need are here:
http://doofusdog.org/arduino_stuff.html

Thanks to -dfraser-  
Logged

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

Hello everybody,

How difficult should be build this kind of device :
1 video input
1 video output that will dispaly the video input + some caption being sent by pc (RS232 or any other way) ??

Is anybody want to build it for me ? I need it ASAP. Here is my mail : ofer@987.co.il please let me know how much it will cost and how much it will take.

Thanks & regards,
Ofer
Logged

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

First, I want to thank everyone for this thread.  I have an Uno and MAX7456 breakout and it is working fine for writing to the screen.

I am having a problem which I can not seem to figure out.
 I want to count the number of frames and display the frame count on the screen.  I am trying to use VSYNC as an interrupt, but I can't get it working.  

I am a rank novice at this type of work and I could use some help.

Here are my connections:

Uno / MAX Breakout
D13 -> SCK
D12 -> DOUT
D11 -> DIN
D10 -> CS
D6 -> 1kOhm -> RST
D3 -> VSYNC
D3 -> 1kOhm -> +5v   (added to solve vsync problem)
GND -> GND
+5v => +5v

I've also attached interrupt 0 (D3) => VSYNC through a 10kOhm as a debugging attempt.

Here is the sketch I have been working with:

Code:
// interrupt code based on work by Andrea Di Dato 2010
#include "MAX7456.h"
MAX7456 osd;

int enablePin = 6;                      // MAX7456 enable pin
volatile int VSYNC_count = 0;      // count VSYNC
int intPin = 0;                        // interrupt pin
char st1[] = "000000000000";     // string representing frame count

void setup() {
  
  // OSD  (osd.write(string, position, line)
  // hardware reset MAX7456
  pinMode(enablePin, OUTPUT);    // initialize enable pin of MAX7456
  digitalWrite(enablePin, LOW);     // disable chip
  delay(1000);                            // delay to see the reset happen
  digitalWrite(enablePin, HIGH);   // enable chip

  osd.begin();                            // initialize OSD routine
  osd.clear();                            // redundant memory clear

attachInterrupt(intPin, CountVSYNC, FALLING);  // attach interrupt
}  

void loop() {
}


void PrintOSDFrame() {
  osd.write_to_screen("Hello World", 1, 1);   //write to row 1, column 1
  itoa(VSYNC_count, st1, 10);                 // convert int to char strng
  osd.write_to_screen(st1, 1, 10);           //write vsync count to row 10
}

void CountVSYNC() {        // Vsync interrupt function
  VSYNC_count++;               // increment vsync count
//  noInterrupts();
  PrintOSDFrame();              // call write to screen function
//  interrupts();
}

This appears to never detect the vsync interrupt since no display ever gets written to the screen. If I move the three PRINTOSDFRAME lines to  the loop, hello world and 0 are displayed.

I have tried a lot of different configurations, disconnected/reconnected, etc. and have gotten nowhere.  I feel like I am missing something silly.

UPDATE: I think I just found the something silly.  Looking at the MAX7456 datasheet it indicates the vsync signal needs to be pulled high through a 1kOhm resistor.  I'll give that a try tomorrow.  I'll leave this note in here in case anyone else is interested in using the vsync.

UPDATE: Connecting the VSYNC to +5v through a 1kOhm resistor did fix the problem.  I have updated the above note to indicate the problem was solved and to provide the correct connections for using vsync.
« Last Edit: November 17, 2010, 01:18:10 am by tonycc » Logged

Batangas, Philippines
Offline Offline
Newbie
*
Karma: 0
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@kg4wsv, you may have overlooked these definitions but just minor things:

MAX7456.h:
Code:
// background mode brightness (percent)
#define BACKGROUND_BRIGHTNESS_0 0x00
#define BACKGROUND_BRIGHTNESS_7 0x01
#define BACKGROUND_BRIGHTNESS_14 0x02
#define BACKGROUND_BRIGHTNESS_21 0x03
#define BACKGROUND_BRIGHTNESS_28 0x04
#define BACKGROUND_BRIGHTNESS_35 0x05
#define BACKGROUND_BRIGHTNESS_42 0x06
#define BACKGROUND_BRIGHTNESS_49 0x07

#define BACKGROUND_MODE_GRAY 0x08

they are on bits 6, 5 & 4 according to the datasheet, should be:
Code:
// background mode brightness (percent)
#define BACKGROUND_BRIGHTNESS_0 0x00
#define BACKGROUND_BRIGHTNESS_7 0x10 //
#define BACKGROUND_BRIGHTNESS_14 0x20 //
#define BACKGROUND_BRIGHTNESS_21 0x30 //
#define BACKGROUND_BRIGHTNESS_28 0x40 //
#define BACKGROUND_BRIGHTNESS_35 0x50 //
#define BACKGROUND_BRIGHTNESS_42 0x60 //
#define BACKGROUND_BRIGHTNESS_49 0x70 //

#define BACKGROUND_MODE_GRAY 0x80 //
Logged

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

Thanks for the info.  Fixed!

-j
Logged

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

im having a minor issue.

i am using an arduino Mini. an ssop adapter (dipmicro.com) + MAX7456.
have wired it up. and trying to upload the ascii_font_set.mcm file
from http://doofusdog.org/files/Arduino+MAX7456_OSD.zip

the "MAX7456_mcm_font.c"  compiles and uploads fine.

after reboot my NTSC LCD shows the full original "japaneese" charset

hyperterm connects fine (9600 8N1 )
and i get the "Ready for text file download"  message

i use "send text file"  to send the  ascii_font_set.mcm file

but then nothing "happens"..  i wait much longer than the 3 minutes mentioned in the code.  
and no "Done with file download"  ever shows..

after a reset.. its still just the original Charset.

have i missed a step ?  

EDIT:  
Solved
no idea why it didn't work with hyperterm!..
but after re-re-reading this thread and disregarding all the
references to hyperterm.  i tried using teraterm as suggested elsewhere.   and had instant success!!..  

as mentioned above. im using the 28pin SSOP adapter from dipmicro.com
comes with little prototyping areas. i easily fitted all the supporting
components on there. except what is needed for video in & out
pretty neat package..



Thanks for the Great work everyone.

/Kyndal
« Last Edit: December 14, 2010, 11:14:02 am by kyndal » Logged

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

i also had a minor issue with the library posted by kg4wsv in Reply #97  example sketch:

when compiling using Ardiuno enviroment 0018
i was getting

In function 'void loop()':
error: 'class MAX7456' has no member named 'noblink

and same for noinvert


in MAX7456.h they are named with "capitals"
     osd.noBlink();
     osd.noInvert();

so i changed that in the example pde and all is good.

/Kyndal
Logged

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

Quote
i also had a minor issue with the library posted by kg4wsv in Reply #97  example sketch:
Thanks.  The library is newer than the example.

I should fix that, and roll a real example or two into the library itself, like other Arduino libraries.

-j
Logged

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

verywll explaind ,though I have a little difficulty in totally understanding,practice my English anyway.
kevin
Logged

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

So a quick question...

the project:  i am reading the date/time of a DS1307+ RTC via I2C
and feeding that to the MAX7456 so i have a timestamp on recorded video.

the problem is that i have 1 analog camera feeding two devices
a LCD and the  the MAX7456    (that feeds the recorder )
but when i attach two "loads" to the camera.
it cant keep up (impedance etc.)
 
what is the simplest way to make a video buffer / splitter
amplifier? so i can feed two "loads" from this one video source?

im not that good with analog circuitry
but im thinking a  matched impedance transistor circuit
or even high speed video opamps ?

have googled around. and tried a couple of "buffer designs"
but haven't found any that  isnt either overkill
or when tried.  just don't work....

anybody have a nice simple circuit that works?

Thanks

/Kyndal

« Last Edit: December 15, 2010, 01:01:56 pm by kyndal » Logged

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

Kyndal,

You can just buy a composite video splitter on ebay they are really cheap.

If you really need to build one, it's just a simple opamp voltage follower. As long as the opamp can handle the current and frequency it'll be fine.

Logged

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

i have used the folowing changes (addons) to get the library working with pal
taken from the max7456_code.c source


in MAX7456.h  add or substutute with the folowing
Code:
//#define MAX7456_RESET 0x02                  //NTSC
#define MAX7456_RESET 0x42                  //PAL

//#define OSD_ENABLE 0x08                     //NTSC
#define OSD_ENABLE 0x48                      //PAL

// with NTSC
//#define ENABLE_display 0x08
//#define ENABLE_display_vert 0x0c
//#define MAX7456_reset 0x02
//#define DISABLE_display 0x00

// with PAL
#define ENABLE_display 0x48
#define ENABLE_display_vert 0x4c
#define MAX7456_reset 0x42
#define DISABLE_display 0x40

// with NTSC
//#define MAX_screen_size 390
//#define MAX_screen_rows 13


// with PAL
#define MAX_screen_size 480
#define MAX_screen_rows 16




Question
is it CRITICAL to use the arduino pins in the order
specified in the library?

board layout wise it would make it much easier for me to change
them around a bit or use other I/O's all together
i have tried  but with no luck so far ?



/Kyndal
« Last Edit: December 18, 2010, 10:15:28 pm by kyndal » Logged

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

You can not change the order of the SPI pins.
Logged

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

To expand a bit on zitron's answer, the MAX7456 library uses hardware SPI, which is fixed on the particular lines indicated.

You could rewrite the library (or maybe only parts of it) so you can bit-bang SPI, in which case you could use any pins you want.

-j
Logged

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

thanks for the reply guys..
i figured it might be something like that.
but for this rather simple. and now mostly finished project.
im going with what works  smiley-wink

i have made a basic demo sketch that reads the time off a DS1307+ RTC and displays it on a LCD
using the custom ASCII charset by dfraser  
and the MAX7456 Library by kg4wsv.  

https://sites.google.com/site/kyndaldk/MAX7456_DS1307_demo.zip

have included a PAL modified MAX7456.h in the zip

Kyndal
« Last Edit: December 28, 2010, 07:22:47 pm by kyndal » Logged

Pages: 1 ... 10 11 [12] 13   Go Up
Jump to: