Yet Another RTD2660 Quest

Quick update!

I revisited YPbPr 480p last night to try to get it working and spent a decent amount of time messing with it but wasn't getting anywhere.

I then had somewhat of a realization that I was trying to display it in a 16:9 aspect ratio then had a thought about when I was trying to code 480p VGA in last year. When I was trying to display 480p VGA in a 16:9, the screen would turn black indicating it was trying to lock onto sync, but I would never get an image. It wasn't until I switched to 4:3 that I would get an image (although it would flicker every few seconds).

Upon realizing this, I switched to 4:3 and it worked perfectly! No washed out colors or grid of dots as shown in my last post, but there were the 4:3 borders that I wanted to get rid of as that was a big reason for starting this in the first place:
97.webp


Now knowing i had a scaler issue and not a resolution issue, I turned my attention to the scaler and how it stretched the image to 16:9 as that's was where the issue was.

I tweaked and tested and wasn't getting anywhere, so I went back and implemented a slightly different, softer method of scaling to 16:9 and once again, we have a working 480p over YPbPr!!
98.webp


This time you may notice that it doesn't have slight borders on the side like 480i does. When making all of these changes, I only applied settings to Mode 3 (which was 480p) so I plan to go back and see if I can apply the same changes to Mode 1 (480i) in order to eliminate those borders and call that good!

The YPbPr checklist still stands:
- Tweak 480i to perfection
- Implement and test 240p
- Test 1080i (even though there are very few games that support it, but the option to have it is nice)

Then its on to VGA!
 
Can changes to scaling or some other setting like enabling an input be done just by sending register write commands via I2C?
I suppose the changes wouldn't be permanent that way.
 
Can changes to scaling or some other setting like enabling an input be done just by sending register write commands via I2C?
I suppose the changes wouldn't be permanent that way.

The current assumption is that the interface between the internal 8051 microcontroller & the scaler hardware is SPI, and that interface (or another separate interface) is broken out externally. I don't believe this was ever 100% confirmed to be the case, but if it is, we can skip using the 8051 microcontroller altogether (which means avoiding a less than stellar tool chain) and instead use something better suited for our purposes, such as an ESP32 or RP2040/2350, to control the scaler hardware and implement desired features. I believe this is the best possible scenario for a full open source release, but we have yet to prove that it's possible.

Yes, changes would not be permanent. The scaler chip needs to be bootstrapped/configured on every power-on, and can be reconfigured on the fly depending on current needs. The documentation is pretty sparse, so it would take a lot of work to figure out how to do this.
 
Its been a minute so here's an update.

I had been continuing making strides in getting things working with the original firmware base I had, but I've had a daunting realization that I'm working with a firmware I can't do anything with. I mean, sure I can use it for my own benefit but even if I polished it fully and got everything working, I can never release it publicly or make a product out of it that benefits the whole community, so I decided to stop working on it for the time being and shift my focus.

Some of the fellas and I have been talking about creating a new firmware for a while but none of us have pulled the trigger due to the sparse documentation on the RTD2660, as well as the method of how we want to use it (i.e using the internal 8051 MCU, or trying to control it with a more robust external MCU). There was also the question of whether to use Keil uVision or SDCC as Keil is shite, however SDCC uses different data types etc. And most of the firmware bases we can use as a reference have keil specific linker, and obj files that can't be reverse engineered easily, If at all.

With all of this being said, I recently took on the task of trying to create a sort of proof of concept new firmware using SDCC, and I was able to at least initialize the 8051 MCU and somewhat show its boot cycle using the on board LED (essentially a blinky project lol) amongst some other things. I was successful in doing this however what I eneded up doing was breaking "In System Programming" using the DDC I2C lines so once this new firmware was flashed, i could no longer flash newer firmware back to the chip using the same methods I was using before.

I thought I was cooked so I called it a day and decided to order a new board and reverse engineer my current driver board as I want to make a custom PCB anyway (although I havent peeled the board apart yet). I also managed to rip off the Write Protection pin off of my SPI flash by accident because of the THT 10k resistor I had on it so I thought it wouldn't work anyway.

In a last attempt before peeling my board apart however, I ordered a CH341A programmer to try to flash the old firmware directly back to the SPI flash, and after messing around, I was able to get it working again! After all of this though, I realized what an absolute mess my driver board looked like, and I really want to change that if I'm going to take this new firmware seriously, so I decided to make a sort of "dev board", and thats my primary focus as of now.

Here is the sad state of my current driver board for anybody wondering lol:
189.webp


The plan is to create a new driver board for development that has an arduino nano implemented directly into it for flashing as ive been using an Uno R3 externally, I plan to also add headers, and a small variety of different footprints for different SPI flashes as I'd like to switch from the Zbit ones to something like winbond, and the headers will be for having a removable flash for the CH341A in case I break ISP again lol (also the 8 pin clip that comes with the programmer doesn't like to work of the flash is in circuit), we looked into a few different panels we want to add support for such as 40pin, 50pin, and 54pin, so I'll be finding a way to implement each connector on there if possible. This also gives the chance to add newer backlight circuitry to replace the cheap Chinese components that are currently used on all the available driver boards. And I'm sure there will be more features I'm not mentioning here at the moment.

Hours have picked up at work again however, I've made a vow not to drop this project and take a year long hiatus like I did last year, so we'll eventually come out with something cool!

Thanks for reading!
 
I have an RTD2662 board (well, 2 technically with one on the way) and this will be SUPER useful for me. Will this still work for non-console/standard resolutions? Basically I've wanted to have firmware that:
  • Works with 240p/480i for PS1/Arcade boards
  • Works with 800x600p (or 640x480p)
  • Works with VGA and HDMI
  • Can be configured to use GPIO to switch between VGA/HDMI
The whole topic of the RTD2662 programming has kept me from wanting to go too deep since it was a rabbit hole I wasn't ready to dive into lol
 
I have an RTD2662 board (well, 2 technically with one on the way) and this will be SUPER useful for me. Will this still work for non-console/standard resolutions? Basically I've wanted to have firmware that:
  • Works with 240p/480i for PS1/Arcade boards
  • Works with 800x600p (or 640x480p)
  • Works with VGA and HDMI
  • Can be configured to use GPIO to switch between VGA/HDMI
The whole topic of the RTD2662 programming has kept me from wanting to go too deep since it was a rabbit hole I wasn't ready to dive into lol
That is the goal! It should be as easy as coding in whatever resolution is needed and tweaking it to work!

And to answer your questions:

- Whereas this was initially intended for the PS2, 240p and 480i are definitely going to be coded in.
- If you're talking about a specific LCD Panel, im working to have it be as versatile as possible meaning it will support a variety of panels. If you mean a resolution, as mentioned above, it shouldn't be too bad to code it in and scale it properly.
- I'm planning to have all inputs working however HDMI is more or less further down the priority list as its gonna take a fair bit to figure out.
- as for switching inputs, it plan to have it setup similarly to whats available, being buttons to navigate a OSD menu (or essentially a "source" button) to switch inputs.

I can certainly relate to being reluctant to dive down the rabbit hole lol, but im hoping to eventually come out with something soon for folks to tinker with!

With that being said, I'll have an update soon on how the projects going!
 
Yes sorry, I did mean to say resolution is the input resolution lol. If you could make the inputs/OSD/What-not to be a module that could be changed, then I could deffo make my own variant.
 
I have so many projects on the go at the moment but I have an update here lol

As far as R&D goes for the dev board, I have pretty much everything I need to make a real dent in it. I've bought the following items:

- A 54pin 3.5in 640x480 panel with the HDMI driver board:
1639.webp


- The 4:3 50pin 5in 640x480 ZJ050NA-08C driver board (will buy the panel later) with multiple inputs that Mister M has already done a lot of RE on:
1641.webp


- A new 16:9 800x480 40pin 5in driver board (same as sold on 4layer)
1643.webp


- Some arduino nanos for programming, but I still have the CH341A on hand until ISP is working again:
1644.webp


This should be enough to get started by integrating some of the more commonly used panels here with leaving room for others down the line. Unfortunately my 3.5in panel came in cracked and while it still works, I of course dont want a broken product lol, so luckily the seller has since rectified the situation.
1582.webp


I won't get too hard into specifics until I start working more on the board, but I think a new idea is to integrate Yveltal's Scampi AMP into the board as well so it can be controlled via the RTD2660, which would be nice to have that full integration.

There's a lot on my plate at the moment however im working to get some good stuff out there, so I'll update soon!

Thanks for reading!
 
Nice haul! Shame about the screen
I havent tested it with an actual input but im glad it still works at least! I won't be shy about really testing it to get the timing locked in whereas its already broken lol
 
I tried compiling the open-source code from GitHub (https://github.com/avtehnik/RTD2662) and programming it into the RTD2662, but it didn't run properly. The FLASH used is PM25LV020. I am also trying to use YPbPr signals for input display. I am not sure if this code is suitable for this Scaler
 
I tried compiling the open-source code from GitHub (https://github.com/avtehnik/RTD2662) and programming it into the RTD2662, but it didn't run properly. The FLASH used is PM25LV020. I am also trying to use YPbPr signals for input display. I am not sure if this code is suitable for this Scaler
I cant speak much on the firmware other than the firmware source I was working on (which is different from what you linked above) and the firmware im working on now, however there are a lot of variables that could cause it not to work properly with your specific setup.

The main ones being the PCB setup (typically found in PCB.h), your panel may not be supported in that firmware, or things could just be broken or incomplete. Its hard to know without more info.
 
I cant speak much on the firmware other than the firmware source I was working on (which is different from what you linked above) and the firmware im working on now, however there are a lot of variables that could cause it not to work properly with your specific setup.

The main ones being the PCB setup (typically found in PCB.h), your panel may not be supported in that firmware, or things could just be broken or incomplete. Its hard to know without more info.
Thank you for your reply. I have successfully lit up the LCD screen on the PCB800099 (RTD2660H) LCD driver. However, the YPBPR input is currently in a no-signal state. I have also tried using the VGA port for signal input. Below are some of my configuration files and PCB flying lead diagram. I am using an HDMI to YPBPR converter as the signal source (VGA signal R connected to PR, G connected to PB, B connected to Y). If possible, could you share how you configured it?
c5a6e9ff-ce60-4015-82a4-16fe8a0efe13.webp
4c76577e007eac9f7dc48542746d3ef9_720.webp
 
Thank you for your reply. I have successfully lit up the LCD screen on the PCB800099 (RTD2660H) LCD driver. However, the YPBPR input is currently in a no-signal state. I have also tried using the VGA port for signal input. Below are some of my configuration files and PCB flying lead diagram. I am using an HDMI to YPBPR converter as the signal source (VGA signal R connected to PR, G connected to PB, B connected to Y). If possible, could you share how you configured it?View attachment 42210View attachment 42211
I won't be at my computer for a while, but in the meantime, could you show me a detailed picture of the front of your PCB, specifically the connections coming from the RTD2660?
 
I won't be at my computer for a while, but in the meantime, could you show me a detailed picture of the front of your PCB, specifically the connections coming from the RTD2660?
Of course, here are the PCB flying wire diagram and the actual circuit diagram I created later. Since there was an issue with the previously designed RTD2662 PCB, I directly flew wires to the A0_PORT input port of PCB800099

eaf7138b-d501-4730-bbd7-7756b368781a.webp
09ba60b47da11bbebd7bf9b51b143a89_720.webp
eae32a5e34ecee3a0162175994bb9146_720.webp
e668ae9d0fae140424494282d7efa577_720.webp


C:
//--------------------------------------------------
// Scalder Type
//--------------------------------------------------
//_RTD3580D
#define _SCALER_TYPE                             _RTD3580D

//--------------------------------------------------
// MCU Type
//--------------------------------------------------
//_REALTEK_RTD3580D_EMCU
#define _MCU_TYPE                               _REALTEK_RTD3580D_EMCU

//--------------------------------------------------
//_KT_PCB2660_001
//--------------------------------------------------
#define _KEY_TYPE                               _KT_PCB2660_003_5KEY
            
//--------------------------------------------------
//Key scan type
//--------------------------------------------------
#define _KEY_SCAN_NORMAL                        0
#define _KEY_SCAN_AD                            1
#define _KEY_SCAN_NONE                          255

#define _KEY_SCAN_TYPE                          _KEY_SCAN_AD

//--------------------------------------------------
// Definations of RTD/MCU Crystal Frequency in KHz
//--------------------------------------------------
//_XTAL12000K,_XTAL24576K,_XTAL24000K,_XTAL40000K,_XTAL27000K,_XTAL24300K
#define _RTD_XTAL                               _XTAL27000K
#define _MCU_XTAL                               _XTAL24300K

//--------------------------------------------------
// Function Supported's define
//--------------------------------------------------
#define _VGA_SUPPORT                            _OFF
#define _HDMI_SUPPORT                            _ON
#define _TMDS_SUPPORT                           _OFF
#define _VIDEO_SUPPORT                          _ON
#define _VIDEO_AV_SUPPORT                       _OFF
#define _VIDEO_SV_SUPPORT                       _OFF
#define _VIDEO_TV_SUPPORT                       _OFF
#define _VIDEO_YUV_SUPPORT                      _OFF
#define _VIDEO_SCART_SUPPORT                    _OFF
#define _YPBPR_SUPPORT                          _ON

//--------------------------------------------------
// YPbPr New Sync Detected
//--------------------------------------------------
#define _YPBPR_NEW_SYNC_DETECT                    _ON

//--------------------------------------------------
// YPbPr Sync Source
//--------------------------------------------------
#define _SOG0                                   0
#define _SOG1                                   1

#define _YPBPR_SYNC_SOURCE                      _SOG0

//--------------------------------------------------
// Video Input Selection
//--------------------------------------------------
//_VIDEO_8_IN,_VIDEO_16_IN
#define _VIDEO_IN                               _VIDEO_8_IN

//--------------------------------------------------
// Definations of Input Port Types
//--------------------------------------------------
/*
    _NO_PORT,                                           --> No port
    _DSUB_A0_PORT,  _DSUB_A1_PORT,                      --> Dsub input port
    _DVI_PORT,      _DVI_D0_PORT,  _DVI_D1_PORT,        --> DVI input port
    _HDMI_PORT,     _HDMI_D0_PORT, _HDMI_D1_PORT,       --> HDMI input port
    _YPBPR_A0_PORT, _YPBPR_A1_PORT,                     --> YPbPr input port
*/
#define _SOURCE_VGA_PORT_TYPE                   _DSUB_A1_PORT
#define _SOURCE_DVI_PORT_TYPE                   _DVI_D1_PORT
#define _SOURCE_HDMI_PORT_TYPE                  _HDMI_D0_PORT
#define _SOURCE_YPBPR_PORT_TYPE                 _YPBPR_A0_PORT

//--------------------------------------------------
// Definations of change source order
//--------------------------------------------------
/*
_SOURCE_VGA,       _SOURCE_DVI,      _SOURCE_VIDEO_AV,    _SOURCE_VIDEO_SV,
_SOURCE_VIDEO_YUV, _SOURCE_VIDEO_TV, _SOURCE_VIDEO_SCART, _SOURCE_HDMI,
_SOURCE_YPBPR,     _SOURCE_NONE
*/
#define _SOURCE_0_TYPE                          _SOURCE_VGA
#define _SOURCE_1_TYPE                          _SOURCE_DVI
#define _SOURCE_2_TYPE                          _SOURCE_HDMI
#define _SOURCE_3_TYPE                          _SOURCE_VIDEO_AV
#define _SOURCE_4_TYPE                          _SOURCE_VIDEO_SV
#define _SOURCE_5_TYPE                          _SOURCE_VIDEO_TV
#define _SOURCE_6_TYPE                          _SOURCE_YPBPR
#define _SOURCE_7_TYPE                          _SOURCE_NONE
#define _SOURCE_8_TYPE                          _SOURCE_NONE
#define _SOURCE_9_TYPE                          _SOURCE_NONE
#define _SOURCE_10_TYPE                         _SOURCE_NONE

#define _INPUT_PORT_NUM                         7

#define _NORMAL_SOURCE                          _SOURCE_YPBPR

//--------------------------------------------------
// Definitions for GPIO Control
//--------------------------------------------------

#define _PANEL_ON                                1          // Power on    state for LCD panel
#define _PANEL_OFF                                0        // Power off state for LCD panel

#define _LIGHT_ON                                0        // Power on  state for backlight inverter
#define _LIGHT_OFF                                1        // Power off state for backlight inverter

#define _LED_ON                                    1
#define _LED_OFF                                0

//--------------------------------------------------
// Definitions of ADC Fine Tune Delay (Value == 0 ~ 7)
//--------------------------------------------------
#define _ADC_FINE_TUNE_DELAY_RED                0
#define _ADC_FINE_TUNE_DELAY_GREEN              0
#define _ADC_FINE_TUNE_DELAY_BLUE               0

//--------------------------------------------------
// Definitions of ADC Input Swap Settings (ADC0)
//--------------------------------------------------
#define _ADC0_INPUT_SWAP_RG                      _OFF
#define _ADC0_INPUT_SWAP_RB                      _OFF
#define _ADC0_INPUT_SWAP_GB                      _OFF

//--------------------------------------------------
// Definitions of ADC Input Swap Settings (ADC1)
//--------------------------------------------------
#define _ADC1_INPUT_SWAP_RG                      _OFF
#define _ADC1_INPUT_SWAP_RB                      _OFF
#define _ADC1_INPUT_SWAP_GB                      _OFF

//--------------------------------------------------
// Definitions of MAIN_TYPE
//--------------------------------------------------
#define _MAIN_TYPE_DISABLE                        0       //000: Disable All Output Pins (PWM, TCON, SDRAM, Display, etc.)
#define _MAIN_TYPE_1                            1       //001: Configure IC as MCM128 with internal 1Mx16 SDRAM0.
#define _MAIN_TYPE_2                            2       //010: Configure IC as QFP128. No SDRAM is in use.
#define _MAIN_TYPE_3                            3       //011: Configure IC as QFP128. Only SDRAM1 (1Mx16) is in use.
#define _MAIN_TYPE_4                            4       //100: Configure IC as QFP128. Both SDRAM0 and SDRAM1 are in use.
#define _MAIN_TYPE_5                            5       //101: Reserved. (QFP208 w/o SDRAM)
#define _MAIN_TYPE_6                            6       //110: Configure IC as QFP208. Only SDRAM1 (1Mx16 or 2Mx32) is in use.
#define _MAIN_TYPE_7                            7       //111: Configure IC as QFP208. Both SDRAM0 and SDRAM1 are in use.

#define _MAIN_TYPE                              _MAIN_TYPE_3

//--------------------------------------------------
// RTD3580D Pin Share
//--------------------------------------------------

#define _PIN_50                                 (3 & 0x07)    // 0 ~ 5 (0: P6D0i, 1: P6D0o<open-drain>, 2: P6D0o<push-pull>, 3: ADCA0, 4: AVOUT, 5: VCLK)
#define _PIN_51                                 (0 & 0x03)    // 0 ~ 3 (0: P6D1i, 1: P6D1o<open-drain>, 2: P6D1o<push-pull>, 3: ADCA1)
#define _PIN_52                                 (2 & 0x03)    // 0 ~ 3 (0: P6D2i, 1: P6D2o<open-drain>, 2: P6D2o<push-pull>, 3: ADCA2)
#define _PIN_53                                 (3 & 0x03)    // 0 ~ 3 (0: P6D3i, 1: P6D3o<open-drain>, 2: P6D3o<push-pull>, 3: ADCA3)
#define _PIN_54                                 (0 & 0x03)    // 0 ~ 3 (0: P6D4i, 1: P6D4o<open-drain>, 2: P6D4o<push-pull>, 3: ADCA4)
#define _PIN_55                                 (0 & 0x07)    // 0 ~ 5 (0: P6D5i, 1: P6D5o<open-drain>, 2: P6D5o<push-pull>, 3: ADCB0, 4: PWM1, 5: PWM5)

#define _PIN_56_57_IIC_ENABLE                    (0 & 0x01)    // 0 ~ 1 (0: Disable, 1: Enable) Pin56,57 for IIC
#define _PIN_56                                 (1 & 0x03)    // 0 ~ 3 (0: P6D6i, 1: P6D6o<open-drain>, 2: P6D6o<push-pull>, 3: ADCB1) Effective only if _PIN_56_57_IIC_ENABLE = Disable.
#define _PIN_57                                 (1 & 0x03)    // 0 ~ 3 (0: P6D7i, 1: P6D7o<open-drain>, 2: P6D7o<push-pull>, 3: ADCB2) Effective only if _PIN_56_57_IIC_ENABLE = Disable.

#define _PIN_58_59_DDC1_ENABLE                    (0 & 0x01)    // 0 ~ 1 (0: Disable, 1: Enable) Pin58,59 for DDC1
#define _PIN_58                                 (0 & 0x03)    // 0 ~ 3 (0: P3D0i, 1: P3D0o<open-drain>, 2: P3D0o<push-pull>, 3: RXD<open-drain>) Effective only if _PIN_58_59_DDC1_ENABLE = Disable.
#define _PIN_59                                 (0 & 0x03)    // 0 ~ 3 (0: P3D1i, 1: P3D1o<open-drain>, 2: P3D1o<push-pull>, 3: TXD<open-drain>) Effective only if _PIN_58_59_DDC1_ENABLE = Disable.

#define _PIN_64                                 (7 & 0x07)  // 0 ~ 7 (0: P1D0i, 1: P1D0o<open-drain>, 2: P1D0o<push-pull>, 3: T2, 4: SD0, 5: SPDIF0, 6: TCON[0], 7: IrDA)
#define _PIN_65                                 (2 & 0x07)    // 0 ~ 7 (0: P1D1i, 1: P1D1o<open-drain>, 2: P1D1o<push-pull>, 3: T2EX, 4: TCON[1], 5: TCON[7], 6: WS, 7: PWM1)
#define _PIN_66                                 (4 & 0x07)    // 0 ~ 6 (0: P1D2i, 1: P1D2o<open-drain>, 2: P1D2o<push-pull>, 3: CLKO, 4: SCK, 5: TCON[2], 6: TCON[4]) Effective only if 8-bit TTL Disable.
#define _PIN_67                                 (3 & 0x07)    // 0 ~ 5 (0: P1D3i, 1: P1D3o<open-drain>, 2: P1D3o<push-pull>, 3: MCK, 4: TCON[5], 5: TCON[9]) Effective only if 8-bit TTL Disable.
#define _PIN_68                                 (3 & 0x07)    // 0 ~ 6 (0: P1D4i, 1: P1D4o<open-drain>, 2: P1D4o<push-pull>, 3: SD0, 4: TCON[3], 5: TCON[13], 6: SPDIF0) Effective only if 8-bit TTL Disable.
#define _PIN_69                                 (1 & 0x07)    // 0 ~ 7 (0: P1D5i, 1: P1D5o<open-drain>, 2: P1D5o<push-pull>, 3: SD1, 4: TCON[3], 5: TCON[7], 6: SPDIF1, 7: IICSCL) Effective only if 8-bit TTL Disable.
#define _PIN_70                                 (1 & 0x07)    // 0 ~ 7 (0: P1D6i, 1: P1D6o<open-drain>, 2: P1D6o<push-pull>, 3: SD2, 4: TCON[9], 5: TCON[11], 6: SPDIF2, 7: IICSDA) Effective only if 8-bit TTL Disable.
#define _PIN_71                                 (7 & 0x0f)    // 0 ~ 8 (0: P1D7i, 1: P1D7o<open-drain>, 2: P1D7o<push-pull>, 3: SD3, 4: TCON[8], 5: TCON[10], 6: SPDIF3, 7: PWM1, 8: PWM5) Effective only if 8-bit TTL Disable.

#define _PIN_74to83                             (0 & 0x03)    // 0 ~ 2 (0: None, 1: GPI, 2: GPO) Effective only if single-port LVDS without E/O swap.

#define _PIN_96                                 (4 & 0x07)    // 0 ~ 4 (0: P5D2i, 1: P5D2o<open-drain>, 2: P5D2o<push-pull>, 3: PWM0, 4: DCLK)
#define _PIN_97                                 (4 & 0x07)    // 0 ~ 4 (0: P5D3i, 1: P5D3o<open-drain>, 2: P5D3o<push-pull>, 3: PWM1, 4: DVS)
#define _PIN_98                                 (3 & 0x03)    // 0 ~ 3 (0: P5D4i, 1: P5D4o<open-drain>, 2: P5D4o<push-pull>, 3: PWM2)
#define _PIN_99                                 (2 & 0x07)    // 0 ~ 5 (0: P5D5i, 1: P5D5o<open-drain>, 2: P5D5o<push-pull>, 3: PWM3, 4: TCON[6], 5: TCON[11])
#define _PIN_100                                (0 & 0x07)    // 0 ~ 5 (0: P5D6i, 1: P5D6o<open-drain>, 2: P5D6o<push-pull>, 3: PWM4, 4: TCON[3], 5: TCON[12])
#define _PIN_101                                (2 & 0x07)    // 0 ~ 4 (0: P5D7i, 1: P5D7o<open-drain>, 2: P5D7o<push-pull>, 3: PWM5, 4: TCON[0])
#define _PIN_102                                (0 & 0x07)    // 0 ~ 6 (0: P7D6i, 1: P7D6o<open-drain>, 2: P7D6o<push-pull>, 3: PWM0, 4: SD3, 5: SPDIF3, 6: TCON[10])
#define _PIN_103                                (0 & 0x07)    // 0 ~ 7 (0: P7D5i, 1: P7D5o<open-drain>, 2: P7D5o<push-pull>, 3: PWM1, 4: SD2, 5: SPDIF2, 6: TCON[8], 7: IICSCL)
#define _PIN_104                                (0 & 0x07)    // 0 ~ 7 (0: P7D4i, 1: P7D4o<open-drain>, 2: P7D4o<push-pull>, 3: SD1, 4: IRQ, 5: TCON[5], 6: SPDIF1, 7: IICSDA)
#define _PIN_105                                (0 & 0x07)    // 0 ~ 5 (0: P8D0i, 1: P8D0o<open-drain>, 2: P8D0o<push-pull>, 3: TCON[9], 4: SD0, 5: SPDIF0)

#define _PIN_108                                (0 & 0x07)    // 0 ~ 5 (0: P8D1i, 1: P8D1o<open-drain>, 2: P8D1o<push-pull>, 3: CLKO, 4: MCK, 5: TCON[7])
#define _PIN_109                                (0 & 0x07)    // 0 ~ 5 (0: P3D2i, 1: P3D2o<open-drain>, 2: P3D2o<push-pull>, 3: INT0, 4: TCON[3], 5: SCK)
#define _PIN_110                                (0 & 0x07)    // 0 ~ 5 (0: P3D3i, 1: P3D3o<open-drain>, 2: P3D3o<push-pull>, 3: INT1, 4: TCON[6], 5: WS)
#define _PIN_111                                (2 & 0x07)    // 0 ~ 6 (0: P3D4i, 1: P3D4o<open-drain>, 2: P3D4o<push-pull>, 3: T0, 4: TCON[4], 5: SD0, 6: SPDIF0)
#define _PIN_112                                (0 & 0x07)    // 0 ~ 6 (0: P3D5i, 1: P3D5o<open-drain>, 2: P3D5o<push-pull>, 3: T1, 4: TCON[9], 5: SD1, 6: SPDIF1)
#define _PIN_113                                (0 & 0x07)    // 0 ~ 6 (0: P3D6i, 1: P3D6o<open-drain>, 2: P3D6o<push-pull>, 3: TCON[1], 4: SD2, 5: SPDIF2, 6: IrDA)
#define _PIN_114                                (0 & 0x07)    // 0 ~ 6 (0: P3D7i, 1: P3D7o<open-drain>, 2: P3D7o<push-pull>, 3: TCON[13], 4: SD3, 5: SPDIF3, 6: VCLK)

#define _PIN_121                                (1 & 0x03)    // 0 ~ 3 (0: DDCSCL3, 1: P7D3i, 2: P7D3o<open-drain>, 3: P7D3o<push-pull>)
#define _PIN_122                                (1 & 0x03)    // 0 ~ 3 (0: DDCSDA3, 1: P7D2i, 2: P7D2o<open-drain>, 3: P7D2o<push-pull>)
#define _PIN_123                                (0 & 0x03)    // 0 ~ 3 (0: DDCSDA2, 1: P7D1i, 2: P7D1o<open-drain>, 3: P7D1o<push-pull>)
#define _PIN_124                                (0 & 0x03)    // 0 ~ 3 (0: DDCSCL2, 1: P7D0i, 2: P7D0o<open-drain>, 3: P7D0o<push-pull>)

//--------------------------------------------------
// Piblic IO define
//--------------------------------------------------
#define bI2CSDA                                    (_MCU_PORT67)
#define bI2CSCL                                    (_MCU_PORT66)

#define bPANELPOWER                             (_MCU_PORT55)
 sbit    bLIGHTPOWER                             = P3^4;
//sbit    bLIGHTPOWER                             = P1^0;

//--------------------------------------------------
// Connect definitions
//--------------------------------------------------
sbit    bVGACONNECT                             = P1^3;
#define bHDMICONNECT                            (_MCU_PORT61)
#define bHot_Plug                                (_MCU_PORT57)
//sbit    bHot_Plug                               = P3^7;
#define bDVICONNECT                             0

#define bUD                            (_MCU_PORT74)
#define bLR                            (_MCU_PORT75)

//--------------------------------------------------
//            Key definitions
//--------------------------------------------------
#if(_KEY_SCAN_TYPE == _KEY_SCAN_NORMAL)

#define bKey_P54                                (_MCU_PORT54)   //Power       
#define bKey_P56                                (_MCU_PORT56)   //Down
#define bKey_P55                                (_MCU_PORT55)   //Up
#define bKey_P57                                 (_MCU_PORT57)   //Left
#define bKey_P76                                (_MCU_PORT76)   //Right
sbit    bKey_P34                                = P3^4;         //Source
#define bKey_P81                                (_MCU_PORT81)   //Menu

#else

//MCU_ADC0,MCU_ADC1,MCU_ADC2,MCU_ADC3,MCU_ADC4
#define AD_KEY0                                 MCU_ADC_NONE
#define AD_KEY1                                 MCU_ADC3
#define AD_KEY2                                 MCU_ADC_NONE
#define AD_KEY3                                 MCU_ADC_NONE
#define AD_KEY4                                 MCU_ADC_NONE

#define bAD1_Key_1                              45        // SOURCE   
#define bAD1_Key_2                              255//28        // LEFT
#define bAD1_Key_3                              10        // MENU
#define bAD1_Key_4                              255//18        // RIGHT
#define bAD1_Key_5                                17//255        // UP
#define bAD1_Key_6                                26//255        // DOWN
#define bAD1_Key_7                                0        // Power
#define bAD1_Key_8                              255        // RESET

#endif

//--------------------------------------------------
//            LED definitions
//--------------------------------------------------
//sbit bLED2                                        = P3^2;
//sbit bLED1                                        = P3^3;
sbit bLED2                               = P1^1;
#define bLED1                          (_MCU_PORT62)

//--------------------------------------------------
// Tuner power
//--------------------------------------------------
//#define bTUNER_PWR                              (_MCU_PORT60)

#define TUNER_PWR_ON()                          //(bTUNER_PWR = 1)
#define TUNER_PWR_OFF()                         //(bTUNER_PWR = 0)

//--------------------------------------------------
//            FM definitions
//--------------------------------------------------
//#define bFM77                          (_MCU_PORT53)
#define bD0                            (_NO_PORT)
#define bD1                            (_NO_PORT)
#define bD2                            (_NO_PORT)
#define bD3                            (_NO_PORT)
#define bD4                            (_NO_PORT)


//--------------------------------------------------
//            Audio definitions
//--------------------------------------------------
#define AUDIO_TYPE                              _AUDIO_PWM      // _AUDIO_SC7313,_AUDIO_PWM

#define bAUDIO_MUTE_A                            (_MCU_PORT64)
#define SET_bAUDIO_MUTE_A(x)                    (bAUDIO_MUTE_A = x)
#define _MUTE_ON                                0
#define _MUTE_OFF                               1
#define bMUTE                                   (bAUDIO_MUTE_A)

#if (AUDIO_TYPE == _AUDIO_PWM)
#define _AUDIO_A                                (_MCU_PORT81)       
sbit      _AUDIO_B                                 = P3^2;

#define _VOLUME_INV                             1
#define _MAX_VOLUME                             190
#define _MIN_VOLUME                             0

/*
_RTD_PWM0, _RTD_PWM1, _RTD_PWM2, _RTD_PWM3, _RTD_PWM4, _RTD_PWM5
*/
#define bVOLUME_PWM                             _RTD_PWM5

#endif

#if (AUDIO_TYPE == _AUDIO_SC7313)
#define _SOUND_PROCESSOR                        _ON      // _ON, _OFF
#else
#define _SOUND_PROCESSOR                        _OFF      // _ON, _OFF
#endif

//--------------------------------------------------
// Definitions for Backlight PWM Setting
//--------------------------------------------------
/*
_RTD_PWM0, _RTD_PWM1, _RTD_PWM2, _RTD_PWM3, _RTD_PWM4, _RTD_PWM5
*/
#define _BACKLIGHT_PWM                         _RTD_PWM1
#define _BACKLIGHT_PWM_INVERSE                 _DISABLE    // _ENABLE,  _DISABLE

#define _BACKLIGHT_PWM_FREQ                        500        // hz

//--------------------------------------------------
// PWM Supported
//--------------------------------------------------
#define _MCU_PWM0_SUPPORT                      _ON
#define _MCU_PWM0_FIRST_STAGE_DIV                (0 << 0)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM0_SECOND_STAGE_DIV                13

#define _MCU_PWM1_SUPPORT                      _OFF
#define _MCU_PWM1_FIRST_STAGE_DIV                (0 << 2)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM1_SECOND_STAGE_DIV                0

#define _MCU_PWM2_SUPPORT                      _OFF
#define _MCU_PWM2_FIRST_STAGE_DIV                (0 << 4)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM2_SECOND_STAGE_DIV                0

#define _MCU_PWM3_SUPPORT                      _OFF
#define _MCU_PWM3_FIRST_STAGE_DIV                (0 << 6)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM3_SECOND_STAGE_DIV                0

#define _MCU_PWM4_SUPPORT                      _OFF
#define _MCU_PWM4_FIRST_STAGE_DIV                (0 << 0)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM4_SECOND_STAGE_DIV                0

#define _MCU_PWM5_SUPPORT                      _OFF
#define _MCU_PWM5_FIRST_STAGE_DIV                (0 << 2)        // 0-/1, 1-/2, 2-/4, 4-/8
#define _MCU_PWM5_SECOND_STAGE_DIV                0


#define _MCU_PWM_SUPPORT                       (_MCU_PWM0_SUPPORT       |  \
                                               (_MCU_PWM1_SUPPORT << 1) |  \
                                               (_MCU_PWM2_SUPPORT << 2) |  \
                                               (_MCU_PWM3_SUPPORT << 3) |  \
                                               (_MCU_PWM4_SUPPORT << 4) |  \
                                               (_MCU_PWM5_SUPPORT << 5))

//--------------------------------------------------
// Over Driving Supported
//--------------------------------------------------
#define _OD_SUPPORT                                _OFF    //2660 not support over driving
#define _OD_COMPRESSION                         _OFF    //2660 not support over driving

//--------------------------------------------------
// EDID
//--------------------------------------------------
#define _DDC_CHANNEL_FOR_D0                    _DDC2    // DDC Channel SEL for digital input 0
#define _DDC_CHANNEL_FOR_D1                    _DDC3    // DDC Channel SEL for digital input 1

//--------------------------------------------------
// Interior VGA  EDID
//--------------------------------------------------
#define _VGA_EDID                              _OFF

//--------------------------------------------------
// HDMI EDID
//--------------------------------------------------
#define _HDMI_EDID                             _ON
#define _HDMI_DDC_CHANNEL_SELECT                _DDC_CHANNEL_FOR_D0

//--------------------------------------------------
// Interior DVI  EDID
//--------------------------------------------------
#define _DVI_EDID                              _OFF
#define _DVI_DDC_CHANNEL_SELECT                _DDC_CHANNEL_FOR_D1

//--------------------------------------------------
// HDCP Supported
//--------------------------------------------------
#define _HDCP_SUPPORT                           _ON

//--------------------------------------------------
// HDMI HOT PLUG OPTION
//--------------------------------------------------
#define _HDMI_HOT_PLUG_OPTION                      _DISABLE

#define _HOT_PLUG_HI                            0
#define _HOT_PLUG_LOW                           1

//--------------------------------------------------
// For digital input swap
//--------------------------------------------------
#define _CHANNEL_D0_RG_SWAP                    (_ENABLE << 6)
#define _CHANNEL_D0_PN_SWAP                    (_ENABLE << 5)

#define _CHANNEL_D1_RG_SWAP                    (_DISABLE << 6)
#define _CHANNEL_D1_PN_SWAP                    (_DISABLE << 5)

#define _SLEEP_FUNC                            _DISABLE
#define _ICM_FUNC                              _DISABLE
#define _LOGO_ENABLE                           _DISABLE
#define _DEBUG_EN                              _DISABLE
 
Based off of the diagram you sent, it looked like Sync on Green is tied into PB. Your going to want it tied into Y as thats where the sync of your source comes from, hence it not working. There could be other issues but I would start with that!

If that doesn't work right away, you can try changing the YPbPr Sync Source from SOG0 to SOG1 in the code, but start with SOG0 first.
//--------------------------------------------------
// YPbPr Sync Source
//--------------------------------------------------
#define _SOG0 0
#define _SOG1 1

#define _YPBPR_SYNC_SOURCE _SOG0
 
Based off of the diagram you sent, it looked like Sync on Green is tied into PB. Your going to want it tied into Y as thats where the sync of your source comes from, hence it not working. There could be other issues but I would start with that!

If that doesn't work right away, you can try changing the YPbPr Sync Source from SOG0 to SOG1 in the code, but start with SOG0 first.
Thanks! I have tried updating the circuit diagram. Is this connection correct?
c95c263d-1074-4b9f-addd-1a42b1e2c760.webp




I tried directly swapping the Y and PB channels, which is the quickest method and doesn't require soldering. However, unfortunately, it still prompts "No Signal." This is bad news. The specific connection is as follows:

Y → PB
PB → Y

B0- → G0-
B0+ → G0+
G0- → B0-
G0+ → B0+
 
Last edited:
Back
Top