OK, I ended up having to edit the maxim font and replace lowercase a-f to the borders. Once I did that and updated things I have a nice looking border and a facsimile targeting reticle box.
The osd.print command set only allows for standard keyboard characters to be used.
The spi writereg command methodology I was not having much luck hashing out how to get the cursor to move so I can print characters to a set spot on the screen.
I have an open inquiry on the rcgroups forum to see if anyone has any experience on coding and using custom font sets for their drone fpv setups. The maxim 7456 chip has other adaptations on the drone fpv setup that do not require Arduino to function.
The chip itself is over 10 years old, but is actively used in the drone fpv industry. The analog ability to insert OSD text without high horsepower gear is extremely attractive and the analog signals carry much better than digital/binary ones as they are much more immune to interference due to the way that the encoding/decoding modulation/demodulation works with the signals and the hardware. There is a lot of math involved in the explanation breaking things down.
M codingy progress is documented on the adafruit.com forums as that site would have more exposure with folks that might re-use or re-appropriate the code base.
https://forums.adafruit.com/viewtopic.php?f=22&t=161697current code in use:
Code:
/* VideoTimeInserter.ino Demonstrates a very basic on screen time display.
This example code is in the public domain. Requires Arduino 1.0 or later.
History : 1.0 ~ Creation of MAX7456Demo from MAX7456Demo 0.4 2013.01.31 - F. Robert Honeyman <www.coldcoredesign.com>
1.1 ~ for OSD Shield We check the system of video in,and set the sytem of video out same with it.
(If the video in system is the PAL,the 1.0 verison will not work well, so we add the checking and setting functions) 2015.02.02 - HuangChao <www.tinysine.com>
*/
/* This driver uses the Adafruit unified sensor library (Adafruit_Sensor),
which provides a common 'type' for sensor data and some helper functions.
To use this driver you will also need to download the Adafruit_Sensor
library and include it in your libraries folder.
You should also assign a unique ID to this sensor for use with
the Adafruit Sensor API so that you can identify this particular
sensor in any data logs, etc. To assign a unique ID, simply
provide an appropriate value in the constructor below (12345
is used by default in this example).
Connections: Connect SCL to analog 5, SDA to analog 4, Connect VDD to 3.3-5V DC, Connect GROUND to common ground
History: 2015/MAR/03 - First release (KTOWN)*/
/* Set the delay between fresh samples */
// Included Libraries //////////////////////////////////////////////////////////
// includes for max7456
#include <SPI.h>
#include <MAX7456.h>
#include <Wire.h>
// includes for bno055
#include <Adafruit_Sensor.h>
#include <Adafruit_BNO055.h>
#include <utility/imumaths.h>
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include "RTClib.h"
#define DMDI_reg 0x07
RTC_DS3231 rtc;char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
// maxim 7456 chipset settings
const byte osdChipSelect = 10; const byte masterOutSlaveIn = MOSI; const byte masterInSlaveOut = MISO; const byte slaveClock = SCK; const byte osdReset = 0;
uint16_t BNO055_SAMPLERATE_DELAY_MS = 100; Adafruit_BNO055 bno = Adafruit_BNO055(55, 0x28);
MAX7456 OSD( osdChipSelect );
// set spi and serial settings
void setup() { unsigned char system_video_in=NULL; SPI.begin(); SPI.setClockDivider( SPI_CLOCK_DIV2 ); OSD.begin(); OSD.setSwitchingTime( 5 ); system_video_in=OSD.videoSystem(); OSD.setDefaultSystem(MAX7456_NTSC) ;OSD.display();
Serial.begin(115200); Serial.println("Orientation Sensor Test"); Serial.println(""); bno.begin(); delay(1000);
} // setup() end
void loop() {
int8_t boardTemp = bno.getTemp();
Serial.println(boardTemp); delay(BNO055_SAMPLERATE_DELAY_MS); sensors_event_t event; bno.getEvent(&event);
// this just displays time and is used for calibration purposes
// make sure to use two digit off sets for displaying OSD print of values lest things look off.
DateTime now = rtc.now();
Serial.print(now.month(), DEC); Serial.print('/'); Serial.print(now.day(), DEC); Serial.print(' '); Serial.print(now.hour(), DEC); Serial.print(':'); Serial.print(now.minute(), DEC);
// this sets the display to render the text.
while (true) {
while (OSD.notInVSync()) {
// these get the 9 axis readings and temp
bno.getTemp(); bno.getEvent(&event);
// this gets the time readings
DateTime now = rtc.now();
}
//this sets the display, note if using different character set you may have to call each character by ascii number.
OSD.setCursor( 0, 0 );
OSD.print(event.orientation.x, 3);
OSD.setCursor( 8,0);
OSD.print("N");
OSD.setCursor( 17,0);
OSD.print(boardTemp);
OSD.setCursor( 19,0);
OSD.print("C");
OSD.setCursor( 0, -1);
OSD.print( now.month() );
OSD.setCursor( 2, -1);
OSD.print( "/" );
OSD.setCursor( 3, -1);
OSD.print( now.day() );
OSD.setCursor( 5, -1);
OSD.print( " " );
OSD.setCursor( 6, -1);
OSD.print( now.hour() );
OSD.setCursor( 8, -1);
OSD.print( now.minute() );
OSD.setCursor( 11, -1);
OSD.print( "LAT" );
OSD.setCursor( 14, -1);
OSD.print( "," );
OSD.setCursor( 15, -1);
OSD.print( "LON" );
OSD.setCursor( 18, -1);
OSD.print( "," );
OSD.setCursor( 19, -1);
OSD.print( "ELE" );
OSD.setCursor( 0, 10);
OSD.print( "M/D H:M" );
OSD.setCursor( 9, 10);
OSD.print( "LA, LO, EL" );
OSD.setCursor( 0, 9);
OSD.print( "effffffffffffffffffffffffc" );//bot line
OSD.setCursor( 0, 1);
OSD.print( "bffffffffffffffffffffffffd" );//top line
OSD.setCursor( 0, 2); //left column line
OSD.print( "a" );
OSD.setCursor( 0, 3);
OSD.print( "a" );
OSD.setCursor( 0, 4);
OSD.print( "a" );
OSD.setCursor( 0, 5);
OSD.print( "a" );
OSD.setCursor( 0, 6);
OSD.print( "a" );
OSD.setCursor( 0, 7);
OSD.print( "a" );
OSD.setCursor( 0, 8);
OSD.print( "a" );
OSD.setCursor( 25, 8);// right column line
OSD.print( "a" );
OSD.setCursor( 25, 3);
OSD.print( "a" );
OSD.setCursor( 25, 4);
OSD.print( "a" );
OSD.setCursor( 25, 5);
OSD.print( "a" );
OSD.setCursor( 25, 6);
OSD.print( "a" );
OSD.setCursor( 25, 7);
OSD.print( "a" );
OSD.setCursor( 25, 2);
OSD.print( "a" );
//target box
OSD.setCursor( 12, 5);
OSD.print( "." );
OSD.setCursor( 11, 4);
OSD.print( "bfd" );
OSD.setCursor( 11, 6);
OSD.print( "efc" );
OSD.setCursor( 11, 5);
OSD.print( "a" );
OSD.setCursor( 13, 5);
OSD.print( "a" );
while (!OSD.notInVSync()) {} // Add aditional code here.
} }