jac_goudsmit wrote:
Michael wrote:
Wouldn't that require an additional pin to control the R/W line on the RAM?
Yes. In my system, the Propeller (not the 6502) controls the !OE and !WE lines of the RAM chip so I can write to the RAM even when R/W is high and I can access the RAM even when Phi2 is low. I see now that with your schematic, this is not an option, and I understand how you don't want to make that change to the code and the schematic. It would actually take two extra pins by the way: one extra pin for the RAM chip and one pin to pull NMI down on the 6502.
Perhaps this is a good example of different design philosophies for similar goals?
My goal was to eliminate ROM in favor of RAM, which requires a method for initially loading RAM, while keeping the number of I/O pins required to support that method to a minimum. I found that if I control the reset and clock lines (3 pins), and if I can push instructions to the R65C02 (8 pins) while controlling the decoder (0 pins), that tasking the R65C02 to load RAM works quite well.
My design philosophy/strategy is; simplicity, elegance, and performance. I use a very limited set of capabilities and features on the PIC to complement the R65C02 while leaving the R65C02 in control rather than the other way around.
Why take control of the R/W pin away from the R65C02 when I can task the R65C02 to perform the operations I need? In this case, I'm simply loading RAM after a reset. This isn't a time critical task and it's difficult for me to justify the resources required to support some other unnecessarily exotic method. It's also worth noting that taking control of the R/W pin implies additional overhead during each 6502 cycle which would impact performance in the main loop and it might become difficult to maintain a 1-MHz clock for the R65C02.
Quote:
Quote:
That's an interesting approach. Are there times when you need to read/write RAM other than during start-up?
I was inspired by Dennis Ferron's Prop-6502 to use this method, and he used the Reset line because why not -- after all the Propeller is going through an initialization sequence already anyway so might as well make the download part of the reset sequence.
I agree that the reset button plays a key role in all our designs and it's the perfect point at which to load RAM. It's also the point where I offer the user the option to enter the PIC "supervisor" instead of auto-booting into the R65C02.
While the PIC "supervisor" is meant to provide a convenient method for uploading a new "decoder map" or ROM image files into flash memory and for selecting a default PIC I/O method, an enhanced version of the "supervisor" for an "educational" or "starter" SBC might include a mini assembler, a dis-assembler, a memory dump command, and single-step with register view/edit capabilities. None of these capabilities would require code in R65C02 RAM, nor would they require the use of the R65C02 NMI pin since we have the capability to push any series of instructions to the R65C02 that we want. For example, use one series of instructions to preserve registers and grab the pc, use another series to read or write a memory location, use another series to restore registers and the pc, use another series to execute a single instruction, use another series to update the LED, LCD, or serial display and perhaps poll a keypad. The possibilities are endless and I had a lot of fun experimenting with many of these capabilities early in the development cycle. Combining them into a comprehensive, cohesive, intuitive, aesthetically pleasing, and just plain useful user interface/experience however will be a challenge.
Quote:
So even if, for now, I can't think of a compelling reason to access the RAM using NMI instead of RESET, the advantages in my case are pretty clear.
Sounds great. At the risk of sounding patronizing, I think you've done extremely well with the limited number of pins you have to work with on the Propeller. Keep up the good work.
Take care. Regards, Mike