6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 16, 2024 3:39 pm

All times are UTC




Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Sun Dec 25, 2016 5:17 am 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
I tried that a few hours ago as well, thinking that I had it beat!
What might not be apparent is the single pixel that is drawn off your visible screen.
2 monitors I tried did not care, and auto sized the image correctly.
The 3rd monitor counted that single pixel, even though it was in the overscan zone.
The result was a lot of twiddling with phase and pixel clock on the monitor to get it off the edge.

My conclusion is that you simply cannot force the UDR low all the way unless you constantly write to it.
Because of this, I was forced to do something I actually like much better than monochrome text.

I am now looking at a 216x160 bitmapped display with 4 colors. This uses 8640 of the 16384 SRAM bytes.
This will be much more interesting and useful for games and demos, and can still do 27x20 color characters.

Now my 2 chip computer stays at 2 chips, and is at least as good as a Vic-20.
I think I have maxed out the possibilities now, so I am working on the 6502 timing now.

Thanks for the suggestions, I did enjoy looking over your website.

Brad


8BIT wrote:
I think what I did was to write a 41st byte that was 0x00 to keep the data pin to stay low until it ran off of the right edge.
Also, I enable to USART and immediately write 0x00 to the UDR register before I start sending characters to keep the left edge low as well. So in actuality, I'm writing 42 bytes per line.
Hope that helps.
Daryl


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 6:19 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Quote:
What might not be apparent is the single pixel

Why didn't I think of that?! A one-pixel video display. An LED would do. :lol: After all, there are one-bit A/D converters too, right?

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 2:06 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
I probably don't explain things all that well!
By single pixel, I am referring to a vertical band created in the overscan era by the positive USART polarity.

Here is a nice looking screen of text that seems to have nothing wrong with it...

Image
A crisp 40x60 Character Display coming from my 2 Chip Computer.

But due to the way the AVR ASART works, a positive pulse happens on the buffer being empty.
Most monitors simply regard this as a "glitch", and auto adjust the band off the screen.
One very high end monitor I tried actually included this as part of the image.

Here is the hidden band shown by tweaking the clock phase and H position on the monitor...

Image
Oh look, a hidden line in the overscan area. You bad USART!.

I am just too picky to live with the hidden line. 1 out of 10 monitors would require adjusting.

Currently, I am looking into a few solutions, including stuffing the buffer during the blanking.
I also tried PWM from another pin to "kill" the video, but this left a tiny artifact. Not cool.

Either way, my 2 chip computer will display something by the time I am done!

Oh, and an OLED is a no-no for this project, as it breaks my "common video appliance" rule.
I should have just stated it simply... TV or Monitor and Speaker or Amplifier only.

Brad

GARTHWILSON wrote:
Quote:
What might not be apparent is the single pixel

Why didn't I think of that?! A pixel video display. An LED would do. :lol: After all, there are one-bit A/D converters too, right?


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 7:03 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
Ok, I made some compromise in order to balance simplicity with usability, and added one logic chip.
Now I have a 3 Chip Computer (65C02, AVR1284, and 74HC574).

I was just not happy having a hidden vertical line in the video stream, so I added a buffer / latch.
This also added the ability to have a 256 color text display.
Now the display has 40 x 30 characters with 256 colors available (1 color per character).
The background can also be set to any one of 256 colors.

Oh, and the entire screen can be bitmapped 320x240! This is the killer feature for sure.

Image
It's not amazing, but graphics nonetheless!

The entire screen can be bitmapped as a 320 x 240 image, with color mapped as 40 x 30 squares.
It's not perfect, but not bad for a 3 Chip System. Not as good as a C64, but much better than a Vic20.

Currently, I only have 3 of the 8 color lines connected, so it's only showing 8 colors.
Here is the hardware now...

Image
Now it's a 3 chip Computer. Still a low parts count.

Looks like the competition just opened up wide again!
Anyone out there with a DIP PIC32MZ? yeah... it could be done with just 2 Chips.

Ok, I will now wire up the 65C02 and convert my FPGA clocking code to work on the AVR.
If I can get even 2MHz out of the 6502, I will be happy indeed.

Oh, and Happy Holidays to the lot of you!
Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 7:20 pm 
Offline

Joined: Sat Oct 20, 2012 8:41 pm
Posts: 87
Location: San Diego
Very nice project Brad, looks great!

It would be cool if you can use the 65C02 to control the other AVR USART for serial communication.

Happy Holidays to you and everyone!
Ron


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 8:19 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
Thanks!

Here is an example of a bitmap screen...

Image
A 320x240 Bitmap with "sort of" colorizing done.

Since there is no external RAM or ROM, the AVR memory is used like this...

Code:
// PIXEL MEMORY FROM 00000 TO 09599 = 9600 BYTES
#define PIXELMEM RAMSTART

// COLOR MEMORY FROM 09600 TO 10799 = 1200 BYTES
#define COLORMEM RAMSTART+9600

// 6502 ZERO PAGE MEMORY FROM 10800 TO 11055 = 256 BYTES
#define ZPAGE RAMSTART+10800

// 6502 STACK MEMORY FROM 11056 TO 11311 = 256 BYTES
#define STACK RAMSTART+11056

// 6502 SRAM MEMORY FROM 11312 TO 16383 = 5072 BYTES
#define SRAM RAMSTART+11312

// 6502 ROM MEMORY FROM 16384 TO 65535 = 49152 BYTES


So much like the way the C64 bitmap mode works, Pixels are one layer, and color is another.
Since color is only a 40x30 map, it's not exactly hi fidelity to color a bitmap!

Here is the image I stole for the bitmap...

http://www.demoscene.nl/pouet/cga1.png

I just randomly tossed some color to it. It certainly could look a lot better if made from scratch.

So that leaves the 6502 with 5K of RAM, and almost 50K for ROM.
This will work ok, as most Games / Demos are mainly stuffed with graphics and music.
Consider the 5K to be variables, and there is still the Stack and Zero Page available.

Ok, next step will be to get the 65C02 talking to the AVR, running code from the AVR Flash.

I am off to drink too much and watch the DieHard trilogy, so there will be no more for today!

Cheers!
Radical Brad


Last edited by Oneironaut on Sun Dec 25, 2016 8:23 pm, edited 3 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 8:20 pm 
Offline

Joined: Tue Nov 10, 2015 5:46 am
Posts: 230
Location: Kent, UK
Oneironaut wrote:
This also added the ability to have a 256 color text display.
Nice.

Quote:
Anyone out there with a DIP PIC32MZ? yeah... it could be done with just 2 Chips.
It looks like the PIC32s max out at 28 pins for the DIP parts, so I don't think they can be made to work. How many pins are you using on the AVR?


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 25, 2016 8:24 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
Every last one! 32 IO lines used here.
I even have to tristate the 6502 to drive out the color data.

Here is the IO utilization of the ATMega1284 I am using...

Code:
// SETUP PORT A
sbi DDRA,0; 6502 ADDRESS BIT 00
sbi DDRA,1; 6502 ADDRESS BIT 01
sbi DDRA,2; 6502 ADDRESS BIT 02
sbi DDRA,3; 6502 ADDRESS BIT 03
sbi DDRA,4; 6502 ADDRESS BIT 04
sbi DDRA,5; 6502 ADDRESS BIT 05
sbi DDRA,6; 6502 ADDRESS BIT 06
sbi DDRA,7; 6502 ADDRESS BIT 07

// SETUP PORT C
sbi DDRC,0; 6502 ADDRESS BIT 08
sbi DDRC,1; 6502 ADDRESS BIT 09
sbi DDRC,2; 6502 ADDRESS BIT 10
sbi DDRC,3; 6502 ADDRESS BIT 11
sbi DDRC,4; 6502 ADDRESS BIT 12
sbi DDRC,5; 6502 ADDRESS BIT 13
sbi DDRC,6; 6502 ADDRESS BIT 14
sbi DDRC,7; 6502 ADDRESS BIT 15

// SETUP PORT B
sbi DDRB,0; 6502 DATA BIT 0
sbi DDRB,1; 6502 DATA BIT 1
sbi DDRB,2; 6502 DATA BIT 2
sbi DDRB,3; 6502 DATA BIT 3
sbi DDRB,4; 6502 DATA BIT 4
sbi DDRB,5; 6502 DATA BIT 5
sbi DDRB,6; 6502 DATA BIT 6
sbi DDRB,7; 6502 DATA BIT 7

// SETUP PORT D
sbi DDRD,0; HORIZONTAL SYNC
sbi DDRD,1; VERTICAL SYNC
sbi DDRD,2; AUDIO OUTPUT
sbi DDRD,3; PIXEL DATA
sbi DDRD,4; 6502 RW
sbi DDRD,5; 6502 PH2
sbi DDRD,6; 6502 BE
sbi DDRD,7; REGISTER CLOCK


Since the 6502 just thinks that is is jacked into a 64K RAM, it requires 27 of the IO pins to control!

Brad

Quote:
Anyone out there with a DIP PIC32MZ? yeah... it could be done with just 2 Chips.
It looks like the PIC32s max out at 28 pins for the DIP parts, so I don't think they can be made to work. How many pins are you using on the AVR?[/quote]


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 6:00 am 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
I dunno. I mean, it's neat and all, but there's a lot of baby out with the bath water.

If you want to "just code 6502", I mean, you can do that in Minecraft for crying out loud.

The video requirement is simply too steep, IMHO. If you look at the history of 6502 computer, it was the sound and video components that truly distinguished one from the other, and it was also these components that exponentially ratcheted up the complexity of these machines (notably the magic chips in the Atari and C64).

Personally, getting a 6502 up on a serial terminal with some discrete logic, and a monitor ROM, would be far more "satisfying" for a hobby project. You'd have the primary components of a "computer" all sitting out to be wired up and pointed to with a pencil. "Here's the CPU, here's the clock, here's the decoding logic, here's the RAM, and the ROM and RS-232 chip".

Having a CPU chip and an "everything else chip" just...loses something for me. Doesn't seem like much of an accomplishment. "Exercise 1: wire up an LED to a battery. Exercise 2: wire up a 6502 to Big Black Box and plug in a monitor". It's like those "How to draw Skippy" lessons, where lesson 1 is a circle, and lesson 2 is "fill in the circle to look like Skippy".

I love your display, grats on getting all that to work, but a 2 chip solution that results is such a sophisticated device, IMHO, misses something.


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 7:17 am 
Offline
User avatar

Joined: Tue Nov 16, 2010 8:00 am
Posts: 2353
Location: Gouda, The Netherlands
whartung wrote:
It's like those "How to draw Skippy" lessons, where lesson 1 is a circle, and lesson 2 is "fill in the circle to look like Skippy".

Or like this :lol: https://www.youtube.com/watch?v=wmqsk1vZSKw


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 7:28 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8491
Location: Midwestern USA
Arlet wrote:
whartung wrote:
It's like those "How to draw Skippy" lessons, where lesson 1 is a circle, and lesson 2 is "fill in the circle to look like Skippy".

Or like this :lol: https://www.youtube.com/watch?v=wmqsk1vZSKw

:lol: :lol: :lol:

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 8:00 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8491
Location: Midwestern USA
whartung wrote:
I dunno. I mean, it's neat and all, but there's a lot of baby out with the bath water...getting a 6502 up on a serial terminal with some discrete logic, and a monitor ROM, would be far more "satisfying" for a hobby project.

I'm of the same mindset.

When I started on my POC project back in 2009, I briefly toyed with the idea of integrating video and keyboard into the mess. After cogitating for some time on what it would take to do so I came to my senses and took the route you described. Video in almost any form is not a trivial thing to implement. While I was reasonably confident I could find a way to do so, I was also mindful of the amount of time that would be required to not only figure out the hardware interface, but write the necessary drivers. As I had several WYSE 60 terminals kicking around, I pressed one into service, and concentrated on the nuts and bolts of building a functioning computer (all documented here). I daresay that had I stubbornly insisted on integrated video and a keyboard I'd probably still be debugging the hardware.

Incidentally, I currently am using a recycled WYSE Linux thin client as the console terminal, running through its built-in serial port, with the port running at 115.2Kbps with hardware handshaking, its maximum possible speed. This unit processes with considerable alacrity and display updates occur much more quickly than what I was seeing on the WYSE 60. The snappy display makes POC V1.1 look like it's really fast. :D Well, it is fast compared to a Commodore 64. :o :shock:

Coming down the pike, assuming I regain a reasonable amount of eyesight when I'm done with the clinical trial (which will end for me in early May 2017), I am going to adapt Geoff Graham's VT100 terminal-on-a-chip (TOAC) to POC V2. TOAC will be constructed on a separate PCB, with an umbilical cord that will plug into the console port on POC V2. Jumpers that are already part of POC's hardware will be set to direct the TTL-level I/O of the SC28C94 QUART's channel A to the TOAC, as well as put Vcc on the console port output corresponding to DTR, which will power TOAC. This arrangement will allow me to test TOAC without any hardware alterations to POC itself, simplifying the debugging process. Assuming that it all works to my satisfaction, I will follow up by designing POC V3, which will have TOAC as part of the hardware, giving it integrated video, along with keyboard input using a standard PS/2 PC keyboard.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 2:19 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
whartung wrote:
Having a CPU chip and an "everything else chip" just...loses something for me. Doesn't seem like much of an accomplishment. "Exercise 1: wire up an LED to a battery. Exercise 2: wire up a 6502 to Big Black Box and plug in a monitor". It's like those "How to draw Skippy" lessons, where lesson 1 is a circle, and lesson 2 is "fill in the circle to look like Skippy".

Well Turing Equivalence says it's actually the exact same problem, just moved into the realm of the microcontroller's firmware rather than hardware. But software is much easier to rewire than IC's.


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 3:07 pm 
Offline
User avatar

Joined: Mon May 25, 2015 2:25 pm
Posts: 680
Location: Gillies, Ontario, Canada
Although I have 2 other 6502 based projects on the go that have seriously more multimedia power than this one, there is still a draw for me to see what can be done with the fewest possible DIP parts on a breadboard. Actually, I remember coming here years ago, and considered getting into 6502, but after looking through all the great DIY projects and lessons, I was just turned off by the need for ROM, oddball chips, and lackluster output (multimedia experience). An LCD or serial port holds no excitement for me, not like seeing plasma fire or 3D hacks come to life.

This project is like my others, and just a personal goal for reasons that drive my eccentric mind!
If I had found a "3 chip 6502 computer" that could be made on a breadboard using commonly available parts, I would have been using the 6502 10 yeas ago when I first considered it. The ability to actually do something with sound and graphics would have been the hook for me. Mono LCD text or just a terminal... not so much.

But's that's just me!
Hell, I had more fun making "impossible" video on a 512 byte micro-controller than I has on any FPGA based project!...

https://www.youtube.com/watch?v=miefLPwZgOg

The chip in the above video shown doing the 184x240 VGA has only 512 Bytes of SRAM, and 4 IO Pins!

This is the kind of thing that gets me cranked... ultra minimal, strict constraints, and decent results.
Getting a 6502 and 2 chips on a breadboard to act like a C64 is right in my fun zone!

The 6502 will certainly have to do all the heavy lifting, so to make a decent graphics / sound demo, I will by upping my assembly game.
Sending "Hello World" down a serial port does not seem like the same challenge as playing music while a 3D cube morphs around the screen!

Anyhow, we are all hanging on here for bizarre personal reasons no doubt! Just like those over at the vinyl records or 57 Chevy forums!
I am going to make this 3 chip 6502 computer sing and dance, that's for sure!
If there is someone out there like me that wants to get started on a budget using common parts, then this might be of some use.
I am actually documenting all of my projects in much more detail, but life has been getting in the way of finish my new website.
This year seems to be looking different though.

Cheers!
Brad


Top
 Profile  
Reply with quote  
PostPosted: Mon Dec 26, 2016 6:29 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
Oneironaut wrote:
Anyhow, we are all hanging on here for bizarre personal reasons no doubt! Just like those over at the vinyl records or 57 Chevy forums!

I'm on an amateur-radio forum too, and was reminiscing about how those old cars had lots of room under the dashboard that was great for installing large radio equipment, instead of having it slope into a center console like modern cars have.

As for vinyl records, there are still places pressing them today. There's also a company planning to introduce a new model of professional analog tape recorder in 2017. I've done some repair work for a recording studio, and I remember the owner years ago wanting to get into digital recording, and he wanted to get a hard disc with a whole gigabyte of storage. That was a lot back then, and yet it doesn't seem very long ago. Now of course a couple of terabytes is common.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 70 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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: