POC Computer Version One
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
BTW, some of the posted WDC data sheets are out of date.
x86? We ain't got no x86. We don't NEED no stinking x86!
BigDumbDinosaur wrote:
dclxvi wrote:
Unlike non-writing instructions (LDA, AND, CMP, etc.), STA abs,X always takes 5 cycles whether it crosses a page boundary or not.
If memory serves, the Apple II 5.25" floppy driver actually depended on STA abs,X taking 5 cycles when a page boundary wasn't crossed.
dclxvi wrote:
See note 4, table 5.7 (addressing mode 6a, cycle 3a).
BDD was evidently looking only at table 3-1, the summary table.
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
BigEd wrote:
BDD was evidently looking only at table 3-1, the summary table.
4. Add 1 cycle for indexing across page boundaries, or write, or X=0. When X=1 or in the emulation mode, this cycle contains invalid addresses.
Note the comment about invalid addresses. That was what was screwing up my writes to the DUART with STA $ABS,X. After I changed the logic to qualify device selection with VDA and VPA, it worked without a hitch. Currently, I'm running the '816 in 'C02 mode.
x86? We ain't got no x86. We don't NEED no stinking x86!
BigDumbDinosaur wrote:
Note the comment about invalid addresses.
- - change the logic to avoid accessing on the dead cycle
- change the clocking so the back-to-back accesses were not a problem
- index from the previous page so the unwanted access does not select the peripheral
- avoid indexed accesses to sensitive periperals
While VPA and VDA can be very useful especially in a sophisticated system, I'm anxious that the beginner can have confidence in making a simple system without worrying about them.
Cheers
Ed
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
BigEd wrote:
BigDumbDinosaur wrote:
Note the comment about invalid addresses.
- - change the logic to avoid accessing on the dead cycle
- change the clocking so the back-to-back accesses were not a problem
- index from the previous page so the unwanted access does not select the peripheral
- avoid indexed accesses to sensitive periperals
What was interesting was that while the DUART was clearly unhappy with the address bus diddling that was going on during the intermediate cycles of the STA $ABS,X operation, the watchdog apparently wasn't in the least perturbed. Be that as it may, my patch affects the 74AC138 decoder, which assures that neither watchdog or DUART will be selected until A0-A15 are stable.
Quote:
For future adventurers, it's useful to know that these choices are available. Sometimes the software fix will be preferable, sometimes the hardware fix.
While VPA and VDA can be very useful especially in a sophisticated system, I'm anxious that the beginner can have confidence in making a simple system without worrying about them.
While VPA and VDA can be very useful especially in a sophisticated system, I'm anxious that the beginner can have confidence in making a simple system without worrying about them.
Code: Select all
valid_data_memory = VDA & !VPAMonkeying with the clocking would actually be more complicated—more silicon would be needed, and would exact a performance penalty, not to mention possibly raising issues with hardware timers driven by Ø2. Also, any software workaround, e.g., indexing from the previous page, would make for possibly obtuse code. STA DEVICE,X makes more sense to the casual reader than STA DEVICE-1,X with .X adjusted to deal with the address shift. Also, that approach wouldn't be practical with software that accesses I/O hardware via STA ($ZP,X).
As for avoiding device access with STA $ABS,X, that would be okay if only a few registers needed to be set up or if the device had only one channel. If more than a few registers have to be configured, however, the resulting linear code would be wasteful and harder to maintain. It gets even more onerous if the device has multiple channels. For example, the NXP 2682B octal ACIA has four times as many registers to configure as the DUART I'm using in my design. Done in linear code, it would stretch for several pages and would be a nightmare to organize. Organizing the registers and associated parameters into data tables makes more sense but requires the use of some kind of indexing to select the correct device registers.
My opinion is, since WDC provides the VDA and VPA outputs to tell the system when the MPU is ready to access hardware, those outputs should be used.
x86? We ain't got no x86. We don't NEED no stinking x86!
- Mike Naberezny
- Site Admin
- Posts: 293
- Joined: 30 Aug 2002
- Location: Northern California
- Contact:
BigDumbDinosaur wrote:
BTW, some of the posted WDC data sheets are out of date.
Thanks,
Mike
- Mike Naberezny (mike@naberezny.com) http://6502.org
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Mike Naberezny wrote:
BigDumbDinosaur wrote:
BTW, some of the posted WDC data sheets are out of date.
Thanks,
Mike
W65C816S
W65C134S
W65C256S
Note that the PDF posted at WDC for the 'C02 says January 14, 2009 on the title page. The copyright notice, however, is dated 1981-2010. I notified WDC about the discrepancy.
x86? We ain't got no x86. We don't NEED no stinking x86!
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
kc5tja wrote:
WDC is not known for their literary or technical writing expertise, that's for sure. I remember, back when playing around with my Kestrel-1 project, having numerous errors in their documentation. Lord knows, I probably could have written a superior set of timing diagrams in my sleep.
Speaking of documentation, the programming manual WDC has posted on-line is way out of date and a typographical mess. One of my little projects for slow days is a complete edit of the manual, mostly to get rid of NMOS 6502 references, as well as fix code examples that are out of compliance with WDC assembler syntax. Following that, I'll re-typeset it so it doesn't look like something from Microsoft Word. Dunno when it'll get done, as doing secretarial work isn't my favorite thing.
x86? We ain't got no x86. We don't NEED no stinking x86!
I can't imagine spending one day per page is any great burden; if that path were taken, you'd probably be able to estimate its completion at about two years hence.
But, I hear you. I've thought of doing the same thing, even taking the one-day-per-page approach, and nothing as of yet has come from it. Heck, I still haven't finished the core OS (Forth, allegedly one of the simplest of languages and environments to get working, still eludes me for reasons unknown to me. Bizarre, since I have written an x86 Forth implementation once before) of the Kestrel-2 design (although I do have a crude software emulator written for Linux for it).
But, I hear you. I've thought of doing the same thing, even taking the one-day-per-page approach, and nothing as of yet has come from it. Heck, I still haven't finished the core OS (Forth, allegedly one of the simplest of languages and environments to get working, still eludes me for reasons unknown to me. Bizarre, since I have written an x86 Forth implementation once before) of the Kestrel-2 design (although I do have a crude software emulator written for Linux for it).
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
kc5tja wrote:
I can't imagine spending one day per page is any great burden; if that path were taken, you'd probably be able to estimate its completion at about two years hence.
But, I hear you. I've thought of doing the same thing, even taking the one-day-per-page approach, and nothing as of yet has come from it. Heck, I still haven't finished the core OS (Forth, allegedly one of the simplest of languages and environments to get working, still eludes me for reasons unknown to me. Bizarre, since I have written an x86 Forth implementation once before) of the Kestrel-2 design (although I do have a crude software emulator written for Linux for it).
But, I hear you. I've thought of doing the same thing, even taking the one-day-per-page approach, and nothing as of yet has come from it. Heck, I still haven't finished the core OS (Forth, allegedly one of the simplest of languages and environments to get working, still eludes me for reasons unknown to me. Bizarre, since I have written an x86 Forth implementation once before) of the Kestrel-2 design (although I do have a crude software emulator written for Linux for it).
I'm almost 65 and have several active projects to (hopefully) keep me going for a while. The POC is one of them, my large-scale locomotive is another. Between the two of them, I should have plenty to do as I start to scale back on income-producing work. I'm a bit ahead of schedule on the scaling back, thanks to having been attacked by Pac-Man.
x86? We ain't got no x86. We don't NEED no stinking x86!
I have updated the 65C816 datasheet errata page on the wiki:
http://6502org.wikidot.com/errata-datasheets-w65c816s
While I was at it, I created a 65C02 datasheet errata page:
http://6502org.wikidot.com/errata-datasheets-w65c02s
http://6502org.wikidot.com/errata-datasheets-w65c816s
While I was at it, I created a 65C02 datasheet errata page:
http://6502org.wikidot.com/errata-datasheets-w65c02s
-
Nightmaretony
- In Memoriam
- Posts: 618
- Joined: 27 Jun 2003
- Location: Meadowbrook
- Contact:
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Nightmaretony wrote:
Hopefully, WDC can be kept appraised of the errata wiki in order to update their data sheets.
x86? We ain't got no x86. We don't NEED no stinking x86!