6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Apr 19, 2024 12:27 pm

All times are UTC




Post new topic Reply to topic  [ 54 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
PostPosted: Sat Feb 26, 2022 10:03 am 
Offline

Joined: Sat Feb 19, 2022 2:18 am
Posts: 47
Hi, everyone! This is my first post to this forum. I'm glad to be part of this community!

I am trying my best to get a 65816 system up and running. Unfortunately, I am running into some issues, likely timing related. I could use some pointers. I have posted some background information here: https://www.rehsdonline.com/post/troubleshooting-65816-rom-ram-part-2.

The short version is that I am unable to get my ROM+RAM working with decoding logic. I'm guessing that I have a timing issue, but I haven't been able to figure it out.

I'd greatly appreciate any assistance you can provide.

Thanks!

Update: This issue has been resolved. Many updates were made based on great advice from members here. Ultimately, my lousy assembly coding was at fault. Credit to Adrien Kohlbecker for catching the issue with my code.


Last edited by rehsd on Mon Feb 28, 2022 4:35 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 10:17 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8422
Location: Southern California
Welcome.

Your linked page comes up for me for one or two seconds and then goes blank. I guess there's something there that doesn't like my older ff browser version on this computer. I hope to have my regular desktop computer setup working again this week. Note that you can attach images here, so it's not necessary to link to outside image hosts.

A couple of topics that might prove helpful are:


Also, go through the 6502 primer. It's not '816-specific, but most of the material there will apply anyway.

_________________
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: Sat Feb 26, 2022 11:13 am 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
rehsd wrote:
Hi, everyone! This is my first post to this forum. I'm glad to be part of this community!

I am trying my best to get a 65816 system up and running. Unfortunately, I am running into some issues, likely timing related. I could use some pointers. I have posted some background information here: https://www.rehsdonline.com/post/troubleshooting-65816-rom-ram-part-2.

The short version is that I am unable to get my ROM+RAM working with decoding logic. I'm guessing that I have a timing issue, but I haven't been able to figure it out.

I'd greatly appreciate any assistance you can provide.

Thanks!

Looking at the your diagram, you don't seem to be utilising the VDA and VPA pins on the 65816. These are used to determine if there is a valid address on the address bus or not. A rule of thumb is a 1 on either or both is fine. 0 on both means an invalid address and should be ignored by the decoding circuitry. Page 15 of the datasheet has some information on this (section 2.26).

Recommendations
- Put VDA and VPA through an OR gate - either a specific OR gate IC or within a GAL/CPLD - and use that as a part of the enable for all of the address decoding. Without this you're going to have some really random stuff happen and it might be the main cause of your issue.
- When writing to RAM, validate it with PHI2 (main clock) so the write enable signal for the RAM is enabled only when PHI2 goes high. Never do this for any 65xx device though (such as the 6522 or 6551) as they expect to be fed the 65816's RWB output. Also, don't do this for the chip selects - they can be enabled as soon as you know VDA & VPA are valid and the address range matches.
- With regards your pull up resistors on the 65816: I suspect 1K is fine, but you could try a 2K2 or 3K3 (I use 3K3 in my designs) as it will do the job, but consume less current.
Also, is there a reason for 10K value on the BE line pullup resistor? I've not seen anyone use a different value to the other 65816 pull ups, which is why I ask.
- RESB might be better with a 3K3 pull up as it can be a little unreliable without it -something I was warned about and I have definitely seen on my 65C02 designs.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 1:31 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3343
Location: Ontario, Canada
Welcome!

Does your build still look like this (below)? If so, you have <ahem> some tidying up to do!
Attachment:
rehsd 1.jpg
rehsd 1.jpg [ 209.51 KiB | Viewed 1371 times ]


It's not just a matter of the length of all those cables. It also matters (a lot!) how the power and ground pins of your IC's get interconnected. For starters, cables between boards need to include at least one ground conductor (and ideally a power conductor too), attached to the local ground/power at each end. There are other requirements, too.

You mentioned you've been following Adrien Kohlbecker's video series, and he's facing some of the same issues. Have a look at the latest posts in his thread, here.

Given the fact that your project almost works, or works sometimes, it may seem to you as if only a minor tweak is needed. But that's misleading, as extensive changes may be necessary before you achieve solid, reliable operation. A project that works but is flaky can require just as much additional effort as one that's dead in the water. Sorry -- I don't make the rules, I'm just tellin' ya how it is! :P

banedon wrote:
- When writing to RAM, validate it with PHI2 (main clock) so the write enable signal for the RAM is enabled only when PHI2 goes high. Never do this for any 65xx device though (such as the 6522 or 6551) as they expect to be fed the 65816's RWB output.
This. But I wouldn't worry about pullup values. Ditto with the VPA, VDA thing, as problems in that department tend to be very subtle (not like what you're facing).

BTW your "schematic" is little more than a net list. It may seem clear to the person who created it, but others usually find it opaque -- it takes time to connect the dots. And not everyone will grant you that time. A real schematic with actual lines will increase the quantity and quality of the assistance you can garner here. Just sayin'!

-- Jeff


Attachments:
rehsd 2.png
rehsd 2.png [ 414.24 KiB | Viewed 1371 times ]

_________________
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: Sat Feb 26, 2022 3:07 pm 
Offline

Joined: Sat Feb 19, 2022 2:18 am
Posts: 47
GARTHWILSON wrote:
A couple of topics that might prove helpful are...


Thanks, @GARTHWILSON. I will spend some time going through these resources.


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 3:34 pm 
Offline

Joined: Sat Feb 19, 2022 2:18 am
Posts: 47
banedon wrote:
Recommendations
- Put VDA and VPA through an OR gate - either a specific OR gate IC or within a GAL/CPLD - and use that as a part of the enable for all of the address decoding. Without this you're going to have some really random stuff happen and it might be the main cause of your issue.
- When writing to RAM, validate it with PHI2 (main clock) so the write enable signal for the RAM is enabled only when PHI2 goes high. Never do this for any 65xx device though (such as the 6522 or 6551) as they expect to be fed the 65816's RWB output. Also, don't do this for the chip selects - they can be enabled as soon as you know VDA & VPA are valid and the address range matches.
- With regards your pull up resistors on the 65816: I suspect 1K is fine, but you could try a 2K2 or 3K3 (I use 3K3 in my designs) as it will do the job, but consume less current.
Also, is there a reason for 10K value on the BE line pullup resistor? I've not seen anyone use a different value to the other 65816 pull ups, which is why I ask.
- RESB might be better with a 3K3 pull up as it can be a little unreliable without it -something I was warned about and I have definitely seen on my 65C02 designs.


Thanks, @banedon.

I will incorporate VDA and VPA. I hadn't as the sample schematic from WDC didn't seem to use it. My bad.

I will qualify the RAM's WE# with PHI2.

The pull-up resistor values were inaccurate on the schematic. I am using 3.3K the pull-ups, other than RESB, which uses a 1K (I could change it to a 3.3K). I will update the schematic. I have attached the reset circuit I am currently using.


Attachments:
reset.png
reset.png [ 129.62 KiB | Viewed 1361 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 3:49 pm 
Offline

Joined: Sat Feb 19, 2022 2:18 am
Posts: 47
Dr Jefyll wrote:
Does your build still look like this? ....

:D No, it doesn't. I've attached a pic of my current PCB from which I'm working.

Dr Jefyll wrote:
BTW your "schematic" is little more than a net list. It may seem clear to the person who created it, but others usually find it opaque -- it takes time to connect the dots. And not everyone will grant you that time. A real schematic with actual lines will increase the quantity and quality of the assistance you can garner here. Just sayin'!

I appreciate the feedback on the schematic. I will post an updated version shortly.

Thanks!


Attachments:
File comment: Current dev board
current PCB 20220226.jpg
current PCB 20220226.jpg [ 5.88 MiB | Viewed 1360 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 4:42 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1074
Location: Albuquerque NM USA
Redrew your schematic before your last two updates. It should be easier to analyze by the guys here. I don't see anything wrong specifically, but AC or ACT components are dangerous; too fast, too noisy. 15nS RAM is also bad news.
Bill


Attachments:
rehsd_scm.pdf [20.42 KiB]
Downloaded 40 times
Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 5:07 pm 
Offline
User avatar

Joined: Sun Sep 08, 2013 10:24 am
Posts: 740
Location: A missile silo somewhere under southern England
Dr Jefyll wrote:
banedon wrote:
- When writing to RAM, validate it with PHI2 (main clock) so the write enable signal for the RAM is enabled only when PHI2 goes high. Never do this for any 65xx device though (such as the 6522 or 6551) as they expect to be fed the 65816's RWB output.
This. But I wouldn't worry about pullup values. Ditto with the VPA, VDA thing, as problems in that department tend to be very subtle (not like what you're facing).

I mentioned the pull ups as a suggestion more than anything else, not to resolve the issue at hand :).


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 5:09 pm 
Offline

Joined: Sat Feb 19, 2022 2:18 am
Posts: 47
plasmo wrote:
Redrew your schematic before your last two updates. It should be easier to analyze by the guys here. I don't see anything wrong specifically, but AC or ACT components are dangerous; too fast, too noisy. 15nS RAM is also bad news.
Bill

I have attached my updated schematic (before the pending updates based on feedback above). This isn't as nice as what you drew, Bill. :)

I have tried the circuit with all HC / HCT. Is that a better way to go?

Also, what should I look for in RAM?

Thank you!


Attachments:
File comment: Updated schematic
Schem2.png
Schem2.png [ 699 KiB | Viewed 1346 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 6:20 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1922
Location: Sacramento, CA, USA
plasmo wrote:
I don't see anything wrong specifically, but AC or ACT components are dangerous; too fast, too noisy. 15nS RAM is also bad news.

Kinda like installing a big V-8 in a go-cart? Doable, but likely to cause problems, some obvious and others not so obvious ... :)

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 8:54 pm 
Offline
User avatar

Joined: Sat Jul 24, 2021 1:37 pm
Posts: 282
barrym95838 wrote:
plasmo wrote:
I don't see anything wrong specifically, but AC or ACT components are dangerous; too fast, too noisy. 15nS RAM is also bad news.

Kinda like installing a big V-8 in a go-cart? Doable, but likely to cause problems, some obvious and others not so obvious ... :)


Unfortunately, the 65C816 requires an AC chip for at least the bank address latching as well as the associated logic, as the timing margin is pretty thin (10ns to latch after rising edge of clock).

rehsd wrote:
I have tried the circuit with all HC / HCT. Is that a better way to go?

Also, what should I look for in RAM?

Thank you!


Having as less as possible AC/ACT chips on a breadboard is the way to go. On a PCB I would say it is fine if you have proper signal return paths / ground planes. Can you share screenshots of your PCB routing?

For the RAM, go with a slow, 55ns one before attempting to increase the speed. This goes for all the components, if they don't have a reason to be fast, go with slow chips, as they will be easier to manage for a start. Once you have a working slow build, then you can try to increase speed.

Your GAL can also be an issue with fast edges. Which model are you using? Can you also share how you're programming it and with which equations?

banedon wrote:
- Put VDA and VPA through an OR gate - either a specific OR gate IC or within a GAL/CPLD - and use that as a part of the enable for all of the address decoding. Without this you're going to have some really random stuff happen and it might be the main cause of your issue.


Having VDA, VPA be a part of the address decoding works but I would argue it is better to incorporate it into the read-write pulses. This way the address decoding is a fully static look-up, and you can more easily do DMA. Either way, I agree that they need to appear in the logic. I just released an episode on that subject yesterday, coincidentally!

_________________
BB816 Computer YouTube series


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 9:28 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8422
Location: Southern California
akohlbecker wrote:
Unfortunately, the 65C816 requires an AC chip for at least the bank address latching as well as the associated logic, as the timing margin is pretty thin (10ns to latch after rising edge of clock).

The 74HC573's required input data hold time is guaranteed to be no more than 5ns, and 2ns is typical. My 74AC data book is not clear on this, but it appears to be saying that the data input could even start to change up to a whole nanosecond before the latch enable, and it would still keep the right value at the output.

Quote:
For the RAM, go with a slow, 55ns one before attempting to increase the speed.

I think what we're talking about here is output edge rate, rather than access time. They're two separate things. Without looking through a lot of data sheets again, I don't remember ever seeing the output edge rates specified on SRAMs. Have you?

_________________
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: Sat Feb 26, 2022 9:56 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8138
Location: Midwestern USA
rehsd wrote:
Hi, everyone! This is my first post to this forum. I'm glad to be part of this community!

Welcome! Glad to read that the 65C816 is getting some much-needed love.

Quote:
I am trying my best to get a 65816 system up and running. Unfortunately, I am running into some issues, likely timing related. I could use some pointers. I have posted some background information here: https://www.rehsdonline.com/post/troubleshooting-65816-rom-ram-part-2.

Like Garth, I cannot view that page. You can attach schematics, pictures, etc., to your posts here and save readers the trouble of having to go off-site.

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


Top
 Profile  
Reply with quote  
PostPosted: Sat Feb 26, 2022 10:09 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8138
Location: Midwestern USA
plasmo wrote:
Redrew your schematic before your last two updates. It should be easier to analyze by the guys here. I don't see anything wrong specifically, but AC or ACT components are dangerous; too fast, too noisy. 15nS RAM is also bad news.
Bill

Ah! A schematic that is actually a schematic and, especially important to me, is not in color.

74AHC is a good choice, as it combines the speed of 74AC with the more “gentle” outputs of 74HC. I've used 74AC/ACT in all my designs to date without noise problems, but these are on four-layer boards with internal ground and power planes, and meticulous attention to layout details. 74AC/ACT on a two-layer board may be a pretty unforgiving arrangement due to ground bounce, ringing, etc.

No pullup resistor is required on RWB, as that output is driven in both directions—it's not an open-collector output.

_________________
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 1, 2, 3, 4  Next

All times are UTC


Who is online

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