6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon Jun 03, 2024 10:30 pm

All times are UTC




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Wed Oct 09, 2019 3:24 am 
Offline

Joined: Wed Oct 09, 2019 3:12 am
Posts: 5
Super-newb here. Been devouring anything I can 6502 related. Really want to build a simple Homebrew for all the usual reasons. I would like to eventually expand the computer so it has a built in "display" created from LED matrices. Initially just an 8x8 multiplexed with a MAX7219 or similar. I would like this display to have two properties:

1) it displays a portion of memory. If a byte of memory that it's displaying changes, that change is reflected on the display immediately.

2) The portion of memory being displayed can be changed so that any address range can be displayed.

I'm.wonderingif anyone has run into similar projects, or might point me in the right direction.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 3:58 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8453
Location: Southern California
With the eye's response being so slow compared to the computer speed, you could feed the LED matrix in an interrupt-service routine (ISR), on a timer that interrupts every 10ms or something like that.

Welcome. Since you're new here, let me recommend the 6502 primer which has virtually every aspect of building your own basic (or even not-so-basic) 6502 computer, in 22 sections.

_________________
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: Wed Oct 09, 2019 11:48 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10821
Location: England
Welcome! To add, if I can, to Garth's good points... what you propose is something like a front panel, but more so. It's quite complex, and as such, possibly an ideal job for a computer to do! In effect, Garth is saying the same - use an interrupt service routine to update the display. As it mostly makes sense to view memory when the CPU is stopped or is running very slowly, you might write a monitor program which can single-step your main program and update the display each time.

Or, you could decouple the 6502 design from the front panel, and use a second CPU to drive the display - it would be common these days to use an Arduino or a microcontroller, and to write that display update program in C or similar. Or you could use a second 6502... but in this case you'd need to arrange that the second CPU can view the memory of the main system, or snoop the bus of the main system.

If you do away with the idea of a multiplexed display with a smart driver, maybe it's not too hard to hook up an 8 bit latch to the databus and use that to drive 8 LEDs. The latch is enabled by an address decoder, and you'd need some interface to adjust the address decoder. Perhaps use an 8 bit magnitude comparator? If you can do that once, you can do it 8 times to give yourself the 8 byte window you mentioned. The insight here is that you can make an 8 bit output port very simply, and it's OK if the output port is mapped to a location which is also mapped to another device, such as RAM, ROM, or a peripheral.


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 1:11 pm 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1395
Reminds me to whygee's DYPLED module for displaying what's on a 16 Bit bus...


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 1:59 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1003
Location: Canada
If you just wanted a matrix of 64 LEDs (8x8) then 8 74xx164 serial to parallel shift registers is probably the easiest way to do it (software wise). It would appear to the CPU as a single-byte output port. 8 consecutive writes would completely refresh the display. As others have noted this could be accomplished via an interrupt routine or on demand.

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 5:58 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8453
Location: Southern California
jedSavage wrote:
Super-newb here.

Without knowing how "super-newb" you mean, since we've been recommending doing it on interrupts, I could also recommend the 6502 interrupts primer. (And enjoy my very outdated cartoons! :lol: )

_________________
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: Wed Oct 09, 2019 8:00 pm 
Offline

Joined: Wed Oct 09, 2019 3:12 am
Posts: 5
Thanks for all the replies. My initial desire for this display was to be able to examine memory without relying on the computer to manage display, so I was hoping to implement this in a way that runs separately from the 6502 and pulls the led data from the same memory that the computer is using - though I'm not sure how to do that without colliding data on the buses...


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 8:11 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8453
Location: Southern California
jedSavage wrote:
Thanks for all the replies. My initial desire for this display was to be able to examine memory without relying on the computer to manage display, so I was hoping to implement this in a way that runs separately from the 6502 and pulls the led data from the same memory that the computer is using - though I'm not sure how to do that without colliding data on the buses...

The Apple II and maybe a few other computers had the video accessing the memory while the processor's phase 2 was low. You could also use dual-port memory, although it's rare, small, and expensive.

_________________
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: Wed Oct 09, 2019 8:22 pm 
Offline

Joined: Wed Oct 09, 2019 3:12 am
Posts: 5
GARTHWILSON wrote:
The Apple II and maybe a few other computers had the video accessing the memory while the processor's phase 2 was low. You could also use dual-port memory, although it's rare, small, and expensive.


Ah, that makes sense. Hmm, so if I just invert the clock signal for a second processor to handle the matrix? How important would timing be for something like that? I was planning on 1 mhz for the 6502. 6502 does all of it's read/write in φ2 high?


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2019 10:08 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8453
Location: Southern California
As usual, you'll have to study the timing diagrams and charts. Many newbies seem to treat these like "fine print" that's not necessary to pay attention to, and then they wind up with problems that are hard to troubleshoot. Some ICs like the 6522 VIA and 6551 ACIA which have their own phase-2 input require that the chip-select, register-select, and R/W lines be valid and stable some amount of setup time before the rise of phase 2, while the other circuit is accessing the bus at a different address. Other things—notoriously RAM—will need a way to make sure you don't have both their CS\ and WE\ inputs true before the new address is valid and stable, a condition which can cause writes to unintended addresses, corrupting data. Your circuit will have to prevent this problem. IOW, it gets more complicated than just inverting the clock. I haven't done it myself, but I can imagine a clock system where there's some time where neither half's phase-2 signal is high, ie, that they're both low for a period in between times that one and then the other are high. Tri-state buffers would probably have to be part of it.

_________________
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: Wed May 18, 2022 12:36 pm 
Offline
User avatar

Joined: Tue Jul 17, 2018 9:58 am
Posts: 104
Location: Long Island, NY
You could manage an 8-byte snooping window with a handful of logic chips, though as has been suggested an Arduino-based snooper would probably be both easier and more scalable.

The simplest thing would be to only snoop the bus writes, in which case each of the eight bytes displayed wouldn't update until written to after boot or after moving the window.
You could add some additional LEDs though to mark which of your bytes are currently valid.

I find the logic chip approach to be a fun exercise though, so here's a few that you could use for this:

  • 74x521 Identity comparator
    Using a couple of these you'd match on all but the three lowest bits of the address bus to generate a chip-select for your register.
  • 74x138 Decoder
    This is what you'd use for the lowest three bits of the address bus to select which of your 8 bytes is being written to.
  • 74x573 8-bit Latch
    Eight of these will store the bits that your LEDs show.
  • 74x259 Addressable 8-bit Latch
    If you do use an additional LED per byte to indicate the validity of each byte, this would be convenient for storing that flag.
  • DIP Switches
    Not a chip, but you'd need some way to specify the higher address bits that position your viewing window. Though you could also use another 74x573 and control it from your computer directly.

As for connecting the LEDs, you *could* wire them up to the outputs of the 573's but it would be a LOT of wires/traces. Multiplexing the LED matrix would be a good idea here. You'd use another 138 decoder, a counter (74x161 or 74x163 for instance), a multiplexing switch like a CD4051, and some clock source like a 555 timer circuit to rapidly cycle which row is being lit.


If you wanted to show more than 8 bytes you could connect fewer of the address bus bits to the identity comparator and use bigger decoders, more 573's. That gets pretty expensive and unwieldy fast though.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC


Who is online

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