6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Apr 25, 2024 8:25 pm

All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
PostPosted: Mon Mar 30, 2015 8:08 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8427
Location: Southern California
I'm watching this with interest, wanting to know what really happens. I have a 65c02 fixture for checking logic states at each half cycle, and I could modify it for an '816, but I can't take the time now. I have too much on my plate.

Terminology is causing some confusion here though. cr1901, note that pulling RDY low is just slow memory telling it, "Hold on-- I'm not ready yet. I need more time. Please hold the current state longer." So asserting it means pulling it up, meaning, "Ready! No need to delay further. I got the data out. Move on!" Pulling RDY down means negating it, not asserting 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: Mon Mar 30, 2015 8:49 pm 
Offline

Joined: Wed Feb 05, 2014 7:02 pm
Posts: 158
I wish WDC offered technical support for ambiguities in their datasheet. God knows enough of them accumulated over the years.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 30, 2015 8:54 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8427
Location: Southern California
WDC recommends this website and forum, but I wonder if anyone there reads it regularly. I doubt 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: Mon Mar 30, 2015 10:32 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 586
Location: Michigan, USA
GARTHWILSON wrote:
I'm watching this with interest, wanting to know what really happens. I have a 65c02 fixture for checking logic states at each half cycle, and I could modify it for an '816, but I can't take the time now. I have too much on my plate.

I wonder if my PIC based test jig was similar in function? Lacking an oscilloscope or logic analyzer, I hooked up the address lines, data lines, and control lines to the PIC and sampled the various signals at 62.5-nsec intervals during each half clock cycle. Collected data was dumped to Hyperterminal over the PIC serial port. The information gained from those tests would lead to a method that allows the PIC to push/pull instructions and data to/from the 65C02 over the data buss for the "blind loader" in my little three chip pocket computer. I can't imagine why you couldn't do something similar on a 65C816.

Regards, Mike


Last edited by Michael on Mon Mar 30, 2015 11:18 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 30, 2015 10:47 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8427
Location: Southern California
Michael wrote:
I wonder if my PIC based test jig was similar in function.

I made mine to work with my 6502 workbench computer. Rather than trying to catch data while the processor is running at speed in its own system, it interfaces to only the processor and makes the processor think it's in a computer system while really it's all being faked, and it's slowed down so the workbench computer executes many, many instructions (potentially thousands) for each half cycle of the processor being tested. The workbench computer decides when to give it the next clock edge, pull down or release IRQ\, NMI\, RST\, RDY, etc.. The status of every signal pin is printed for every half cycle. Obviously it would need a CMOS processor that won't lose info if stopped. I did it years ago to check details that weren't in the data sheet.

_________________
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: Tue Mar 31, 2015 1:43 am 
Offline

Joined: Wed Feb 05, 2014 7:02 pm
Posts: 158
A small diversion:

chessdodger... In light of Joachim's computer using only discrete components, I may cave and buy a PLD, since the motivation to do pure discrete components has faded a bit. What type of programmer do you use, and was it expensive (triple digits or more)? I just in general cannot justify the cost of a programmer, and unlike for microcontrollers, the protocols to program them, and CPLDs aren't really documented.

As FPGAs and microcontrollers are often reprogrammed/bootstrapped, these protocols are better documented (usually a variant on SPI/start-stop or some sort).


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 2:08 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3346
Location: Ontario, Canada
I wrote:
The text fails to be explicit on this point.
cr1901 wrote:
Page 53 of WDC's current datasheet (Caveats):
7.6 DB/BA operation when RDY is Pulled Low
When RDY is low, the Data Bus is held in the data transfer state (i.e. PHI2 high). The Bank address
external transparent latch should be latched on the rising edge of the PHI2 clock.
Thanks -- I overlooked that. Posting too close to bedtime, I guess. But the caveat seems more contradictory than clarifying.

Quote:
ARGH!
Yes, exactly! :)
GARTHWILSON wrote:
I have a 65c02 fixture for checking logic states at each half cycle
Straight from the horse's mouth, eh? I'd much rather have experimental data, since the datasheet is so murky.

The test fixture sounds ideal, but dedicated hardware isn't necessary in this case. Anyone who has an '816 running in an existing machine could run the experiment. It'd be easiest if the RDY pin is presently unused. Jumper it to an output taken from a pin on your 6522/whatever, then run code that pulls the 6522 pin low. The resulting wait-states repeat forever, so you can examine the waveforms at your leisure. :D

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Tue Mar 31, 2015 2:10 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 2:09 am 
Offline
User avatar

Joined: Fri Mar 13, 2015 3:29 am
Posts: 23
cr1901 wrote:
A small diversion:

chessdodger... In light of Joachim's computer using only discrete components, I may cave and buy a PLD, since the motivation to do pure discrete components has faded a bit. What type of programmer do you use, and was it expensive (triple digits or more)? I just in general cannot justify the cost of a programmer, and unlike for microcontrollers, the protocols to program them, and CPLDs aren't really documented.

As FPGAs and microcontrollers are often reprogrammed/bootstrapped, these protocols are better documented (usually a variant on SPI/start-stop or some sort).



Hi

I have both of these programmers ..G540 and wellon vp290 .. can get both from china .. I got the vp290 from darkwire
http://www.darkwire.com.au/html/device_programmers.html

G540 is cheaper $70's Au..should program plds ..found VP290 much better but about $170 or so ..
I know that VP does work with atmel 24pin din chips .. so if you can spare the money go for them ..although I know some other people have used the g540 ..however they used the lattice chips which I think require different type of compiler software.

Pld software like wincupl is not the easiest ..but once you get the idea there is not much to them.

Anyway if you ever need a hand in future ..let us know ..happy to help ..

I usually post the pld files on the website ..so you can see the code .. and from that it is not that much different if you require to say alter the address range .. and make up your own ...etc

mike


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 31, 2015 3:17 am 
Offline

Joined: Wed Feb 05, 2014 7:02 pm
Posts: 158
Ty for chessdoger... I may take you up on that :P.

In any case, I hope someone with a '816 design can test. I really do not have provisions to test a prototype circuit, and until I can figure out what the behavior is, the project is once again at a standstill.

The devil is in the details with this chip. Designs with '816 are moderately more involved than an equivalent '02 design- and yet I still underestimated the difficulty (there are other issues re: the datasheet that I wish to discuss later) :P.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 05, 2015 5:00 am 
Offline

Joined: Wed Feb 05, 2014 7:02 pm
Posts: 158
I created a circuit that attaches to the GPIO/I2C bus of my Raspberry Pi that probes the bus of the 65816, making sure to switch bus direction between PHI2 low and PHI2 high. There IS bus contention in my circuit for a short period when the bus switches from read data back to write bank, but so far I haven't had any issues doing probing with my setup.

Control signals PHI2, RDY, RWB, VDA, VPA, and RESB are attached to the Raspberry Pi GPIO port.
The bank/data bus is connected to PCF8574 I2C I/O expander. It has push-pull output (whatever that means), and output is as simple as writing the required value to the device. Input is implemented by writing a logic 1 to each pin for the I/O device. It's up to other devices, in this case the Bank/Data bus, to drive the bus when the I/O expander is in input mode. I only switch the I/O expander's direction to output (CPU read) when PHI2==1 and RWB==1, and switch it back to input when PHI2==0.

I wrote a program on my Raspberry Pi to monitor the data bus and control signals, toggling the PHI2 GPIO to simulate single-stepping to probe the bus. My Pi runs NetBSD (that's a discussion for another time), so unless some of you use that instead of Linux, my program isn't exactly ready to be used by others who want to experiment :P. Therefore, I'll hold off on the circuit diagram/source code for now.


The answer to my question conclusively: The 65816 does NOT drive the bank address while RDY is low. Therefore, there must be some means to prevent a new garbage bank address from accidentally being latched. The big hint for me is that the I/O expander sees the value 0xFF when RDY==0 and PHI2==0. This indicates the bus is not being driven, so the I/O expander goes into pullup mode (or whatever the equivalent is for push-pull).

If RDY is driven low during PHI2 high, the '816 will NOT drive a bank address onto the bus during the next PHI2 low.

If RDY is driven low during PHI2 low, a read during PHI2 high will occur as normal, and during the same situation as above applies. Have not tested writes yet.

If RDY is driven high during PHI2 high, the '816 WILL drive a new address onto the bank bus during the next cycle. Obviously, the I/O device better in fact be ready, and have some breathing room to satisfy setup time. Otherwise it is probably best to drive RDY high while PHI2 is low.

If RDY is driven high during PHI2 low, a read during PHI2 high will occur as normal, and the '816 WILL drive a new address onto the bank bus during the next cycle.

Here is some sample output. RDY changes directions before PHI2 is toggled on any line with an 'r':
Code:
PHI2 0, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: 0

PHI2 1, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: E8

PHI2 0, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: 0

PHI2 1, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: E8

PHI2 0, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: 0

PHI2 1, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: E8

PHI2 0, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: 0

PHI2 1, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: E8
r
PHI2 0, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 0, Bank/Data bus: FF
PHI2 1, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 0, Bank/Data bus: E8
r
PHI2 0, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: 0
PHI2 1, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: E8

PHI2 0, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: 0
r
PHI2 1, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 0, Bank/Data bus: E8
PHI2 0, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 0, Bank/Data bus: FF
r
PHI2 1, RESB 1, RWB 1, VDA 0, VPA 0, RDY: 1, Bank/Data bus: E8
PHI2 0, RESB 1, RWB 1, VDA 1, VPA 1, RDY: 1, Bank/Data bus: 0



Something else is bothering me about my setup however... according to what I'm seeing from my program, NOP is in fact 4 cycles on the '816, not 2! o.0; And I don't think it's an error either, b/c other Implied address mode instructions, such as INX (see above- 0xE8), are 2 cycles in length. Something's very wrong... or something very interesting is happening.

EDIT: Ignore the above paragraph- I miswired/swapped D2 and D1... so 0xEA (NOP) was in fact 0xEC (CPX absolute) XD. Taking that into account, the behavior I saw (4 cycles, emulation mode) makes sense. Above results are not affected since D2==D1==0 in 0xE8.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 05, 2015 9:23 am 
Online
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10793
Location: England
Thanks for doing the experiment and letting us know!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 06, 2015 2:08 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3346
Location: Ontario, Canada
BigEd wrote:
Thanks for doing the experiment and letting us know!
Yes, indeed -- thanks, cr1901! Good to have the doubt removed.

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 07, 2015 8:10 am 
Offline

Joined: Wed Feb 05, 2014 7:02 pm
Posts: 158
BDD's solution will work for fixing RST, but I'm trying to determine whether I can't reduce the prop-delay from his implementation to keep 14MHz operation with discrete components.

Thinking about buying a GAL programmer. I'd like to do a design without using GALs, but again, since Joachim's design of his first SBC proves 14MHz operation is possible with 74xx glue logic, I feel less obligated to do that now.

Additionally, fun fact: I do not have the funds for an EPROM programmer either. If it weren't for a generous donation from a professor back in 2011 (Needham's PB-10 ISA card- currently in my 286), I wouldn't have an EEPROM programmer, and would have to find some makeshift solution to program EEPROMs or something. Making my own GAL programmer doesn't seem all that appealing either.

If I decide to go this route for the time being, would someone be willing to program a few GALs for me if I give them a design (chessdoger... I live in the US, so I'm not sure how much it would cost to mail a letter or manila envelope with GALs inside)? Payment is offered for your trouble/reduced stock :P.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 07, 2015 1:25 pm 
Offline

Joined: Sun Jul 28, 2013 12:59 am
Posts: 235
cr1901 wrote:
Thinking about buying a GAL programmer. I'd like to do a design without using GALs, but again, since Joachim's design of his first SBC proves 14MHz operation is possible with 74xx glue logic, I feel less obligated to do that now.

Note that Joachim's design uses 74F logic, which is old, power-hungry, and fast. As in, worst-case prop times lower than ACT, and power usage measured in mA rather than uA.


Top
 Profile  
Reply with quote  
PostPosted: Tue Apr 07, 2015 3:34 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8143
Location: Midwestern USA
cr1901 wrote:
BDD's solution will work for fixing RST, but I'm trying to determine whether I can't reduce the prop-delay from his implementation to keep 14MHz operation with discrete components.

:?: :?: :?:

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


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

All times are UTC


Who is online

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