What does "down counter" mean?

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

cross mob
user_4161501
Level 1
Level 1
First reply posted First question asked
I've been looking at the datasheet of the microcontroller and a question arose as to what the "dual counter" of the dual timer would be.

S6E1A12C0AGV20000/Cypress

0 Likes
1 Solution
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

A down counter is a counter which decreases the count value instead of increasing of "Up Counter."

For a timer, if you assign the length to count,

it will be easier (or cheaper) in terms of speed and number of logic gates required

to check if the count value is 0 or not

instead of comparing with each particular value.

I've seen this approach even in "C" programs, some (or many?) programmers who care about speed tend to write a for loop just like

  for(i = max-1 ; i ; --i)

where I would usually write

  for (i = 0 ; i < max ; i++)

moto

View solution in original post

2 Replies
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

A down counter is a counter which decreases the count value instead of increasing of "Up Counter."

For a timer, if you assign the length to count,

it will be easier (or cheaper) in terms of speed and number of logic gates required

to check if the count value is 0 or not

instead of comparing with each particular value.

I've seen this approach even in "C" programs, some (or many?) programmers who care about speed tend to write a for loop just like

  for(i = max-1 ; i ; --i)

where I would usually write

  for (i = 0 ; i < max ; i++)

moto

Thank's!!!!

0 Likes