6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 7:14 am

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Mon Jan 10, 2022 3:08 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1120
Location: Albuquerque NM USA
Woof! I see some pretty complicated circuits here.

My simple VGA circuit has 4-bit outputs; 3 bits are full intensity red, green and blue (I believe full intensity level is 0.7V). Now what to do with the 4th bit? So my thought is this: when high the 4th bit does nothing; when low it reduces the intensity of RGB by about 1/2. So 4th bit is a subtraction bit by clamping RGB outputs with Schottky diodes. I can tweak the value subtracted with resistors, but biological sensors like our eyes are logarithmic so the 0.3V-ish clamping voltage is good enough (for hobbyists).
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 3:30 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
plasmo wrote:
My simple VGA circuit has 4-bit outputs; 3 bits are full intensity red, green and blue (I believe full intensity level is 0.7V). Now what to do with the 4th bit? So my thought is this: when high the 4th bit does nothing; when low it reduces the intensity of RGB by about 1/2.

The only issue with that is that "dark black" is the same as normal black.

I'm pretty sure the old CGA palette just pulled R, G, and B towards the intensity signal using an extra three resistors. This method worked well for me. Another way to think of it is that all three colour channels are two-bit, but the low order bit is shared between them.

(Of course CGA actually had some other special arrangement to turn dark yellow into brown...)


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 3:46 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
gfoot wrote:
I'm pretty sure the old CGA palette just pulled R, G, and B towards the intensity signal using an extra three resistors. This method worked well for me. Another way to think of it is that all three colour channels are two-bit, but the low order bit is shared between them.


Personally, I started this to see if I could pick 16 colors from a bank of 256 colors.

Here's my reasoning and I'm going back to Page 1 diagrams here:

I 'latch' an 8-bit color configuration. This would be 3x Red, 3x Green, 2x Blue, just like a normal 8-bit color palette. From that latch, I 'select' colors from it. In a way, I can set the red to 'really red' or 'not really red', etc, through the latched 8-bit color. When I select red from RAM, it would pull whatever 'red' I had latched. In theory at least, this should allow for me to have 16 different colors from a bank of 256 colors. To 'select' colors from the latch, I was using the diodes. There are other ways using IC's, but my board is full and diodes are small.

Either way, just playing around with ideas.

Thanks!

Chad


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 3:51 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1120
Location: Albuquerque NM USA
gfoot wrote:
I'm pretty sure the old CGA palette just pulled R, G, and B towards the intensity signal using an extra three resistors. This method worked well for me. Another way to think of it is that all three colour channels are two-bit, but the low order bit is shared between them.

Thanks! This tells me I should read about CGA instead of re-inventing the wheel. I see there is a decent Wiki article about RGBI.
Bill


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 4:38 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
Attached is a new idea, not using diodes, but transistors.

Again, the idea is that my 4-bit RGBI will "select" values from a 8-bit latch. It's like a preset 16-color palette, and you are just selecting from 256 total colors (kindof).

Will this smoke? :) On my next parts order I will get some transistors to just experiment with, but just tossing the idea around right now.

Chad

EDIT: I've NEVER done a thing with transistors, so I have even less of an idea of what's going on there than with diodes. If my diagram is wildly wrong, I don't mind you telling me so.


Attachments:
Transistors.png
Transistors.png [ 7.62 KiB | Viewed 262 times ]
Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 5:31 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
sburrow wrote:
Attached is a new idea, not using diodes, but transistors.

Again, the idea is that my 4-bit RGBI will "select" values from a 8-bit latch. It's like a preset 16-color palette, and you are just selecting from 256 total colors (kindof).

Will this smoke? :) On my next parts order I will get some transistors to just experiment with, but just tossing the idea around right now.

I don't think that will work as you expect. See here: https://www.falstad.com/circuit/circuit ... FBYJJwGwgA

I added some extra resistors and the graph at the bottom shows the voltage over the 75ohm resistor (simulating the monitor attached to the output). You'll see that when the base is high, this maintains about the right voltage, regardless of what you do with the collector. The extra collector resistor is important because without it huge current travels from the base through the collector when the base is high and the collector is low.

Quote:
EDIT: I've NEVER done a thing with transistors, so I have even less of an idea of what's going on there than with diodes. If my diagram is wildly wrong, I don't mind you telling me so.

I know the feeling! I used to think I understood transistors, until I tried designing circuits with them. My mental model was all wrong because it's just what I learned at school decades ago. So I studied them some more, and now I know at least that my knowledge is very limited!

Edit: I realised that above I only pointed out a problem, I didn't really say much that helps actually fix the circuit. As others have said, the basic diode idea is probably fine at a hobbyist level. But if you add a buffer after it, it's even better - like this: https://www.falstad.com/circuit/circuit ... DCNI4BsEAA

The emitter-follower transistor means that the low value resistors in the monitor don't unduly influence the voltage divider you're building - almost all the current comes from the collector - and the base-emitter drop across the transistor roughly matches the diode's, so the output still goes almost all the way to ground when the lower switch (RED_SELECT) is low. You can use nice large resistors in the resistor network so you don't get a lot of current flowing there. Note that the inactive channels are pulling down when the others are active - you can lean into that, or add more diodes if you want (but it sounds like space is at a premium). For the most part, you can build whatever you like left of the transistor, and the output the monitor sees (including its input impedance) will be approximately (Vbase - 0.6V)/2.

Another note on the original, unbuffered diode idea - in fact monitors will analog-couple the signals, so it doesn't matter too much if your output signal doesn't go down to ground. The monitor interprets it relative to whatever value it takes during the blanking interval. So for example if you output 1.5V at a minimum (during blanking) relative to your signal ground, the monitor will be fine with that and it will interpret 1.5V as black and 1.5V+0.7V = 2.2V as white.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 10, 2022 8:25 pm 
Offline

Joined: Sat Oct 09, 2021 11:21 am
Posts: 718
Location: Texas
George, thank you first off for those links. Falstad.com, eh? Whatever it is, it is SUPER NEAT. Never seen something like that before. Thank you for that.

I looked at both circuits. The first one is easy to understand for sure. I'll go more into that in a minute. The second one was very intimidating looking! But all it is are those 3 individual red's merging into one.

I didn't see the need for the diode until I tried to remove it. AH!

As far as the monitor automatically adjusting the "0" during blanking, I have heard about this... Still, the monitor I'm using is very stupid and I'm not going to assume something so nice would happen to me :)

Attached is a small revision to the transistor circuit. I added 10K resistors to the base, and that's it. R1, R2, and R3 are changed according to what what is needed to reach the monitor at 0.7V (whatever formula I used, it's somewhere around here). On Falstad, this means that both base and collector must be on for the emitter to be on. When the base is grounded, nothing goes to the emitter. When only the collector is grounded, it trickles a little bit to both collector and emitter, but it's negligible with that 10K resistor.

A buddy gave me a little hobby kit a few months ago, and I was thinking there might be something like this in there. Sure enough, there are 2N2222 transistors! So I tested it out and... I got similar results to Falstad. They said I should yield around 3V where I was lighting up an LED, I got something closer to 1.8V or something. Whatever, it's still working as expected. I just adjust the resistors accordingly.

One thing about Falstad is that their diodes seem to be "perfect". I stuck one in there to see what happens, and it won't let anything past. No trickles, no reverse voltage whatevers. Maybe I need to research that a bit more, but so far the transistor seems to work both on computer and in real life.

If I'm not seeing something basic here, tell me. Otherwise, this might be a case-closed: Diodes are neat, but transistors were what I really needed.

Thanks so much everyone!

Chad


Attachments:
Transistors2.png
Transistors2.png [ 9.1 KiB | Viewed 243 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 24 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: