6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun May 12, 2024 6:15 am

All times are UTC




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun May 13, 2018 1:35 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
Hi,

On my board I have RDY pulled high with a 3k3 resistor, RDY is also connected to a pin of my CPLD and nothing else.

What I've noticed is that the signal rises so slowly after being high-z'ed by the CPLD that the CPU is effectively halted completely.
Image
(RDY is top, PHI2 is bottom)

If I drive the signal high it works, but being a bi-directional signal this is not the best idea
Image

I'm just driving it with a simple flip-flop at the moment for testing, the VHDL is
Code:
rdy <= '0' WHEN (FF = '1') ELSE 'Z';

waitstate:
process (PHI2, reset)
begin
  if (reset = '0') then
    FF <= '0';
  elsif rising_edge(PHI2) then
    FF <= (NOT FF);
  end if;
end process;


Shouldn't the signal rise much faster? I've tried changing the turbo bit setting (fast/slow slew rate) but it didn't make a difference to this.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 2:55 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Looks like you have quite a large capacitance on this line, roughly 100pF which is 5 times higher than usual. Any idea why?
On the other hand lowering your pullup resistor to 1K should speedup the rise 3 times. That could be sufficient to have a "1" in time. And 1 K isn't too strong, but it would increase the overall power drain if you use RDY frequently.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 3:49 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
I'm not sure why there would be such high capacitance at all unless it's to do with the trace length + internal planes?, the trace length between the cpld and the CPU is not very long and this is on a 4 layer board with internal power/gnd planes

Here's a picture of the section of the board. note that while the trace continues above I cut the trace where marked and noticed no difference at all.


Attachments:
Capture.PNG
Capture.PNG [ 37.42 KiB | Viewed 4605 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 6:31 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
I assigned the RDY output of the CPLD to an unused pin to isolate whether there's some capacitance caused by the cpu or anything like that and even then same deal
Results with a 1K resistor below


Attachments:
DS1Z_QucikPrint5.png
DS1Z_QucikPrint5.png [ 34.68 KiB | Viewed 4597 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 11:10 am 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Well it looks a little better using 1K. Still your capacitance there seems to be unusually high. That short track between your CPLD and the CPU won't be the reason. Does the track runs further or is that red cross above pin 2 a cut?

You synthesize your signal relative to "rising_edge(PHI2)". This is very late as RDY is sampled with the falling edge of PHI2. You could win 100 ns if you release RDY into high Z at the falling_edge(PHI2).

Did you record the signal with inserted CPU or w/o ? The processor contains an "active pullup" which should help significantly.


Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 8:03 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8180
Location: Midwestern USA
In POC V2, I arranged so the CPLD would drive RDY high after the wait-state period had expired. Following that clock cycle, the CPLD goes to hi-Z, leaving only the 3.3K pullup resistor to hold RDY high.

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


Top
 Profile  
Reply with quote  
PostPosted: Sun May 13, 2018 8:05 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8180
Location: Midwestern USA
GaBuZoMeu wrote:
The processor contains an "active pullup" which should help significantly.

Not necessarily. WDC's MPUs no longer have the internal pullup.

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


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 2:26 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
GaBuZoMeu wrote:
Well it looks a little better using 1K. Still your capacitance there seems to be unusually high. That short track between your CPLD and the CPU won't be the reason. Does the track runs further or is that red cross above pin 2 a cut?

I cut the track where the red cross is to isolate it but it didn't make a difference
Quote:
Did you record the signal with inserted CPU or w/o ? The processor contains an "active pullup" which should help significantly.

This is both with/without the CPU inserted. as above I even assigned the RDY output to an unused pin of the CPLD and connected it only to a 3k3 pull-up resistor but the waveform was the same.
BigDumbDinosaur wrote:
In POC V2, I arranged so the CPLD would drive RDY high after the wait-state period had expired. Following that clock cycle, the CPLD goes to hi-Z, leaving only the 3.3K pullup resistor to hold RDY high.

This might be what I need to do, still I'm surprised at rise time and cannot understand why it's behaving like this. maybe a faulty CPLD? It's a TQFP part so I'm not exactly about to pull it off and replace it with another but I might breadboard another one to test I guess.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 12:44 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
Most likely the oscilloscope probe adds this mysterious large capacitance! Sorry, I didn't consider that.

Nevertheless, BDDs solution driving the pin for just one cycle (or even only 1/2 cycle) sounds very well. Then you may choose even a larger pullup R to save some current.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 1:24 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10800
Location: England
There's often a compensation set screw on a 'scope probe which you can adjust to null out the probe's own capacitance.
https://www.tiepie.com/en/fut/probe#Compensation


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 7:00 pm 
Offline
User avatar

Joined: Wed Mar 01, 2017 8:54 pm
Posts: 660
Location: North-Germany
I believe/assume LIV2 uses a 1:1 probe which would add pretty much C to this signal. Using 10:1 setting would most likely show there is no trouble at all :)


Top
 Profile  
Reply with quote  
PostPosted: Mon May 14, 2018 7:08 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8433
Location: Southern California
Yes; for nearly everything, you need to use the 10:1 setting on the oscilloscope probe.  In the 1:1 setting, the 'scope may only be good to a MHz or two, and the probe will produce a huge capacitive load.  Don't use the 1:1 setting except for very low-frequency things where you can't get enough sensitivity in the 10:1 position, like if you're watching a slow 5mV signal.

_________________
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 May 14, 2018 11:24 pm 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
GaBuZoMeu wrote:
I believe/assume LIV2 uses a 1:1 probe which would add pretty much C to this signal. Using 10:1 setting would most likely show there is no trouble at all :)


*facepalm* you were right! much better at 10x

The system still doesn't work properly unless I drive the signal high rather than high-z but I'm glad to have figured out what was so wrong with the slow rise-time

Options mentioned above by you all are
1: use a 1k resistor
2: Change the flip-flop clock from rising to falling edge of PHI2
3: BDD's method of driving the signal high before going high-z

Unfortunately the resistor is so close to an ic socket I'd probably make a mess trying to remove it so I'll see what I can achieve with options 2&3


Attachments:
DS1Z_QucikPrint6.png
DS1Z_QucikPrint6.png [ 38.05 KiB | Viewed 4466 times ]
Top
 Profile  
Reply with quote  
PostPosted: Tue May 15, 2018 1:17 am 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
LIV2 wrote:
Unfortunately the resistor is so close to an ic socket I'd probably make a mess trying to remove it so I'll see what I can achieve with options 2&3
You don't necessarily need to remove the resistor. Instead, can you just leave it in place and add another resistor in parallel? :) It's alright if the combined value is less than 1K; this will aid the cause. Without having seen the specs for your CPLD I'm guessing you could go down to a few hundred ohms or even less. The extra current consumption is probably unimportant (unless it's a battery-powered application).

I have some doubts about options 2&3. Unless I'm missing something the flip-flop is intended to produce a wait state (IOW pause the CPU) in response to certain addresses on the bus (such as addresses mapped to a slow ROM). The decision regarding the need for a wait-state is one that needs to be made partway through the cycle. The rising edge of Phi2 is an acceptable time because it satisfies two requirements: it's late enough for the address to be valid (so we know if it's ROM or not) and also early enough to allow the CPU sufficient setup time before it samples the RDY signal (at the fall of Phi2).

Option 3 (driving the signal high before going high-z) involves a tradeoff, as there's the risk of a WAI instruction trying to simultaneously drive RDY low. The risk may not be much to worry about, but using an unaided pullup resistor eliminates the risk entirely, and to me seems a simpler solution. (As noted, the pullup needs to have a suitably low resistance.)

-- 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: Tue May 15, 2018 1:57 am 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 172
Location: Sweden
I think the CPLD should be able to handle it, just wondering how much the CPU can sink on that RDY pin since I recall reading here that a value too low etc could cause the CPU to be unable to pull RDY low and thus continue immediately after a WAI instruction (though I doubt I'll ever use WAI)

I really should've left more space or mounted the resistors & caps on the bottom of the board... oh well lesson learnt!


Attachments:
IMG_8707.JPG
IMG_8707.JPG [ 29.45 KiB | Viewed 4465 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

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