Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/28/01 05:16
Read: times


 
#12852 - RE: Binary Counting help..
Hi Josh,

First of all download the 8052 simulator from this site, it will help you a lot.

Counting from 00111111B to 01111110B and back, is no problem.

Think on it !!

in Hex it is from 3Fh to 7Eh.

You can do like:

mov R0,#3Fh ; starting value

loop:

mov P1,R0 ; LED bar is connected with port 1

inc R0

cjne R0,#7Fh,loop ; check if the count has reached maximum

mov R0,#3Fh ; reset the count to starting value

sjmp loop ; stay in the loop



Hope it helps

Simon










List of 7 messages in thread
TopicAuthorDate
Binary Counting help..            01/01/70 00:00      
RE: Binary Counting help..            01/01/70 00:00      
RE: Binary Counting help..            01/01/70 00:00      
RE: Binary Counting help..            01/01/70 00:00      
RE: Binary Counting help (Andy)            01/01/70 00:00      
RE: Counting - Binary, Hex, ...            01/01/70 00:00      
RE: Binary Counting help..            01/01/70 00:00      

Back to Subject List