[SOLVED]help , About UM6558 / UM6559 Pinouts

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderator: Moderators

lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: help , About UM6558 / UM6559 Pinouts

Post by lidnariq »

bestmmk wrote:CD0-CD7 should be color data of graphics. This requires a logical analysis. If the palette problem is corrected, it will be of great value
Well, sure. I was curious about the specifics.
krzysiobal wrote:Maybe you can put some CPLD logic between UM6558/UM6559 on CD0-7 lines, which changes problematic dot colours in the fly to the correct ones, that don't cause troubles?
It looks like it's only 8 bits wide input and output ... I bet you could just use a fast ROM. After all, we can easily get 70ns ROMs, and it's a ~1/(186ns) pixel clock...
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

I have done exactly this, put a GAL between the colour bus output of UM6558 and the input of UM6559.

In fact it was only necessary to generate new CD4 and CD5 signals. These are the luminance pins of the colour bus output and are in the same format as the colour registers.

CD0 - CD3 are the hue pins of the colour bus output and they are inverted with respect to the colour registers, so software colour 00 (dark grey) is colour 0F in the hardware interface between the two chips.

This inversion makes the hardware colours more intuitive, because hardware colour 00 (software colour 0F) is black and hardware colour 3F (software colour 30) is white.

The hardware palette puts
8 blacks at 00, 10, 20, 30, 01, 11, 21, 31
the darker greys at 02, 12, 22, 32 (02 is software colour 0D which is blacker than black in PAL/NTSC)
the colours at 03-0E, 13-1E, 23-2E, 33-3E
the lighter greys at 0F, 1F, 2F, 3F.
Last edited by vortexion on Fri Apr 28, 2017 2:25 am, edited 1 time in total.
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

Photo 10-04-2017, 12 58 02.jpg
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

Some pictures of Battle City running on the modified Dendy SECAM. This game is a good test because it uses a dark grey colour (software colour 00, hardware colour 0F) which is rendered as black by the standard Dendy SECAM.
Photo 10-04-2017, 12 44 24.jpg
Photo 10-04-2017, 12 45 44.jpg
Photo 10-04-2017, 12 55 07.jpg
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

The GAL maps the hardware colours output by the UM6558 onto the following values for driving the UM6559. These are hardware colour numbers, so the first four bits (hue) are inverted with respect to the colour registers.

Blacks
00, 10, 20, 30 -> 00, 00, 00, 00
01, 11, 21, 31 -> 01, 01, 01, 01

Dark greys
02, 12, 22, 32 -> 02, 02, 12, 22

Colours stay the same

Light greys
0F, 1F, 2F, 3F -> 1F, 2F, 3F, 3F
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by lidnariq »

That's so cool! Thank you for sharing!

Do you know what the top two bits of the 8-bit CD bus carry?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by tepples »

The unknown bits aren't emphasis, are they?
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by lidnariq »

Unless they're somehow serialized (perhaps sending only R or B on alternating scanlines) I don't know how...

One of the bits is probably sync, too.
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

The Dendy SECAM doesn't support colour emphasis bits at all, neither in composite SECAM nor in RGB.

CD6 and CD7 turn out not to be very exciting. CD6, pin 9 of UM6559, is a positive logic version of composite sync (pin 8 is negative logic composite sync) and CD7, pin 10 of UM6559, is a negative logic version of frame sync.
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

I've made two videos which show the Dendy SECAM composite and RGB palettes after the GAL modification has been applied. There are still some problems with the two palettes.

In RGB, the problem is that the colours do not have equal luminance (brightness) across colours 1 - C. For example, blue (2) is too dark and yellow (8) is too light. This is because the RGB values are not matrixed from a constant Y value and varying R-Y and B-Y values (as they are in PAL/NTSC), but are generated by a simple DAC scheme which does not attempt to preserve constant luminance. Any of the palettes in the NESRGB board look better than the UM6559 RGB colours.

In composite SECAM, the colours do have equal luminance but a different problem occurs with the darkest colours 01 - 0C and the lightest colours 31 - 3C. The UM6559 only generates 4 luminance levels. Colours 01 - 0C have the same luminance as black and 31 - 3C have the same luminance as white.

This means that patterns using the darkest colours on a black background will look very indistinct, because there are no luminance transitions at the colour boundaries. Only chrominance information changes, and this is carried in very low resolution.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by lidnariq »

I just put two and two together and realized that you could replace the UM6559 with a ROM, since all you want is RGB output.

While an 8-bit ROM would only afford R3G3B2, multiple ROMs could be combined to produce a higher-precision "ROMDAC".

Additionally, you could then add an 74'138 and a 3(or more) bit latch to capture writes to PPU $2001, and use those extra latched bits to add emphasis bit support.
User avatar
vortexion
Posts: 18
Joined: Fri Apr 22, 2016 4:28 pm
Location: UK
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by vortexion »

I've been working on modifications to improve the SECAM output, because I want to see what a (good) SECAM Dendy would be like.

For RGB, you could use ROMs or possibly the GALs I am using. A GAL16V8 has 8 outputs so two of these will give you 16 outputs. R5G5B5 will give 32768 possible colours, from which the 52 or 54 NES colours can be chosen. Emphasis will require more electronics like you suggest.
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by krzysiobal »

I just reminded myself that I got two UM6559, bought few years ago (unfortunatelly, only this DAC, no PPU)
After some testing I can say that:

* Both VCC pins (3, 15) are shorted internally
* GND pins are not shorted internally
* pin 7 (NC) seems to be unknown input (internally wired)
* pin 13 (NC) seems to be unknown output - it toggles after 3rd, 5th and 8th falling edge of clock, generating alternating pattern (05.png):
Image

* RED, GREEN, BLUE: 8 levels (non-loaded): 0.95V, 1.18V, 1.42V, 1.65V, 1.89V, 2.12V, 2.35V, 2.60V
* SYNC: 2 levels: 0V, 5V
* LUMA: 5 levels (non-loaded): 1.15V, 1.97V, 2.43V, 3.03V, 3.41V
* SYNC = inverted CD6
* RED/GREEN/BLUE/LUMA are output only if CD6 is low
Image

POWER UP condition:
* SYNC line works immediatelly since first clock cycle
* RED/GREEN/BLUE works after around 132 clock cycles
Image

Transition:
After setting value on CD0..CD7, there need to be at least 8 edges of clk.
* RED/GREEN/BLUE changes on 5th falling edge
* LUMA changes on 8th falling edge
Image


Exact values of RED/GREEN/BLUE for all CD0..CD5 combinations:
Image Image

RED: 0,0,5,2,0,0,4,6,2,2,6,6,1,0,2,5,3,3,7,5,0,0,6,7,4,4,7,7,2,0,5,7,5,2,5,2,4,6,4,6,6,6,6,6,2,5,2,5,7,5,7,5,6,7,6,7,7,7,7,7,5,7,5,7
GRN: 0,0,5,6,2,2,6,6,1,0,2,2,0,0,4,5,3,3,7,7,4,4,7,7,2,0,4,4,0,0,6,7,5,6,5,6,6,6,6,6,2,2,2,2,4,5,4,5,7,7,7,7,7,7,7,7,5,5,5,5,6,7,6,7
BLU: 0,0,5,6,1,0,2,2,0,0,4,6,2,2,6,5,3,3,7,7,2,0,5,5,0,0,6,7,4,4,7,7,5,6,5,6,2,2,2,2,4,6,4,6,6,5,6,5,7,7,7,7,5,5,5,5,6,7,6,7,7,7,7,7

Image
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: [SOLVED]help , About UM6558 / UM6559 Pinouts

Post by lidnariq »

krzysiobal wrote: Sun Mar 22, 2020 5:45 am * GND pins are not shorted internally
Is one analog ground and one digital? Or is one an input?
* pin 13 (NC) seems to be unknown output - it toggles after 3rd, 5th and 8th falling edge of clock, generating alternating pattern (05.png):
Any chance it has something to do with generating SECAM FM chroma signal?
Exact values of RED/GREEN/BLUE for all CD0..CD5 combinations
I think something went wrong. That states that colors 21, 23, and 03 are all the same, as are 22=24=04, 32=34=14, and so on.

Also, I have to admit to being curious what the "A1" and "A2" pins are.
Post Reply