New to Arduino so learning as much as I can. I got one on the back of watching Ben Eater's (excellent) YouTube series on wrangling 6502 processors. He uses an Arduino to watch what the processor is doing step-by-step.
I'd like to use mine to watch what my old Apple 2 is doing. It doesn't work, and I'd like to go back to basics and find out why!
Ben's video's show the Arduino watching the processor's Address and Data lines with him either manually ticking the clock over or it operating verrrrry slowly. Arduino is able to keep up no problem. He's just watching for 1's and 0's on the lines and spitting the output straight out to the serial port/console.
This is all fine and lovely.
I have two questions. First, will my Arduino be able to keep up with my 1Mhz Apple 2? I have a Mega 2560 rev 3. Second, assuming the Arduino itself can sample at that rate, will the serial port be able to spit the results out quick enough? At a minimum, I'd just need the raw 1's and 0's of 24 D+A lines plus 3 or 4 other signals -- so I guess not more than 32 bits per cycle.
Welcome! While you've provided an excellent overview description of what you want to do, it's lacking a lot of detail. Very few helpers around here will go off and view a collection of Youtube videos in order to figure out the core of your project, for example, so you need to 'splain a lot more.
What Arduino did he use? (gives us info about it's speed, etc.)
What Arduino are you using? (ditto)
What's your background? Tells us how big the struggle to communicate might get. There's a world of difference between crossing a 'Persian Gulf', and a 'sidewalk crack'.
That's just a start.
(I coded on those old micros, by the way, so I have a very good understanding of what you might need to do)
For the price and value, you simply cannot beat these cheap 8 channel logic analyzers, and the free PulseView software. They are available at nearly every electronics seller on the web.
Hi - thanks. Alright, point taken on the cheapy analysers. I'll look into those. Guess I need three to monitor 24 bits worth of data?
In his videos Ben is essentially just building a home-brew 6502 based computer and using an Arduino Mega (it's all he says) to monitor the 1's and 0's on the data and address lines of the process. He's attaching those lines plus the clock to the digital inputs on his Arduino. The code he wrote looks for a raising signal on the clock, then takes a reading of the digital pins, printing the results to the serial port. In essence, pretty simple and works well for his project. The clock cycle in his project runs really slowly though. My question is, will my Arduino Mega 2560 r3 be able to do the same at 1Mhz. Can it take a million samples a second and display the results.
My old Apple 2 is not showing anything on screen when it boots up. I can scope various lines of the processor, memory etc and see 'activity'. What I want to do is look at what the processor is doing om it's address and data lines when it is reset. Is it going to the correct reset vector? Is it receiving sensible data? Basically just going down to the nuts and bolts of what should happen when one of these relatively simple old computers is switched on, and trying to isolate where the fault might be.
It mostly depends on the minimum clock of the 6502. Synchronizing three 8-bit analyzers is a hard task, also depending on how many PC you need because the analyzer software possibly can be run only once.
With a Mega 24 bits can be read in 3 cycles from 3 ports. Output on a serial line will require about 30 cycles of 8 MHz or longer. The same for the PC that has to receive and store those bytes. But the Mega also has an external parallel memory interface, so that storing 3 bytes in external RAM may be accomplished within 1 µs.
A faster controller can do more if sufficient input lines can be implemented using parallel buffers. Then a RasPi with much internal memory and fast graphics may be a good choice.
Such a limited code section can be stored in (enough) internal RAM and then displayed or transmitted to another computer. In fact the display will cover only a certain time span, showing life data at processor clock speed does not make sense to humans. That's why logic analyzers are almost bound to monitor transmission lines with only few bytes per transmission.
Finally the bytes can be stored directly in big enough RAM at any clock rate, with only a few additional chips for an address counter and control logic. Nowadays fast RAM may allow for interleaved read/write cycles so that the presentation of the collected data is possible while collecting.
No. It does not have enough memory or the speed to do anything remotely near that.
Guess I need three to monitor 24 bits worth of data?
I doubt you need to monitor more than half dozen to figure out what is wrong with your Apple, if at all. A logic analyzer won't tell you if the read only memory is corrupted, for example.