set digital outputs using an parameter in a loop

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

cross mob
EuCh_1049346
Level 1
Level 1

Is there a way to set a 10 digital outputs using an parameter in a loop like an pinMode() commands in Arduino?

A single line of code in a loop...

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

It is easy to write to 8 pins at once, writing to 10 pins (8+2) will have some latency as it will take 2 commands. Can you tolerate several clock mismatch in between?

There are, of course, many trucks to set all pins at once. For example, a Control register can be used in Sync mode. The output of the Control register will take effect on external sync signal, many Control registers can be synced this way. See examples here

[Verilog] Register access using CY_SET_REG

View solution in original post

0 Likes
2 Replies
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

It is easy to write to 8 pins at once, writing to 10 pins (8+2) will have some latency as it will take 2 commands. Can you tolerate several clock mismatch in between?

There are, of course, many trucks to set all pins at once. For example, a Control register can be used in Sync mode. The output of the Control register will take effect on external sync signal, many Control registers can be synced this way. See examples here

[Verilog] Register access using CY_SET_REG

0 Likes
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

Using control reg component is the best way to realize this function.

0 Likes