6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 6:10 pm

All times are UTC




Post new topic Reply to topic  [ 256 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18  Next
Author Message
PostPosted: Thu Jul 13, 2023 5:39 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
I think you shouldn't use global labels (e.g. A15) that are subsets of the bus, for sure, as the "A15" on the bus is not necessarily the same. I believe you should use the whole bus every time, with a consistent range of members, and break out the wire you need from it - or explicitly export wires like A15 on one of the sheets to a global A15 label, to make sure that in other sheets the global label A15 does refer to that wire.

But the main reason you're getting ERC errors, I think, is that you're using "bus-to-bus entries" to make 45-degree lines - they are not normal connections, so one side of them is not actually the same bus as the other! Either draw 45-degree lines by hand (tedious) or just don't draw the 45-degree lines at all. If in doubt, I think Alt-4 will highlight everything connected to a wire you hover over, so you can verify what is or is not connected.

I can't confirm the above however as Kicad 7 no longer seems to have the bus-to-bus entries, only wire-to-bus entries. I'm not even sure what the bus-to-bus ones actually were meant to do.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 7:35 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Proxy wrote:
so to me that seems like the global labels aren't actually working and the only reason the data bus one didn't throw an error is because of the local label attatched to the same bus.
Whupps, hadn't spotted that. Thanks for pointing it out! I deleted that local label and the data bus still works. Still, on that sheet, U502 and U505 are at least connected to each other through the bus; whereas the address bus that's giving me trouble isn't connected to anything else on its sheet. It seems like the global labels are not connecting sheet to sheet. (I now know they *are* connecting sheet to sheet, thanks to the highlight tool that George made me aware of.)

gfoot wrote:
If in doubt, I think Alt-4 will highlight everything connected to a wire you hover over, so you can verify what is or is not connected.
Oh hey! Thanks for the tip. It's not Alt-4 on Mac, but now that I know that feature exists, it was easy to discover how to activate it. This is a great tool! It works across sheets, so that if I highlight the address bus on the main sheet, everything on the other sheets that connect to the address bus also light up!
Attachment:
Screen Shot 2023-07-13 at 2.46.57 PM.png
Screen Shot 2023-07-13 at 2.46.57 PM.png [ 36.16 KiB | Viewed 858 times ]
Unfortunately it doesn't seem to clear up what's happening. All those "unconnected" labels appear to in fact be connected! :?:
Attachment:
Screen Shot 2023-07-13 at 2.53.06 PM.png
Screen Shot 2023-07-13 at 2.53.06 PM.png [ 11.86 KiB | Viewed 858 times ]
"A pin with a 'no connection' flag is connected."
Attachment:
Screen Shot 2023-07-13 at 2.59.37 PM.png
Screen Shot 2023-07-13 at 2.59.37 PM.png [ 10.25 KiB | Viewed 858 times ]
"Label not connected to anything."

gfoot wrote:
But the main reason you're getting ERC errors, I think, is that you're using "bus-to-bus entries" to make 45-degree lines - they are not normal connections, so one side of them is not actually the same bus as the other! Either draw 45-degree lines by hand (tedious) or just don't draw the 45-degree lines at all. If in doubt, I think Alt-4 will highlight everything connected to a wire you hover over, so you can verify what is or is not connected.
I'm not sure what that means, "bus-to-bus entries?" I made the bus with the blue drawing tool that looks like a forward slash. I defined its net using the "global label" tool that looks like an A inside of a chevron. To connect individual pins to the bus I used the right click menu "unfold from bus" tool that I saw in the "bus" tutorial:
Attachment:
Screen Shot 2023-07-13 at 3.04.37 PM.png
Screen Shot 2023-07-13 at 3.04.37 PM.png [ 90.54 KiB | Viewed 858 times ]
That creates the local label "A4," a bus entry wire, and changes the tool into the green "wire drawing" tool so you can connect to the pin:
Attachment:
Screen Shot 2023-07-13 at 3.07.12 PM.png
Screen Shot 2023-07-13 at 3.07.12 PM.png [ 13.97 KiB | Viewed 858 times ]
And, in fact, this seems to work! This demo connection makes the error about A4 go away!
Attachment:
Screen Shot 2023-07-13 at 3.08.01 PM.png
Screen Shot 2023-07-13 at 3.08.01 PM.png [ 11.54 KiB | Viewed 858 times ]
This is frustrating! I feel like I must be missing something, but maybe it's just a weird bug? I think it must be. This works:
Attachment:
Screen Shot 2023-07-13 at 3.27.05 PM.png
Screen Shot 2023-07-13 at 3.27.05 PM.png [ 20.88 KiB | Viewed 858 times ]
And A4 is highlighted on the other sheets too, like you would expect. But if I delete the demo bus:
Attachment:
Screen Shot 2023-07-13 at 3.29.37 PM.png
Screen Shot 2023-07-13 at 3.29.37 PM.png [ 11.17 KiB | Viewed 858 times ]
it says the label is unconnected but it still highlights A4 on the other sheets.

I guess I have spent enough time on this; I'll just delete those address buses and use individual global labels for the `688 and `138. Thanks for helping investigate; at least I learned how the highlight tool works, which is quite useful!

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 7:36 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 989
Location: Potsdam, DE
I have found that Kicad gets sulky if you wire the bus connectors the wrong way around...
1) draw and label the bus e.g. [A0..15]
2) place your part to attach to it
3) label each pin to be attached (I usually do a short stub, but I'm not sure it's absolutely required). These should match the bus e.g. A0, A1 etc
4) select the bus connector tool and rotate the 45 joining wire until the control end - the end it rotates around - meets the just labelled stud and the other end meets the bus. This requires the bus to be in the right place relative to the stub - 0.2" away by default.

I speculate that if you do it this way around, the stub acquires the bus label and therefore attaches to the bus correctly; the other way around it's trying to acquire the complete bus name, or just doesn't know what to connect to... I don't know for certain but I haven't had any unconnected issues since I discovered this by trial and error.

Curiously once you have a spray of connections to the bus you can copy and paste them elsewhere and they remember their names.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 7:42 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Cross posted with Neil!

The procedure you describe is exactly how I did it the first time, before I found the tutorial with the "unfold from bus" tool. I seem to get the same results either way. Highlighting the actual pin in the component shows that it's connected to every other A4 in the whole project, but the ERC thinks it's still unconnected.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 7:55 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
I'm on my phone so it's hard to type, but what I'm referring to is the 45degree blue corners you have in some places. These are possibly a special type of bus-to-bus join, and may be causing the issue. I'd delete them and just join the blue bus lines together directly.

Note that all identically-named labels on any single sheet are connected, whatever their type. So buses do pretty much nothing within a single sheet as both endpoints already need to have the same net label (e.g. A4)! They are mostly just decorative. The only case they do something significant is when you export them between sheets either using global labels or hierarchical labels for the whole bus (as you have done). But this is why any case where you use the same bus member twice within one sheet is not triggering the error - because it is connected to at least one other thing through the label alone. But not all the things you wanted!

Kicad's legacy handling of buses is quite poor - just a thin veneer over labels. It is more "first class" in version 7.

Edit, oh one other thing - make sure you press the dialog button to rerun the ERC after opening the ERC dialog, or it will just repeat the errors from last time! I've been confused by missing this step before.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 9:19 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
gfoot wrote:
Kicad's legacy handling of buses is quite poor - just a thin veneer over labels. It is more "first class" in version 7.
I'm going to have to see if I can upgrade to version 7!

Edit: Alas, version 7 requires MacOS 11.6. I can't run it on my elderly macbook. :cry:

Anyway, here's a more or less done schematic. It's in black & white in case BDD is lurking menacingly someplace nearby. :P I didn't do the VGA page, because I thought I'd wait until I'm back home to do that so I can make sure it accurately reflects what I really built on the breadboards. Also I plan to add a "Serial" page eventually for an ACIA. I've gotten behind on my Ben Eater videos. :D


Attachments:
6502.pdf [285.18 KiB]
Downloaded 46 times

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Last edited by Paganini on Thu Jul 13, 2023 11:55 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 10:02 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Nice! I'd suggest learning how hierarchical pins work, they can be quite nice to use depending on how modular your sheets are, and make you less dependent on getting the global labels matched correctly.

J301 is missing some resistors otherwise it's going to short VCC to ground.

I'm not sure why RAM/~ROM has a pulldown resistor, R401?

Also where did you get your symbols from, did you make them yourself? I've looked for decent 6502 symbols in the past and ended up making my own or customising them I think, so I'm curious where you found yours.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jul 13, 2023 10:23 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Man, you have a good eye!
gfoot wrote:
J301 is missing some resistors otherwise it's going to short VCC to ground.
This originally had a separate VCC for each jumper, I think, and I messed it up trying to clean it up visually (it was overlapping with the address bus. I will go rejigger it.

Quote:
I'm not sure why RAM/~ROM has a pulldown resistor, R401?
Ah, that's a leftover. I had originally planned to use a VIA port rather than a flip-flop, and I wanted to make sure that ROM was activated by default after a reset. It can be deleted!

Quote:
Also where did you get your symbols from, did you make them yourself? I've looked for decent 6502 symbols in the past and ended up making my own or customising them I think, so I'm curious where you found yours.
I use forum member Alarm Siren's KiCAD library for the 6502 and 6522s. For the others I mostly just edited existing symbols from the symbol library. The only one I had to make from scratch was the DS1813, which didn't seem to have a similar device in the library. (Although, the library is huge, so maybe I missed one.) I just took one stage from a flip flop and gave it new pins.

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Fri Jul 14, 2023 4:06 pm 
Offline

Joined: Mon Jan 19, 2004 12:49 pm
Posts: 989
Location: Potsdam, DE
Paganini wrote:
Highlighting the actual pin in the component shows that it's connected to every other A4 in the whole project, but the ERC thinks it's still unconnected.


I _think_ that if you hook the diagonal line to a named line using the control handle end, it acquires the name of that line as expected. If the control goes to the bus then it doesn't know what to connect to.

Bear in mind that apart from the case of crossing busses between sheets, the bus itself has no function other than making happy those who don't like lots of chips with named pins and nothing joining them together. Which is not a bad ambition; the better the diagram - for some subjective value of 'better' - the easier it is to understand. But that said, I have commercial products with 100-pin controllers in the middle of three or four hundred largely analog or service parts, and the diagram for the controller is basically about eighty global labels and the power supply decoupling.

As has been pointed out: everything on a Kikad diagram (and every other schematic editor I'm familiar with) which is named is joined to everything else with the same name - either globally or on the same page, depending on the label type.

Neil


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 15, 2023 3:59 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
barnacle wrote:
As has been pointed out: everything on a Kikad diagram (and every other schematic editor I'm familiar with) which is named is joined to everything else with the same name - either globally or on the same page, depending on the label type.
Yeah, I can see that would be perfectly fine, especially if you're designing for a PCB. I'm planning to wire wrap these boards, so I want the visual metaphor to be robust. But maybe the best way to do that in KiCAD is to just label the bus with the text tool and let the labels on the pins take care of the connections. This seems to work:
Attachment:
Screen Shot 2023-07-15 at 11.59.08 AM.png
Screen Shot 2023-07-15 at 11.59.08 AM.png [ 44.21 KiB | Viewed 781 times ]

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sat Jul 15, 2023 4:59 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
IMHO visual clarity is important in schematics so you're right to want to make it clear.

Can you share the broken schematic files, preferably a zip of the project folder? I could take a look in more detail. I've never had any problems making buses except when I was starting out and didn't understand how they worked.


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 16, 2023 4:54 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
gfoot wrote:
Can you share the broken schematic files, preferably a zip of the project folder? I could take a look in more detail. I've never had any problems making buses except when I was starting out and didn't understand how they worked.
Attached!

Attachment:
6502.zip [369.32 KiB]
Downloaded 44 times

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 16, 2023 5:15 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
Paganini wrote:
gfoot wrote:
Can you share the broken schematic files, preferably a zip of the project folder? I could take a look in more detail. I've never had any problems making buses except when I was starting out and didn't understand how they worked.
Attached!

Attachment:
6502.zip


When I load the project into Kicad 6.0.11 and run an ERC, it only reports five errors, which all seem correct, regarding unused device chip select outputs, so I'm not sure why it's not working for you - perhaps you're on a different version, and that version just has a bug?


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 16, 2023 6:27 pm 
Offline

Joined: Fri Mar 18, 2022 6:33 pm
Posts: 491
Iiiiinteresting. I have version 6.0.9. Thanks for testing! Is 6.0.11 a release version, or do you use the testing branch?

_________________
"The key is not to let the hardware sense any fear." - Radical Brad


Top
 Profile  
Reply with quote  
PostPosted: Sun Jul 16, 2023 7:01 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
I normally use version 7.0.0, I just installed 6.0.11 to test your project as it appeared to be the highest official release of version 6. If you're upgrading then I think you might as well go straight to the latest version 7 release.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 256 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18  Next

All times are UTC


Who is online

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