Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

asigning a range of count to registers

Status
Not open for further replies.

matlark

New Member
Hello,
I am trying to get a particular die value (1-36) in BCD. I was going to assign a register to 00001001 (register =combo 1), 00001010 (register =combo 2), 00001011 (register= combo 3), etc. I was figuring to use the tmr0 and assign count value of 0-6 to combo 1, 7-13 combo 2, etc. So when a button is pushed, whatever count value is in will read the register associated with that particular value. How do I do this? Thanks
 
I was figuring to use the tmr0 and assign count value of 0-6 to combo 1, 7-13 combo 2, etc. So when a button is pushed, whatever count value is in will read the register associated with that particular value. How do I do this?

To detect the number of button press counts I'll simply increment a single register when each time the button is pressed.And after released the button I'll take that register & reads how many counts in that.

To detect how many counts in that register ex:if 1-6 counts I'll subtract " 6" from that count register & checks the "carry" bit of that result.
 
Are you actually trying to create kind of a random value generator?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top