Hi I am doing an up down digital counter , the counter should count from 0 to 30 . I know how to increment and decrement. but the problem is I have to increment/ decrement the units alone than the tens and then display them on an lcd. How can I do It pls ???
Hi I am doing an up down digital counter , the counter should count from 0 to 30 . I know how to increment and decrement. but the problem is I have to increment/ decrement the units alone than the tens and then display them on an lcd. How can I do It pls ???
First you have to draw a flowchart (see attached example) of what you have to do, including all conditions such as what happens when you decrease a number and the unit count is 0, or when you increase a number and the unit count is 9 ..
To count units use, for example, register R2, to count tens use R3.
Once you have a flowchart translating it to the 8051 code is not a major problem.