Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

SMPTE IC to OLED Display

I'm in the process of that IC SMPTE that is already in an instrument. I would like to convert the signals from it to LCD/OLED display. I'm considering an RPI2 microcontroller. But I don't know how to decode the SMPT IC to generate video/audio signals to the path. What I have seen from the schematic is just the video signals ONLY decoded into the current LCD display which I want to use an alternative one. The original LCD is 248x60 How to approach that please? Any suggestions?

1710074495617.png


1710074507420.png
 
Think a video frame is a unit of activity with multiple commands and data
in it. So there are two approaches, capture data in the run and interpret,
which yields minimal latency to getting the specific info you need, or
capture entire frame, then process.

Lets take the latter.

So once you have a frame you start scanning for a command, and when detected
you gather its data (if thats what you want) gobbling bytes until you reach either
that commands end or reach another new command. Then operate on that data,
or put that task in a que to be executed when you finish processing the frame.

Thats a state machine essentially, operations that occur because of input and fdbk.
Commands can have variable data length, so state machine has to accommodate
that possibility. Fdbk is, for example, while getting data you reach either command data
end or a new command, and instruct current data gathering routine to stop and move
on to command detection mode.

I have not read datasheet lately, if commands are not intermixed with video display
data the process is still same but you do not need to capture an entire video frame of
data, just the command stream.

Regards, Dana.
 
Last edited:
danadak
Thanks so much,
one last question,
1. How do I detect a video frame, is it when CS1,CS2,RD/WR is all low?
2. I don't know the commands forehand ? I should note them on a paper ?

This is my approach with comments

C:
void processCommandStream(uint8_t* data, size_t dataSize) {
    State currentState = STATE_IDLE;
    uint8_t currentCommand = 0;
    uint8_t* currentData = NULL;
    size_t currentDataSize = 0;

    for (size_t i = 0; i < dataSize; ++i) {
        switch (currentState) {
            case STATE_IDLE:
                // Look for the start of a command
                if (data[i] == COMMAND_A || data[i] == COMMAND_B) {
                    currentCommand = data[i];
                    currentState = STATE_COMMAND_DETECTION;
                }
                break;

            case STATE_COMMAND_DETECTION:
                // Detect the command and transition to data gathering mode
                currentData = &data[i];
                currentDataSize = 0;
                currentState = STATE_DATA_GATHERING;
                break;

            case STATE_DATA_GATHERING:
                // Continue gathering data until the end of the frame or a new command is detected
                currentDataSize++;
                if (i + 1 == dataSize || data[i + 1] == COMMAND_A || data[i + 1] == COMMAND_B) {
                    // Process the command with the gathered data
                    processCommand(currentCommand, currentData, currentDataSize);
                    currentState = STATE_IDLE;
                }
                break;
        }
    }
}
 
I'd forget the state machine and just interpret each new value on the fly.

You probably need just two index counters, for display data write address and command sequences.

The commonest command after initialisation is likely to be to set the display write address - eg. to the start of the RAM to update the whole screen, or some point within it to to update an area within the display.

The address line (D/C) tells you if its command data or visual data.

For display data, write at the current data address and increment the index pointer.

For commands, start at 0 in its own buffer and store data until the correct number of bytes had been received, then interpret the received command sequence, update the display address or whatever the command was, and reset the command index for the next command.
 
danadak
Thanks so much,
one last question,
1. How do I detect a video frame, is it when CS1,CS2,RD/WR is all low?
2. I don't know the commands forehand ? I should note them on a paper ?

This is my approach with comments

C:
void processCommandStream(uint8_t* data, size_t dataSize) {
    State currentState = STATE_IDLE;
    uint8_t currentCommand = 0;
    uint8_t* currentData = NULL;
    size_t currentDataSize = 0;

    for (size_t i = 0; i < dataSize; ++i) {
        switch (currentState) {
            case STATE_IDLE:
                // Look for the start of a command
                if (data[i] == COMMAND_A || data[i] == COMMAND_B) {
                    currentCommand = data[i];
                    currentState = STATE_COMMAND_DETECTION;
                }
                break;

            case STATE_COMMAND_DETECTION:
                // Detect the command and transition to data gathering mode
                currentData = &data[i];
                currentDataSize = 0;
                currentState = STATE_DATA_GATHERING;
                break;

            case STATE_DATA_GATHERING:
                // Continue gathering data until the end of the frame or a new command is detected
                currentDataSize++;
                if (i + 1 == dataSize || data[i + 1] == COMMAND_A || data[i + 1] == COMMAND_B) {
                    // Process the command with the gathered data
                    processCommand(currentCommand, currentData, currentDataSize);
                    currentState = STATE_IDLE;
                }
                break;
        }
    }
}
Small LCD displays address pixels at a time or whole screens. Depending on how it is programmed and the strategy of individual libraries used by the programmer. In general, each pixel can be updated in any order (although can be updated rows at a time up to whole frames) without a specific "video frame".
 

Latest threads

New Articles From Microcontroller Tips

Back
Top