TTL word output with PSOC 5LP

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

cross mob
PaFi_4802396
Level 1
Level 1
First reply posted First question asked First like given

I want to generate an 8-bit TTL word using PSOC. For this I have to be able to turn on up to 8 pins simultaneously. How could I do this?

 

0 Likes
1 Solution
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

PaFi,

Since you have listed "PsoC5 LP MCU" as a tag, I'm going to assume this is the processor you are using.

The answer to your question is EXTREMELY easy!

In the TopDesign place an "Digital Output Pin" component on the schematic page.

Now on it, Right-click select "Configure ..."

Select he "Number of pins:" field and change it to '8'.

Len_CONSULTRON_0-1616589482888.png

Next select the "Mapping" Tab.  Make sure "Contiguous" is checked.  (If you want to make the symbol smaller, you can also select "Display as a Bus".)

Len_CONSULTRON_1-1616589686647.png

The next step is to assign which pins are used for this 8-bit port.  Go to the "Design Wide Resources/Pins" tab (with the extension of .cydwr) and select the port to use as shown below.

Len_CONSULTRON_2-1616589901889.png

The last step is to include the code to change the port value bits at the same time.

In the appropriate points in your code you can access the output port as shown (Note:  The 8-bit port name in my example is named "Pin_1".  You can name it differently as needed):

Pin_1_Write(new_8_bit_value);

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

4 Replies
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

PaFi,

Since you have listed "PsoC5 LP MCU" as a tag, I'm going to assume this is the processor you are using.

The answer to your question is EXTREMELY easy!

In the TopDesign place an "Digital Output Pin" component on the schematic page.

Now on it, Right-click select "Configure ..."

Select he "Number of pins:" field and change it to '8'.

Len_CONSULTRON_0-1616589482888.png

Next select the "Mapping" Tab.  Make sure "Contiguous" is checked.  (If you want to make the symbol smaller, you can also select "Display as a Bus".)

Len_CONSULTRON_1-1616589686647.png

The next step is to assign which pins are used for this 8-bit port.  Go to the "Design Wide Resources/Pins" tab (with the extension of .cydwr) and select the port to use as shown below.

Len_CONSULTRON_2-1616589901889.png

The last step is to include the code to change the port value bits at the same time.

In the appropriate points in your code you can access the output port as shown (Note:  The 8-bit port name in my example is named "Pin_1".  You can name it differently as needed):

Pin_1_Write(new_8_bit_value);

Len
"Engineering is an Art. The Art of Compromise."
PaFi_4802396
Level 1
Level 1
First reply posted First question asked First like given

Thank you a lot for such a detailed guide Len. Before I accept this as a solution, could you explain to me why this is dependent on the processor in my board? 
Also why is indexes of the Ports go from 7 to 0 and not reversed, does it mean that my first bit would correlate to the 7th port of chosen group?

0 Likes

PaFi,

My steps should apply to the PSoC5 and PSoC3.  This forum also includes the PSoC1.  PSoC1 has different resources and access.

If you chose Port 1 (P1[7:0]) the bits of this port would be used.  Bit 7 = Bit 7 of the 8-bit Byte.  Bit 0 = Bit 0.    Therefore you have to route your circuit to all the pins of that port.

Does this answer your question?

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Yes, thanks a lot again! It was just a bit weird to me why they write P1[7:0] and not P1[0:7]. 

0 Likes