HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jul 19, 2011, 08:12 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.





Edit; A quick test with GPS also seems to work fine
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 09:00 PM.
Reply With Quote
Sign up now
to remove ads between posts
Old Jul 19, 2011, 08:16 PM
Registered User
CheckSum's Avatar
Joined Jan 2011
512 Posts
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
CheckSum is offline Find More Posts by CheckSum
Reply With Quote
Old Jul 19, 2011, 08:42 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by CheckSum View Post
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
The MAX7456 OSD chip should be a good and easy way to show text.
I actually got a few samples laying around - but decided to make it all on a single microcontroller anyway. You should be able to find quite a few projects with the MAX7456.

I decided to use a single micro-controller to keep the hardware as simple and cheap as possible. I found it tempting to make an OSD with more or loss "normal" components and no need for extra chips etc.
I have been looking at the breakout board, but find the size and price a bit too high. But it's probably a good place to start. You should be able to show some text pretty quick - and I feel pretty sure that it does the job better than me. Just be aware, that the chip is only available in SMD, and the signal has to go through the chip. A loose connection is a bad idea
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 19, 2011 at 08:52 PM.
Reply With Quote
Old Jul 20, 2011, 04:03 AM
Electronics slayer
SouthPawPaul's Avatar
Reading, UK
Joined Jul 2008
494 Posts
Quote:
Originally Posted by Dennis Frie View Post
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.

Edit; A quick test with GPS also seems to work fine
That is a thing of beauty Dennis. I love to see Arduino projects for RC. Keep up the excellent work (and share the plans ).
SouthPawPaul is offline Find More Posts by SouthPawPaul
Reply With Quote
Old Jul 20, 2011, 04:35 AM
Registered User
Joined Mar 2009
1,154 Posts
Extremely impressive project ! Does it have some spare ADC ?
flipflap is offline Find More Posts by flipflap
Reply With Quote
Old Jul 20, 2011, 06:47 AM
Registered User
Joined Apr 2008
299 Posts
Quote:
Originally Posted by Dennis Frie View Post
And just a quick update. Here is a picture of the "finish prototype" (just missing cable to current sensor).

Tested a few minutes ago, and it seems to work perfect.





Edit; A quick test with GPS also seems to work fine
That's awesome ! good work. I built a multiwii setup (that is currently on sale on ebay http://cgi.ebay.co.uk/ws/eBayISAPI.d...#ht_500wt_1156), and am a big fan of the arduino mini pro.
thecrawfords67 is offline Find More Posts by thecrawfords67
Reply With Quote
Old Jul 20, 2011, 07:09 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by flipflap View Post
Extremely impressive project ! Does it have some spare ADC ?
It got plenty of spare ADC's
The main problem is timing and processor power. But it shouldn't be any problem to attach a pressure sensor etc.
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Old Jul 20, 2011, 07:58 AM
Registered User
Joined Sep 2010
2,425 Posts
Will you really share the code and schematics with us ? I want a definite answer! hehe and when will that happen?
msev is offline Find More Posts by msev
Reply With Quote
Old Jul 20, 2011, 08:14 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by msev View Post
Will you really share the code and schematics with us ? I want a definite answer! hehe and when will that happen?
Yep - for sure
I have no intention to sell it etc. so no reason to keep it for myself.

The code is already uploaded - only minor changes has been made (Line of sight, set homeposition and heading home).

I will upload the schematic as soon as I have made a nice drawing on the pc
But it's a good idea to play a bit with the circuit yourself, it's not perfect
So far it's a simple AC-coupling with 0.1 uF (standard value capacitor for AC-coupling video), climping circuit (100k resistor and 1N4148 diode) and a biasing-voltage from a reference voltage made with a 1N4148 diode. I find the 100k resistor value a bit too high, but lower resistor values doesn't seems to raise the video-signal enoguh. A diode with a bit higher voltage-drop would probably be better.

The princip is the same as this one;
http://www.viennawireless.org/balloo...rlay/index.php

Voltage dividing is made with a pot. So en general, with a biased video-signal above ground you should be able to set the reference-voltage with the pot and get a stable sync.
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 20, 2011 at 08:19 AM.
Reply With Quote
Old Jul 20, 2011, 08:53 AM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Here you go...

You might want to take a look at;
  • R2 - Resistor value a bit high
  • Capacitor removed in climping circuit - so far it seems to work fine without
  • R1 controls brightness

It has been drawn to match the layout of the Arduino Pro mini board (That's the reason why ground is at the top). AIN0 (pin7) has to be connected right next to AIN1 - pin 6 on the arduino board.


Arduino pro mini + 8 components do the trick for now
Dennis Frie is online now Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 20, 2011 at 09:58 AM.
Reply With Quote
Old Jul 20, 2011, 10:25 AM
Registered User
Joined Sep 2001
6,190 Posts
Quote:
Originally Posted by CheckSum View Post
Denis,
I am a big Arduino fan with multicopters and was wondering if you have any thoughts on this Maxim BOB OSD?
-Thanks
Breakout Board for MAX7456 On Screen Display

Here is some sample code:
Code:
/*
    MAX7456 test code
	Pete Dokter, 6/17/09
	
	This test code blinks the word "SAMPLE" just under
	where you'd expect someone's face to be.
	
*/

#include <avr/io.h>
#include <avr/interrupt.h>


#define RESET 0	//PB0
#define CS 2	//PB2
#define MOSI 3	//PB3
#define MISO 4	//PB4
#define SCK 5	//PB5


//Define functions
//======================
void ioinit(void);      //Initializes IO
void delay_ms(uint16_t x); //General purpose delay
void delay_us(int x);
void SPI_write(char address, char byte);
char SPI_read(char address);

//======================




int main (void)
{
	char x;

    ioinit(); //Setup IO pins and defaults
	
	delay_ms(1000);
	
	//reset
	PORTB &= ~(1<<RESET);
	delay_ms(1000);
	PORTB |= (1<<RESET);
	delay_ms(1000);
	
	SPI_write(0,0x08);	//enable display of OSD image
	delay_ms(1);
	
	//automatic black level control, have to read, augment and rewrite
	//The data sheet is rather specific about this
	x = SPI_read(0xEC);	
	delay_ms(1);
	x &= 0xEF;
	SPI_write(0x6C,x);
	delay_ms(1);
	
	SPI_write(0x04,0);//DMM set to 0
	
	x = 25;
	
	SPI_write(0x05,0x01);//DMAH
	
	SPI_write(0x06,x);//DMAL
	SPI_write(0x07,0x1D);
	
	SPI_write(0x06,x+1);//DMAL
	SPI_write(0x07,0x0B);
	
	SPI_write(0x06,x+2);//DMAL
	SPI_write(0x07,0x17);
	
	SPI_write(0x06,x+3);//DMAL
	SPI_write(0x07,0x1A);
	
	SPI_write(0x06,x+4);//DMAL
	SPI_write(0x07,0x16);
	
	SPI_write(0x06,x+6);//DMAL
	SPI_write(0x07,0x0F);
	
	
	while(1)
	{
		SPI_write(0,0x08);	//enable display of OSD image
		delay_ms(1000);
		SPI_write(0,0);	//disable display of OSD image
		delay_ms(1000);
	}
	
	
}

void ioinit (void)
{
	PORTB = 0xFF;
	DDRB = ((1<<CS) | (1<<MOSI) | (1<<SCK) | (1<<RESET));

    TCCR2B = (1<<CS21); //Set Prescaler to 8. CS21=1

}

//General short delays
void delay_us(int x)
{
	int y, z, a;
	
	y = x/256;
	z = x - y * 256;
	
	for (a = 0; a < y; a++)
	{
		TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
		
		TCNT2 = 0; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click
	
		while(!(TIFR2 & 0x01));
		
	}
	
	TIFR2 |= 0x01;//Clear any interrupt flags on Timer2
	
	TCNT2 = 256-z; //256 - 125 = 131 : Preload timer 2 for x clicks. Should be 1us per click

	while(!(TIFR2 & 0x01));
	
}

//General short delays
void delay_ms(uint16_t x)
{
	for (; x > 0 ; x--)
    {
        delay_us(250);
        delay_us(250);
        delay_us(250);
        delay_us(250);
    }
	
}

void SPI_write(char address, char byte)
{
	unsigned char SPICount;                                       // Counter used to clock out the data

	unsigned char SPIData;                                        // Define a data structure for the SPI data
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
														
																// Repeat for the Data byte
	SPIData = byte;                                            // Preload the data to be sent with Data
	
	for (SPICount = 0; SPICount < 8; SPICount++)
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK); 
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1; 
	}           
	
	PORTB |= (1<<CS);
	PORTB &= ~(1<<MOSI);

}


char SPI_read(char address)
{
	unsigned char SPICount;                                       // Counter used to clock out the data
  
	char SPIData; 
	char temp;
	
	PORTB |= (1<<CS);                                        		// Make sure we start with active-low CS high
	PORTB &= ~(1<<SCK);                                       		// and CK low
	
	SPIData = address;                                            // Preload the data to be sent with Address
	PORTB &= ~(1<<CS);                                           // Set active-low CS low to start the SPI cycle 

	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock out the Address byte
	{
		if (SPIData & 0x80) PORTB |= (1<<MOSI);           				// Check for a 1 and set the MOSI line appropriately

		else PORTB &= ~(1<<MOSI);
		
		PORTB |= (1<<SCK);                                         // Toggle the clock line
		PORTB &= ~(1<<SCK);
		
		SPIData <<= 1;                                              // Rotate to get the next bit
	}                                                             // and loop back to send the next bit
	

	PORTB &= ~(1<<MOSI);                                         // Reset the MOSI data line
	
	SPIData = 0;
	
	for (SPICount = 0; SPICount < 8; SPICount++)                  // Prepare to clock in the data to be read
	{
		SPIData <<=1;                                               // Rotate the data
		PORTB |= (1<<SCK);                                         // Raise the clock to clock the data out of the MAX7456
		
		temp = PINB;
		if (temp & (1<<MISO)) SPIData |= 1;                       // Read the data bit
		
		PORTB &= ~(1<<SCK);                                       // Drop the clock ready for the next bit
	}                                                             // and loop back
	PORTB |= (1<<CS);                                                 // Raise CS
					  
	return SPIData;                              // Finally return the read data


}
I was wondering if you wanted to start a new thread to explore using this board with the Arduino based Flight Controllers for IMU and other sensor based data overlay?
cactus is offline Find More Posts by cactus
Reply With Quote
Old Jul 20, 2011, 04:28 PM
SX_
.........lost..........
Zambia, Lusaka, Lusaka
Joined Jun 2005
325 Posts
Very cool project!!
Will have to have a go!!

Thanks for sharing!!

Willie
SX_ is offline Find More Posts by SX_
Reply With Quote
Old Jul 20, 2011, 04:49 PM
Pimpsac
Joined Jul 2011
14 Posts
Nice dude will be following this. Can't wait till you get some video up of it in action
Pimpsac is offline Find More Posts by Pimpsac
Reply With Quote
Old Jul 20, 2011, 05:08 PM
FPV from Lithuania
vipix's Avatar
Lithuania
Joined Mar 2007
128 Posts
What GPS module in use there?
vipix is offline Find More Posts by vipix
Reply With Quote
Old Jul 20, 2011, 05:50 PM
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,081 Posts
Quote:
Originally Posted by Pimpsac View Post
Nice dude will be following this. Can't wait till you get some video up of it in action
Hopefully I should be ready to do a test-flight within a couple of days (Just about to put the hardware in a plane). Unfortunately I don't have a recorder - but I might be able to fix something sooner or later.

Quote:
Originally Posted by vipix View Post
What GPS module in use there?
You should be able to use more or less any GPS-module. At the moment I use a MTK GPS which seem to perform very well and support 10 hz update-rate. It also offers a very good sensitivity, I'm able to get GPS-lock from inside my house.
http://flytron.com/osd-headtrackers/...ps-module.html
Dennis Frie is online now Find More Posts by Dennis Frie
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Diy osd karl k FPV Talk 2 May 03, 2011 01:31 AM
Idea New DIY OSD? atari7202 FPV Talk 1 Mar 25, 2011 01:08 AM
Discussion see my own diy OSD video Passion Aerial Photography 7 May 27, 2010 02:28 AM
Discussion REAL homebrew DIY OSD - Check it out! jafoca FPV Talk 8 Jun 29, 2009 07:52 PM
Discussion picoOSD DIY PIC12F683 based OSD in C kbosak FPV Talk 6 Jan 31, 2008 08:47 AM