6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Oct 06, 2024 11:23 pm

All times are UTC




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: 65C02 Halt and Resume
PostPosted: Thu Sep 16, 2021 8:07 pm 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
Hi All,

I have a film processor that is 65C02 based running at 1mhz.

I was wondering if its possible to halt a 65C02 and then resume it?
Hopefully picking up where it left off.

Could I just pull one leg of the resistor to RDY, add a switch to toggle between +5v (through the 3.3k) and GND?
Or would I need a buffer / Schmitt trigger / latch?

Some details of how the 65C02 is wired up.
The RDY pin is permanently pulled high via a 3.3k to +5v.
Phi 0 Pin 37 has the 1hmz oscillator.
Phi1 Pin 3 looks like its NC.
Phi2 Pin 39 heads off to some 7404s and a 74132 to the RW for the ram and to other boards/logic....

Thanks!
Ian


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 8:15 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
Welcome. Do you have control of the clock? All 65c02's can have the clock stopped without losing the internal state, although non-WDC ones can only stop with phase 2 high, while WDC's can stop in either phase.

_________________
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: Thu Sep 16, 2021 8:20 pm 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
GARTHWILSON wrote:
Welcome. Do you have control of the clock? All 65c02's can have the clock stopped without losing the internal state, although non-WDC ones can only stop with phase 2 high, while WDC's can stop in either phase.

Thanks! Btw, it’s a Rockwell 65C02P1, not the WDC variants.
The board is circa 1995 (probably designed around the late 80s).
Best I could do is remove the 1mhz oscillator module, put in on a daughter board of sorts and wire it back in.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 8:22 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10949
Location: England
Welcome photoman. Pulling RDY low should work, but you might need something more sophisticated than a switch: RDY needs to change in time with the system clock. A flip-flop or two might do it.

And of course Garth is right, stopping the clock (in a glitch-free way) is another option.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 8:29 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
The Rockwell R65C02's can be stopped with phase 2 high. I've done it several times, to single-cycle it for tests. Regardless of which way you go, you'll have to make sure you don't have glitches or runt pulses. (I wouldn't call the WDC one a "variant" though, since WDC designed the 65C02.)

_________________
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: Thu Sep 16, 2021 8:36 pm 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
GARTHWILSON wrote:
The Rockwell R65C02's can be stopped with phase 2 high. I've done it several times, to single-cycle it for tests. Regardless of which way you go, you'll have to make sure you don't have glitches or runt pulses. (I wouldn't call the WDC one a "variant" though, since WDC designed the 65C02.)

Thanks again! You're right, shouldn’t have called them that.

If I go the clock route, is it as simple as toggling the power to the oscillator or would the potential of a button bounce cause more problems?


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 8:56 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
If it's a crystal oscillator, it takes time to start up, which is part of the reason why the reset pulse given to the processor is so long. You'll need to keep it running, and use gates to either pass it on through to the system or block the signal and hold the system's clock line high. If you don't need the accuracy of a crystal, RC relaxation oscillators can start up immediately. I can't take the time right now to figure out a circuit for you; but if you want to run ideas past us, we can check them out and either confirm that it all looks good or make suggestions for fixes.

_________________
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: Thu Sep 16, 2021 9:46 pm 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
Hi Garth,

Thanks for all of your help!
The processor is timed so it needs the accuracy of the crystal oscillator.
My first thought is a 4016 or a 4066 analog/digital switch.
Input/Output 1 is the clock taken from the oscillator to the R65C02 Phi0.
I was also thinking since I need to hold the clock high, could I use another of the outputs to drive it +5v.
Then I would just need to debounce a button to turn on the 4016 control 1 and 2.


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 9:56 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1383
There is also the option of a standard clock oscillator with Pin1 as a control line. The oscillator keeps running, but you can use Pin 1 to disable (tri-state) the output. Using this with a latch of sorts can likely be a simple solution.

https://www.mouser.com/ProductDetail/CT ... kbvw%3D%3D

The "T" designation specifies the tri-state option.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Thu Sep 16, 2021 10:10 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8521
Location: Southern California
The CD4000 series logic is generally much too slow for this kind of work. 74xx4000 is much faster. You will still need a way to turn it off soon after the rising edge, so you don't get glitches like this one where it's getting turned off at random times and in this case right after the falling edge, a glitch that would crash the computer because it does not meet the minimum phase-2-low time:
Attachment:
clockswitchglitch.gif
clockswitchglitch.gif [ 1.62 KiB | Viewed 1337 times ]

_________________
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: Thu Sep 16, 2021 10:21 pm 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
I found the TI CD74HC4066E‎ or even better the HCT CD74HCT4066E. Those look like they have enough bandwidth.
Ill also pickup a few of floobydust's MXO45HST-3C-1M000000‎ 1mhz oscillators with an enable pin.
I can try both ways. I can just cut the power to the machine if it decides it wants to fly off in to low earth orbit.

This is all to see if it will actually turn the motor off so I can grab the film and run an off board process.
It might just keep everything running or it might not. I haven't been able to trace that far into the circuit or the programming.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 17, 2021 2:03 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Photoman wrote:
I found the TI CD74HC4066E‎ or even better the HCT CD74HCT4066E. Those look like they have enough bandwidth.
Ill also pickup a few of floobydust's MXO45HST-3C-1M000000‎ 1mhz oscillators with an enable pin.
I can try both ways.

I'd say your easiest option is to simply pull the RDY pin low. As noted, you will ideally need a flipflop to ensure RDY makes its transition cleanly and at an appropriate instant in the cycle. Maybe this precaution seems like more work, but your other two options will require a similar precaution to avoid runt pulses. And RDY has the advantage that it won't require use of a new oscillator or a 4066.

Quote:
This is all to see if it will actually turn the motor off so I can grab the film and run an off board process.
It might just keep everything running or it might not.
Is it a stepper motor, by chance? If so, I think you can expect it to stop when the CPU stops (because presumably it's the CPU that's generating the pulses for the steps). But if instead the CPU simply turns on or off a relay which supplies power to a more conventional motor then I think when the CPU stops you can expect the relay and the motor to remain stopped if they were stopped or to remain active if they were active.

-- Jeff

_________________
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: Fri Sep 17, 2021 2:11 am 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
Dr Jefyll wrote:
Photoman wrote:
I found the TI CD74HC4066E‎ or even better the HCT CD74HCT4066E. Those look like they have enough bandwidth.
Ill also pickup a few of floobydust's MXO45HST-3C-1M000000‎ 1mhz oscillators with an enable pin.
I can try both ways.

I'd say your easiest option is to simply pull the RDY pin low. As noted, you will ideally need a flipflop to ensure RDY makes its transition cleanly and at an appropriate instant in the cycle. Maybe this precaution seems like more work, but your other two options will require a similar precaution to avoid runt pulses. And RDY has the advantage that it won't require use of a new oscillator or a 4066.

Quote:
This is all to see if it will actually turn the motor off so I can grab the film and run an off board process.
It might just keep everything running or it might not.
Is it a stepper motor, by chance? If so, I think you can expect it to stop when the CPU stops (because presumably it's the CPU that's generating the pulses for the steps). But if instead the CPU simply turns on or off a relay which supplies power to a more conventional motor then I think when the CPU stops you can expect the relay and the motor to remain stopped if they were stopped or to remain active if they were active.

-- Jeff

Im putting an order in at digikey, do you have a recommendation for a flip flop that might work?

The motor is a DC motor and I kid you not its actually a windshield wiper motor from a BMW.
I don't know if its luck or just a great motor but its lasted over 20 years. Probably 10 times the use it would get in a car.
Speed is controlled by a Hall effect sensor and run off an H bridge.
The entire machine is pretty interesting, lots of car parts. The factory was a stone throw from a car parts plants...so wiper motor...coolant pumps...


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 17, 2021 2:56 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Photoman wrote:
Speed is controlled by a Hall effect sensor and run off an H bridge.
Hmm, and the motor is reversible, is that right? And is it the 65C02 that turns the H Bridge on and off? If so, then stopping the CPU will probably result in the motor going to zero or to 100%.

Probably in normal operation it constantly switches at high speed between 0 and 100%, effectively resulting in intermediate speeds between 0 and 100%. In other words, Pulse Width Modulation.

Photoman wrote:
This is all to see if it will actually turn the motor off so I can grab the film and run an off board process.
It seems to me we can predict the answer if we get some details about how the system works. But if you'd rather do an experiment then 74HC74 is one flipflop that'd be suitable.

-- Jeff

_________________
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: Fri Sep 17, 2021 3:54 am 
Offline

Joined: Thu Sep 16, 2021 3:38 am
Posts: 17
Location: NY
Dr Jefyll wrote:
Photoman wrote:
Speed is controlled by a Hall effect sensor and run off an H bridge.
Hmm, and the motor is reversible, is that right? And is it the 65C02 that turns the H Bridge on and off? If so, then stopping the CPU will probably result in the motor going to zero or to 100%.

Probably in normal operation it constantly switches at high speed between 0 and 100%, effectively resulting in intermediate speeds between 0 and 100%. In other words, Pulse Width Modulation.

Yup, the motor is reversible. It makes a few turns in one direction then reverses, does a few rotations and repeats.
It has selectable speeds from 25 RPM to 75 RPM. Everything is timed by entries in the user interface.
The R65C02 is the only processor in the machine. It also has 2 R65C22 VIA's hanging off the bus. Those go through a couple of connectors to a couple of boards that control the motors, temp sensors, Hall effect sensors...
It also has a battery backed sram. One day I would love to figure out how to back that up. Not a big deal, everything can be re entered with a 4 button keypad, just takes a long time.
There is also a power supply board that they put in the worst possible place, under the leaky bit! That board has the relays for the heater, fan and the regulators for all the DC rails.
Quote:
It seems to me we can predict the answer if we get some details about how the system works. But if you'd rather do an experiment then 74HC74 is one flipflop that'd be suitable.

I do like experimenting! I figure whats the worst that can happen :wink: I have almost a dozen backup boards just in case.
Happy to answer any questions on it. I have some schematics (in German) and the binary from the ROM.

Overall it’s a great processor. A lot of the parts are or were COTS. The biggest problems have been mechanical and leaks (lots of leaks!).
The electronics haven't been an issue at all.

I put a bunch of the 74HC74's on my order. Thanks for the tip!


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 8 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: