6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 9:00 pm

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue May 26, 2020 7:30 pm 
Offline

Joined: Mon May 25, 2020 11:05 pm
Posts: 1
Hi,

I'm wondering what happens with W65C02 when BE is low.
Does the microprocessor preserve the status of its registers so that execution can be reasumed when BE is put back to HIGH ?

I have one W65C02 free spinning with data bus connected to NOP (EA) and a pushbutton to control the state of BE.
For what I have observed, it seems that the micro preserves its state if clock is stopped, but otherwise it keeps advancing the execution (but with the adress bus in high impedance) and reading NOP instructions in my setup.
In a realistic configuration, it would probably read random instructions from memory.

So, if I want to write on the memory with an external device and then reassume execution, I also have to stop the clock. Is it so ?

Thanks !!


Top
 Profile  
Reply with quote  
PostPosted: Tue May 26, 2020 7:52 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
Agrimensor wrote:
Hi,

I'm wondering what happens with W65C02 when BE is low.
Does the microprocessor preserve the status of its registers so that execution can be reasumed when BE is put back to HIGH ?

I have one W65C02 free spinning with data bus connected to NOP (EA) and a pushbutton to control the state of BE.
For what I have observed, it seems that the micro preserves its state if clock is stopped, but otherwise it keeps advancing the execution (but with the adress bus in high impedance) and reading NOP instructions in my setup.
In a realistic configuration, it would probably read random instructions from memory.

So, if I want to write on the memory with an external device and then reassume execution, I also have to stop the clock. Is it so ?

Thanks !!


Quite simply; when you pull BE low, it tristates all 16 address bus lines and all 8 data bus lines.

And that's all.

R/W is not tristated, so you may wish to isolate that somehow. The clock doesn't stop, Rdy stays as it is.

So all it does is tristate the buses - this means that unless you have stopped it (stopped the clock or pulled Rdy low) then the 65C02 will read garbage and likely crash.

I use BE in my 6502/65816 designs, so I can have a block of shared RAM with another processor, but I also stop the CPU with a WAI instruction.

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Tue May 26, 2020 7:55 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
(welcome, Agrimensor... I was composing a reply but it would now be redundant!)


Top
 Profile  
Reply with quote  
PostPosted: Tue May 26, 2020 8:37 pm 
Offline

Joined: Fri Jan 25, 2019 2:29 pm
Posts: 193
Location: Madrid, Spain
Actually, RW is also tristated in wdc CPUs at least.


Top
 Profile  
Reply with quote  
PostPosted: Tue May 26, 2020 8:41 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
daniMolina wrote:
Actually, RW is also tristated in wdc CPUs at least.


Hm. It didn't seem like it in my initial testing however... (Not an issue for me as I feed it through a GAL to generate separate /Rd and /Wr signals that need separating from the ones coming from the other processor anyway)

Cheers,

-Gordon

_________________
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/


Top
 Profile  
Reply with quote  
PostPosted: Tue May 26, 2020 9:41 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
Put simply - BE takes the CPU off the bus, RDY lets you halt the CPU on a cycle by cycle basis. They are two separate functions on the 6502. If you mess it up, you can seriously confuse the CPU.

One use of BE that doesn't require halting the CPU is using the Phi1 phase of the bus cycle for DMA, for example to feed the video display. You won't see early micros using BE for this purpose, simply because early 6502s didn't have it; they had to insert multiplexers instead.


Top
 Profile  
Reply with quote  
PostPosted: Wed May 27, 2020 5:39 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8506
Location: Midwestern USA
drogon wrote:
R/W is not tristated, so you may wish to isolate that somehow.

RWB is tristated. That is stated on page 9 of the data sheet.

_________________
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  [ 7 posts ] 

All times are UTC


Who is online

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