Saturday, February 06, 2016

Arduino serial video/tv out "graphics card"...

* The problem:

The YR-901 that I bough some time ago is not working correctly, that is; it always in TX mode. I suspect some dust on the control circuit, the processing logic dead or some supply line issue. In any case if not able to fix, the idea is to place another RTTY decoder inside, keeping the same housing.


* The solution:

As for replacement decoder was thinking in an Arduino with video out instead of the standard LCD found in most schematics.

While it's strait forward to create video out on the Arduino I suspect that RTTY decoding and at the same time doing video processing would cause timing issues for the small processor so the solution would be to create an "offload" video card to the decoding Arduino board. The data between the two would be shared by serial port, any character arriving via serial port would be transformed in "video".

Easier to do than said :) and after some coding here it is:

...except for the first line which is hard coded every other char was sent by serial term software connected to the Arduino... The screen is one of those small rear camera for the cards, was initially to be used with the Raspberry PI for an SDR receiver but now it's for this application.

Another output with different font (4x6):


...it's not so "clean"/readable so I chose the initial 6x8 font.

The schematic for the video out...two resistors!:


The library (arduino-tvout) with some graphics possible from the examples:

... I might include it latter on the code...as a screen saver feature...
The connection schematic as on the lib example:

Library code from here:

And my own code for this application:

--------
#include
#include
// #include "schematic.h"
#include "TVOlogo.h"

TVout TV;

// serial receive
String inputString = "";         // a string to hold incoming data
boolean stringComplete = false;  // whether the string is complete
// end serial receive

// serial events
void serialEvent() {
  while (Serial.available()) {
    // get the new byte:
    char inChar = (char)Serial.read();
    // add it to the inputString:
    inputString += inChar;
    TV.print(inChar);
    if (inChar == '\n') { TV.println("\n");  stringComplete = true;  };
    if (inChar == '\r') { TV.println("\n");  stringComplete = true;  };
  }
}

void setup() {
  Serial.begin(9600);
  inputString.reserve(20);
  TV.begin(PAL,120,96);
  TV.select_font(font6x8); // 19 chars by line
//  TV.select_font(font4x6); // more space but less font resolution
  TV.clear_screen();
  TV.println("- CT2GQV RTTY/CW - \n");
  // TV.delay(4000);
} // end setup

void loop() {
 if (stringComplete) {
    inputString = "";
    stringComplete = false;
 }
} // end loop
--------

It was basically some stitch and glue between a serialevent example and the "demopal" tvout lib example.

That's it!... still need to "build" the RTTY decoder part.

Have a nice weekend!

2 comments:

jafal said...

hi

nice projcet

where to connect the input on arduino which out from the receiver on pin 2 of arduino or what ?

Ricardo - CT2GQV said...

Hello Jafal,

The "conversion" part is http://speakyssb.blogspot.ie/2016/04/stand-alone-arduino-rtty-decoder.html
This post is just the display portion, converts serial char to display, the serial char are received from the decoders, one for CW and the other for RTTY.

Regards,