Author Topic: Please recommend a VGA to parallel LCD board or IC  (Read 23798 times)

0 Members and 9 Guests are viewing this topic.

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #150 on: November 25, 2024, 11:33:39 am »
..... if VGA input signal exists then the firmware denies any ISP mode entering, ......
If you read the datasheet, or knew how to read, you would be curious about the fact that the processor must poll the scaler busy flag before accessing the scaler. Extrapolating this to access via isp, you should have asked yourself, how is this organized in the case of isp? And wouldn't it be better to choose a library for experiments that reliably supports SMBUS and DDC?

What I still do not fully understand, when we are in ISP mode then we change some registers (i.e. scalers, resolution) .....
The scaler will apply these changes immediately, as you have already seen, it continues to work in isp mode.
Well even though you keep thinking I did not (never) read the datasheet, I've been reading for a few days but my problem is that I do not understand all.

I did find the schematics you posted earlier, I did read the pages after this schematics page 277 with different registers possibilities but I'm still partially lost.

What I've done earlier this morning: once entering in ISP mode, as a live test I've changed register 0xFF22 (VSYNC_sel) from 0X00H to 0x01H value. Then I've verified indeed that once I leave ISP mode via arduino control, reconnect VGA signal for a while.  So again I disconnect VGA signal input so I can enter again in ISP mode via the arduino, indeed the 0xFF22H register kept my changed value.

What I still do not understand when looking registers description from pages 277 until end of datasheet, how to change image scalers, resolution register when in ISP mode to attempt real time change the format of the image shown in my LCD.

I'm doing progress step by step with the ardunio DUE used as kind of ISP controller the RTD2660, it is just that I'm not understanding all the datasheet so learning or making mistakes.

N.B. It seems that register 0xFFF3 might play a role but I'm not sure to understand all  :-\
« Last Edit: November 25, 2024, 11:36:39 am by Tantratron »
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #151 on: November 25, 2024, 12:32:47 pm »
......... N.B. It seems that register 0xFFF3 might play a role but I'm not sure to understand all  :-\
Yes, it should be. But first of all, if you really want to get normal results, you need to make a normal PC<->I2C interface. The one you are using (on the WIRE library) is no good. You need a high-speed 400 kHz interface with the ability to increase the speed to 2 MHz, while supporting clock stretching up to 100 ms. After that, you need to write a program for the computer to make it convenient to enter data. Most likely, with a normal interface you will be able to connect right at the moment when there is an image on the screen. But you can try all 3 channels for this right now. For ISP, it makes no difference which channel you connect through.
You can also use a project using SPI connection if you need speed for text loading.
Finally, you can use the built-in UART by writing a small firmware interpreter for 8051, and transfer registers through it using usb-uart.
8051 simply controls registers, all chip blocks that have these registers work autonomously.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #152 on: November 25, 2024, 12:46:12 pm »
But first of all, if you really want to get normal results, you need to make a normal PC<->I2C interface. The one you are using (on the WIRE library) is no good. You need a high-speed 400 kHz interface with the ability to increase the speed to 2 MHz, while supporting clock stretching up to 100 ms.
With arduino WIRE library, we can choose the speed. Basic choice if no forcing will be 100 KHz, I've tried 400 KHz with the RTD2660 and works fine
Code: [Select]
Wire.setClock(400000); // Clock frequency in Hz of I2C bus

My problem is of another nature, absorb, understand the architecture of the RTD2660, the DW8051, the internal and external memories, the scaler, the register location plus I'll be 61 end of the month so my mind works slowly on the learning curve of new processor  :palm:

After that, you need to write a program for the computer to make it convenient to enter data. Most likely, with a normal interface you will be able to connect right at the moment when there is an image on the screen.
I already have this programmed with the Serial Monitor from the arduino IDE
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #153 on: November 25, 2024, 01:09:37 pm »
One thing which I still do not understand how to when using the i2c.

So far, most of the source code I've seen on github use this relative address command to enable ISP mode or read or write flash external memory, modify some scalers. The calling adress is always i2c_write_reg(0x6F, data) or i2c_read_reg(0x6F) to reach absolute registers0xFF6F. So there seems to be an internal mechanism to add or translate FF to whatever adress is sent over I2C bus.

My problem or what I still do not know, how to I2C read or write to another absolute address, for example to the register at 0xA0 (de-interlace described page 139) or say at 0x13 (see page 24) ?

 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #154 on: November 25, 2024, 01:27:00 pm »
... With arduino WIRE library, we can choose the speed. .....
This is not enough. We need clock stretching support, and with a long waiting time. Unfortunately, I do not have an example for Arduino, but below is the source code for a compatible device that my program works with.
.... my mind works slowly ....
I've always had this problem, but it's better than nothing.

Quote
...how to I2C read or write to another absolute address, for example to the register at 0xA0 ...
I haven't tried it, but I would start by setting bit 0 FFF3 to 1 and setting 0xFFF4 to the desired address.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #155 on: November 25, 2024, 02:27:20 pm »
Quote
...how to I2C read or write to another absolute address, for example to the register at 0xA0 ...
I haven't tried it, but I would start by setting bit 0 FFF3 to 1 and setting 0xFFF4 to the desired address.
Ok thanks so I'll try this addressing path 0xFFF3 and 0xFFF4 where it would mean through the VGA-i2c gate or tunnel, we can then indirect pointer reach deeper address in the global memory space.

On a side note, i'll now focus to read specific github project only dealing with full programming the RTD2660 because most of the github have been just an adaptation focussed to read/write the flash memory. If we just want to i2c dump or flash the SPI NOR eeprom, all commands are found the page F section.

So there are really two types of source file: flash memory manipulation softcore and the full hardcore stuff (i.e. specadmin previously suggested by you and @arhlad).
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #156 on: November 25, 2024, 03:07:41 pm »
.... i.e. specadmin .....
This project will allow you to make your own finished project using the usual tools for any MCU. However, for small experiments, I2C is more convenient, especially if you plan to transfer the result to the built-in 8051, since you can dynamically turn on and off the ISP. The SPI mode can only be selected during a cold start and you cannot switch to 8051. When my board arrives, I will try to connect to the ISP in working mode.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #157 on: November 25, 2024, 04:04:01 pm »
.... i.e. specadmin .....
This project will allow you to make your own finished project using the usual tools for any MCU. However, for small experiments, I2C is more convenient, especially if you plan to transfer the result to the built-in 8051, since you can dynamically turn on and off the ISP. The SPI mode can only be selected during a cold start and you cannot switch to 8051. When my board arrives, I will try to connect to the ISP in working mode.
This other github KerJoe suggested by @ahrlad seems interesting for the task we've been discussing (0xFFF3 0xFFF4 and 0xFFF5)

Code: [Select]
void ScalerWriteByte(uint8_t address, uint8_t data)
{
    XSFRWriteByte(SCALER_ADDRESS, address);
    XSFRWriteByte(SCALER_DATA, data);
}

uint8_t ScalerReadByte(uint8_t address)
{
    XSFRWriteByte(SCALER_ADDRESS, address);
    return XSFRReadByte(SCALER_DATA);
}
« Last Edit: November 25, 2024, 04:12:24 pm by Tantratron »
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #158 on: November 25, 2024, 05:28:48 pm »
...... (0xFFF3 0xFFF4 and 0xFFF5) .....
Yes, I see. Bit 0 remains 0. So it works. I also assume that you can connect to ISP in any mode, I will check.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #159 on: November 25, 2024, 05:36:33 pm »
Now I've found an interesting datasheet, same period of RTD2660, simpler processor called RTD2120 but the datasheet provides much more explanation on the architecture, the memory space, the way of work. At least easier for me to follow even though the addresses and names are different, it describes much more the concept, see attached document
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #160 on: November 25, 2024, 06:05:57 pm »
.... simpler processor called RTD2120 ....
Yes, I made support for 2120 in 2010, for many years my program was the only one that could read its flash (until I gave the code to everyone interested).
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #161 on: November 25, 2024, 11:59:48 pm »
.... explanation on the architecture, the memory space, the way of work. ....
If you want to learn 8051, I highly recommend using FX2LP or CY7C68013A for this purpose, I just have an I2C implementation for it (for a regular, cheapest board). For Keil.
https://www.eevblog.com/forum/microcontrollers/possible-click-bait-title-the-raspberry-pi-pico-2-now-has-extra-risc-v-cores/?action=dlattach;attach=2336929
Board:
https://aliexpress.com/item/1907907422.html
« Last Edit: November 26, 2024, 12:20:47 am by Postal2 »
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #162 on: November 26, 2024, 10:45:41 am »
Another question: suppose that i'm able to change other scalers (i.e. deinterlace, resolution,...) via the VGA-i2c real time embedded run, does the update parameters would be saved in the external flash eeprom so if copying the real time running firmware from the external flash via VGA-i2c then it would not require to use Keil or SDDC compiler to keep the new configuration ?
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #163 on: November 26, 2024, 02:12:51 pm »
No, of course, the register configuration is not saved. They can be added to the firmware or a firmware can be made that will take the registers from the eeprom, it does not matter, especially since this is the second step, which is far away. The most important thing is to find the correct register values, even a monkey can add registers to the firmware. Therefore, first of all, you need a normal tool for searching for register values.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #164 on: November 27, 2024, 11:07:56 am »
Here is an update on different topics.

First i've received a new Adafruit FT232H multi-protocol board so my plan is to use Python from my macOS to redo the VGA-I2C arduino preliminary test and trial. I'm still struggling to understand exactly how to I2C read/write scalers (registers) from other memory pages. I've tried different routines but I loose time to compile-link the arduino IDE then no success. So if I can rewrite of what has been working sor far with VGA-I2C command under Python, then it could be faster to test and trial because Python is interpreted.

Second regarding my difficulties to understand the datasheet involving the ISP, I've looked at some github repo which deal on programming the RTD266x where it seems clear the these 3 registers are the key but I still do not understand excatly how to use them to access other scalers.

Code: [Select]
// Controller's address on I2C bus
#define RTD_I2CADDR          0x4A

//-----------------------------------------------------------------------------
// Scaler Interface
//-----------------------------------------------------------------------------
#define SCALER_CONTROL       0xF3  // Scaler data control
#define SCALER_ADDRESS       0xF4  // Scaler data address
#define SCALER_DATA              0xF5  // Scaler data byte

// enter ISP mode
    i2c_write_reg(0x6F, 0x80);

    Wire.beginTransmission(0x4A);
   
    Wire.write(0xF3);Wire.write(0x01);
    Wire.write(0xF4);Wire.write(0x..);
    Wire.write(0xF5);Wire.write(0x..);

    Wire.endTransmission();

// leave ISP mode

    i2c_write_reg(0x6F, 0x00);

As a reminder, all I2C commands sent when ISP is enabled through VGA-i2c will go through 0x4A controller adress then, the absolute 0xFFab is relative called 0xab, the RTD266x adds up or appends the FF.

I do understand that writing to 0xF3 will set the scalar access preference (i.e. 0x01 would allow external page address, 0x20 woudl turn off the auto-incrementation of address) but I really do not understand the proper use of both 0xFF4 and 0xFF5. Where do I write the register or the scaler to be read or written in this sequence (FF3 FF4 FF5) when I want to manipulate scalers outside of page F.

Third I will later in the week start a specific thread to see if it is possible to fix the over-heating PCB800099-V9 which I discussed about few days ago in this thread to not create pollution the core topic here. Not only it overhates but refuses the VGA-I2C communication, does not always keep the display parameters, does not react correctly to the push-button menu.

Albert


« Last Edit: November 27, 2024, 11:17:54 am by Tantratron »
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #165 on: November 27, 2024, 11:46:31 am »
..... First i've received a new Adafruit FT232H multi-protocol board ......
I just wrote about clock stretching, and you immediately choose a board that does not support it. How should I characterize this?
Now you will start working with this and then with pathos you will announce that nothing is working.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #166 on: November 27, 2024, 12:10:37 pm »
I just wrote about clock stretching, and you immediately choose a board that does not support it. How should I characterize this?
Now you will start working with this and then with pathos you will announce that nothing is working.
Frankly the problem is not i2c clock stretching, I really don't know where you get this new theory since it is for the moment only a case to read/write a single scaler. Actually I've been able to read other registers with the arduino, my only problem is just understanding exactly the register R/W sequence from the datasheet to point in the right memory space.

On a side note, I quote one private mail you sent me RTD2660 is a very good chip, it is the only one that supports 85Hz from VGA input in my usage scenario. But I did not make any firmware for it, I use what is there, and it suits me.

So maybe you started to be an expert or a guru on RTDs since 2010 or 2014, everybody stole your source file, you complain and whatever. But it seems clear to me that you do not fully understand the RTD2660 datasheet otherwise simple questions lead to simple answers. Next you will say the color of the IC2 chip is wrong, we need blue but the semiconductor company made black to explain why the code does not work.

Bye for now and have good end of the day
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #167 on: November 27, 2024, 01:46:37 pm »
..... I really don't know where you get this new theory .....
It is clearly written in the datasheet:
Quote
The DDC of RTD2662 is compliant with VESA DDC standard.

.... that you do not fully understand the RTD2660 datasheet ....
I needed to read and write flash. I probably shouldn't have written my own programs, if we follow your opinion, but should left this matter to other, smarter people.
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #168 on: November 27, 2024, 05:26:48 pm »
.... through this part of my code extracted from this github project
This code was written by a schoolboy and cannot be used for RTD2660 with current requirements. The WIRE library is used, which is not compatible with DDC, because it does not work well with clock stretching.
The arduino DUE and other arduino's do fine with I2C clock stretching as long as the arduino is declared Master which is precisely the case in my source code. See these 2 posts from arduino forum post #4 and post #6

Anyway you keep insisting with many posts after this one about your clock stretching theory to explain why I fail to arduino VGA-I2C reading or writing to another part of the scaler plane. Then you'll probably come later with another theory stating there needs to be 200 MHz I2C bus with clock stretching to interface with a 2007 designed RTD2660 asic chip... LOL  :-DD

Question for other members except Postal Semiconductor, Inc. who are viewing this thread if they could help: I do not fully understand page 353 from the RTD2660 datasheet, how to properly write I2C commands sequence (register 0xFFF3 0XFFF4 0xFFF5) to read/write distant scalers, distant registers, for example the one on page 23 and 24 (deinterlace) or page 139 (again about enabling deinterlace). When in I2C mode or ISP mode, I can read, write any registers which start with absolute address 0xFFab having in mind the I2C command will only use ab then the RTD2660 controller makes transparent the FF mapping. My problem is how to write/read registers or scalers found outside of the 0xFF00-0xFFFF zoning. I must miss something unless it would be impossible to do so via I2C protocol then best to give up.

Thank you

 
« Last Edit: November 27, 2024, 05:31:54 pm by Tantratron »
 

Offline Postal2

  • Frequent Contributor
  • **
  • !
  • Posts: 791
  • Country: ru
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #169 on: November 28, 2024, 01:01:58 am »
.... See these 2 posts from arduino forum post #4 and post #6
This happens because people write stupid things and there is no one to stop their verbal diarrhea. And then others will spread the stupidity all over the Internet.
https://www.eevblog.com/forum/projects/spi-help/msg5711421/#msg5711421
« Last Edit: November 28, 2024, 02:27:34 am by Postal2 »
 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #170 on: November 28, 2024, 05:20:39 am »
Besides the very interesting github SW project by Kerjoe suggested by @ahrlad, I've just found another very interesting github HW project by KerJoe in Russia with schematics of RTD266X board. I'm attaching his schematics and simulated view of his board, very useful plus he published the CAD files with KiCad.

I notice KerJoe does make a use of these specific registers 0xFFF3 0xFFF4 0xFFF5 (page E) which I asked guidance before but I'm still stuck in my learning curve, see after an extract from his code. When he does write into these specific registers via I2C, it will be of course by removing the absolute page 0xFF so for example i2c_write_reg(0xF3, val3) or i2c_write_reg(0xF4, val4) or i2c_write_reg(0xF5, val5). Again my question, how to indirectly VGA-i2C write or read distant register or scaler say in absolute address page 6 at 0x00A0 (deinterlace enable).

Code: [Select]

alien/mcu_.h
 
#define MCU_CTRL_FFED 0xED
#define MCU_CLOCK_CTRL_FFEE 0xEE
#define MCU_SCA_INF_CTRL_FFF3 0xF3
#define MCU_SCA_INF_ADDR_FFF4 0xF4
#define MCU_SCA_INF_DATA_FFF5 0xF5
Show 1 more match


alien/rtdaccess_.c
 
void CScalerSendAddr(BYTE ucAddr, bit bAutoInc)
{
    if(bAutoInc)
        XSFRWriteByte(MCU_SCA_INF_CTRL_FFF3, 0x20);
    else
        XSFRWriteByte(MCU_SCA_INF_CTRL_FFF3, 0x00);
Show 3 more matches


alien/mcu_.c
 
void CMCUSetFlashClk(void)
{
   //   M2PLL Enable
    XSFRWriteByte(MCU_SCA_INF_CTRL_FFF3, 0x20); //BWR data enable, Non_INC;
    XSFRWriteByte(MCU_SCA_INF_ADDR_FFF4, 0x9f); //DDC_addr;
    XSFRWriteByte(MCU_SCA_INF_DATA_FFF5, 0x01); //DDC_data, page-1;
    XSFRWriteByte(MCU_SCA_INF_ADDR_FFF4, 0xE4); //M2-PLL Reg Ctrl Address;

 

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #171 on: November 28, 2024, 07:06:58 am »
Just found now this other repository where this source file mentions Realtek 2005 with the 0xFFF3 topic so the origin, these files being forked from this other russian github then more here

Extract code as a reference
Code: [Select]
/*=============================================
  * Copyright (c)      Realtek Semiconductor Corporation, 2005
  * All rights reserved.
  * ============================================ */

#define __RTDACCESS__

#include "Core\Header\Include.h"

//----------------------------------------------------------------------------------------------------
// Scaler communication basic function
//----------------------------------------------------------------------------------------------------
void CScalerSendAddr(BYTE ucAddr, bit bAutoInc)
{
    if(bAutoInc)
        *(&MCU_SCA_INF_CTRL_FFF3) = 0x20;
    else
        *(&MCU_SCA_INF_CTRL_FFF3) = 0x00;

    *(&MCU_SCA_INF_ADDR_FFF4) = ucAddr;
}
//--------------------------------------------------
// Description  : Write a data array into registers of scaler
// Input Value  : ucAddr    --> Start address of register
//                ucLength  --> Numbers of data we want to write
//                pArray    --> Pointer of the writing data array
//                bAutoInc  --> Address auto increasing select
// Output Value : None
//--------------------------------------------------
void CScalerWrite(BYTE ucAddr, WORD usLength, BYTE *pArray, bit bAutoInc)
{
    CScalerSendAddr(ucAddr, bAutoInc);

    if(usLength > 0)
    {

        do
        {
            *(&MCU_SCA_INF_DATA_FFF5) = *pArray++;

        }while(--usLength);
    }


}

//--------------------------------------------------
// Description  : Read data from registers of scaler and put it into an reading data array
// Input Value  : ucAddr    --> Start address of register
//                ucLength  --> Numbers of data we want to read
//                pArray    --> Pointer of the reading data array
//                bAutoInc  --> Address auto increasing select
// Output Value : None
//--------------------------------------------------
void CScalerRead(BYTE ucAddr, BYTE ucLength, BYTE *pArray, bit bAutoInc)
{
    CScalerSendAddr(ucAddr, bAutoInc);

    if(ucLength > 0)
    {
        do
        {
            *pArray++ = *(&MCU_SCA_INF_DATA_FFF5);

        }while(--ucLength);

    }


}
« Last Edit: November 29, 2024, 04:14:40 am by Tantratron »
 

Offline KerJoe

  • Contributor
  • Posts: 21
  • Country: 00
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #172 on: November 29, 2024, 11:25:55 am »
Hello everyone.
Tantratron reached to me via email. I'd like to post my main points about communicating with RTD2662 over I2C from our conversation.

Quote
If you want to interface with the RTD2662 via I2C, you should check out this file:
https://github.com/KerJoe/ORTD2662/blob/a3c9da9faa950fbfae44b2a0182718c16993de32/core/i2c_native_iface.c#L98

All you have to do is replace Linux I2C calls with equivalent Arduino ones.

Do note that, when you implement the `XSFRWriteByte` function, the XSFR address and data bytes MUST be sent in a single transaction.

Functions that have `constructor` and `destructor` attributes are for entering and exiting the I2C mode of RTD2662, respectively. Take into account that exiting the I2C mode resets the internal MCU.

Scaler functions are defined in:
https://github.com/KerJoe/ORTD2662/blob/a3c9da9faa950fbfae44b2a0182718c16993de32/scaler/scaler_access.c#L11

Copy `ScalerWriteByte` and `ScalerReadByte` functions into your code, should be enough for basic scaler communication.

Quote
You can change the scaler's memory page using the register 0x9F (Accessed via `ScalerWriteByte`).
Here's some sample code using page switching:
https://github.com/KerJoe/ORTD2662/blob/a3c9da9faa950fbfae44b2a0182718c16993de32/scaler/scaler.c#L55

The 0x9F register (PAGE_SEL) is also documented on page 98 of the datasheet:
https://github.com/KerJoe/ORTD2662/blob/master/docs/RTD2660.pdf

Quote
> ...it seems the only way to enable ISP mode via i2c with any RTD2660 consists to set bit 7 on 0xFF6F register...
Yes, before you can use any register beside 0xFF6F, you must first set it's 7th bit to 1 (entering the programming mode). If you don't do this, any access to any other register will be ignored.

> From what you are describing below, so I need to use XSFR register as pointers...
Yes, you access the Scaler registers via address and data registers in XSFR space.

> ...write/read other pages...
As I have said only the scaler registers are paged. Think of it this way: The XSFR peripherals and the 8051 MCU are completely separate from the Scaler IP - the video processor. The only way you can access the Scaler from the MCU and I2C domain is via the scaler port in XSFR.
In other words, everything after page 276 of the datasheet is accessed through XSFR (`i2c_write_reg(address, data);`). While every register before that page is accessed via the Scaler port (`i2c_write_reg(0xF4, adress);
i2c_write_reg(0xF5, data);`).

Ignore the marking of MCU registers as pages E and D these registers are not accessed like that in I2C mode, only SPI.

Tantratron, asked whether it is possible for the 8051 MCU to continue execution after entering the programming mode. That, AFAIK, is not possible, the MCU will always reset upon exiting the programming mode.

He also asked about marking my ORTD2662 project as "unsuccesfull". That is due to me running out of steam before making an actual full fledged alternative to the leaked Realtek source code. As of now it's stuck in a Minimal Viable Product phase: you can do HDMI and VGA (which should also allow you to do RGBs/YPbPr), but you have to hardcode the resolutions and other values; you have OSD, but you can't control it, etc. All in all, it's mostly incomplete.
« Last Edit: November 29, 2024, 11:53:47 am by KerJoe »
 
The following users thanked this post: Tantratron

Offline Tantratron

  • Frequent Contributor
  • **
  • Posts: 584
  • Country: fr
  • Radio DSP Plasma
    • Tantratron
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #173 on: November 29, 2024, 12:00:55 pm »
Many thanks to @KerJoe who guided me to understand the local architecture of the RTD266x through personal mails. His explanations were very clear then I've able able to modify my arduino DUE code in order to test some scenarios.

See after the local code and the Serial monitor output from the arduino where I first enter into ISP mode via VGA-i2c, read first register in common page then read page 1 register about PLL stuff and finally write and read (verify) page 6 register dealing with de-interlace function. After 2s then I leave ISP mode but the DW8051 resets using flash memory hence does not take into account the scaler modification.

Ideally when in ISP mode and I2c protocol, it would be great to live change scalers and observe like video interpreter the visual result but it seems not possible, too bad.

Code: [Select]
  // try to speak with I2C slave
  Wire.begin();
  Wire.beginTransmission(0x4A);

  // the following call may hang indefinitely if the I2C slave is off, therefore we keep the LED on
  if (Wire.endTransmission())
  {
    // I2C slave not detected
    LED_OFF;   
    error = ERR_NO_SLAVE;
    return;
  }
  LED_OFF;
  retries = 0;
 
  while (true)
  {
    if (retries == 5)
    {
      error = ERR_ISP;
      return;   
    }
    retries++;

    i2c_write_reg(0x6F, 0x80);    // enter ISP mode
    if ((i2c_read_reg(0x6F) & 0x80) == 0) continue; // ISP mode not entered, try again
    Serial.println("ISP mode entered - DW8051 reset");Serial.println();

// turn-off address auto inc
    i2c_write_reg(0xF3,0x20);

// accessing common page 
    i2c_write_reg(0xF4,0x00); // select register 0x00 from common page
    Serial.print("Register::ID_Reg -> ");Serial.print(i2c_read_reg(0xF5),HEX);Serial.println();
   
// accessing page 1
    i2c_write_reg(0xF4,0x9F); // Select scaler register 0x9F (PAGE_SEL)
    i2c_write_reg(0xF5,0x01); // Select page 1 (PLL)
    i2c_write_reg(0xF4,0xC0); // select register 0xC0 from page 1
    Serial.print("DPLL_N (DPLL N Divider Register) -> ");Serial.print(i2c_read_reg(0xF5),HEX);Serial.println();

// accessing page 6
    i2c_write_reg(0xF4,0x9F); // Select scaler register 0x9F (PAGE_SEL)
    i2c_write_reg(0xF5,0x06); // Select page 6 (de-interlace)
    i2c_write_reg(0xF4,0xA0); // select register 0xA0 from page 6
    i2c_write_reg(0xF5,0x08); // enable de-interlace
//    i2c_write_reg(0xF5,0x00); // disable de-interlace
    Serial.print("Register:: de-interlace and bist control -> ");Serial.print(i2c_read_reg(0xF5),HEX);Serial.println();

    delay(2000);  // leave ISP mode after 2 s
    LED_ON;
    i2c_write_reg(0x6F, 0x00);
    if((i2c_read_reg(0x6F) & 0x80)) continue; // ISP mode not left, try again
    Serial.println();Serial.println("ISP mode left - DW8051 reset");Serial.println();

    break;
  }


Code: [Select]
ISP mode entered - DW8051 reset

Register::ID_Reg -> F1
DPLL_N (DPLL N Divider Register) -> 6
Register:: de-interlace and bist control -> 8

ISP mode left - DW8051 reset
« Last Edit: November 29, 2024, 12:08:59 pm by Tantratron »
 

Offline KerJoe

  • Contributor
  • Posts: 21
  • Country: 00
Re: Please recommend a VGA to parallel LCD board or IC
« Reply #174 on: November 29, 2024, 12:34:16 pm »
Ideally when in ISP mode and I2c protocol, it would be great to live change scalers and observe like video interpreter the visual result but it seems not possible, too bad.

Actually, you can freely change any Scaler and XSFR register and get real-time results on the output. As a matter of fact, my ORTD2662 project can run on a computer and set up the RTD2662 video output without any firmware, operating only through the I2C link.
The only limitation of I2C is that you can't resume the firmware execution after using it.
« Last Edit: November 29, 2024, 12:39:44 pm by KerJoe »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf