Ds1302
I am working on building a clock program using the BS2 chip and the DS13202.
I can make the clock program used presets, but I want to build an up counter to set the time. The DS13202 uses hex and I only can build a Decimal counter. Can someone give me a suggestion on how to do this
I can make the clock program used presets, but I want to build an up counter to set the time. The DS13202 uses hex and I only can build a Decimal counter. Can someone give me a suggestion on how to do this

Comments
What do you mean by "build an up counter"? If you mean a hardware up counter, you can get 4-bit decimal counters that you can hook together to make a larger up counter that will automatically carry from one digit to another (like the TI CD4510). If you mean a software decimal counter, you could do something like this:
counter var nib(4) i var nib for i = 0 to 3 ' least significant digit is #0 counter(i) = counter(i) + 1 ' carry in if counter(i) > 9 then ' is there carry to next digit? counter(i) = 0 ' if so, wrap counter around to zero else goto exit ' quit early because no carry endif next exit:Howard
www.GarageDoorValet.com