Simple bus and pins question

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
kemic_264446
Level 4
Level 4
First like received
        I should know how to do this, but for some reason I have a mental block. I have a very basic project, with two digital input pins and a debouncer. The pins component is set to have 2 pins. The debouncer is set to a signal width of 2. The Pins component shows 2 separate connections for the pins. 0 and 1. The debouncer input shows as a bus d[1:0] The question is, how do I connect the 2 pins to the debouncer inputs? If I draw a wire out from the debouncer inputs it correctly shows as being a bus with indexes from 1 to 0. If I draw a wire out from one of the pins is correctly shows as a wire. (Width is 1). When I try to connect the wire to the bus it immediately changes back to being a single wire. I just can't remember how to connect a wire to a specific index in the bus. Help anyone? My really basic project is attached.   
0 Likes
11 Replies
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Here it is.   
0 Likes
kemic_264446
Level 4
Level 4
First like received

 Yes - thanks.

   

That shows how to convert the pins component to show as a bus, and is a good solution in my case.

   

But what if I wanted to connect outputs from two different things to a bus - how do I connect a wire to a specific index on a bus?

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Difficult to explain in words:

   

1st: connect the wanted signal to the bus.

   

2nd: edit the signal (double click) and specify which bit of the bus it should be connected to.

   

 

   

That's all

   

 

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Here's a picture of the dialog

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored
        This is btw. covered in detail in the online help (Help/Topics, then 'Using Design Entry Tools' / 'Schematic Editor' / 'Drawing Busses'). Don't forget to deselect 'Specify Full name' in the connect wire, otherwise you will change the whole wire.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Next is this.   
0 Likes
lock attach
Attachments are accessible only for community members.
kemic_264446
Level 4
Level 4
First like received

 Hi Bob,

   

 

   

Thanks - that's what I thought and I'm sure that's how I remembered doing it in the past.

   

Take a look at the attached project. (Updated from 1st post)

   

I have 2 switches, which are on a bus, connected to a debouncer which has a width of 2.

   

The output of the debouncer is again a bus, with a width of 2 and I wish to connect it to the 2 ISRs.

   

As soon as I connect it to either if the ISRs the entire bus becomes a single wire again. I must have forgotten a step somewhere.

0 Likes
kemic_264446
Level 4
Level 4
First like received

 OK I got it to work, but it's a bit non-obvious.

   

I drew the bus first, conneted the two ISRs - which immediately changed the bus back to a wire, and then set the name-and-width of each wire, and finally set the name-and-width of the bus back to being a bus again.

0 Likes
Anonymous
Not applicable
        Nevertheless, I'm not sure. Try to test actually. It's like Bus-Tap on the CPLD or FPGA.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable
        Is it OK? I'm quite not sure, Need actual test.   
0 Likes
kemic_264446
Level 4
Level 4
First like received

 The wires and bus need to have the same base name.

   

I've got this working now 🙂

   

Maybe in a future edition of Creator if you drag a wire to bus it could prompt you for the index, and automatically rename the wire. That'd be neat and in fact that is what the Eagle schematic editor does.

   

 

   

Thanks to everyone for their help.

0 Likes