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.

16-bit counter pic16f877 problem

Status
Not open for further replies.

krpz

New Member
I want to use the pic16f877 to count from 1 to 10000 so i need 2x 8 bit registers. I increment one of the register (the low part) in a loop and when i arrive to 0xFF i jump to another loop that increment one the high bit and then go back to low bit. But when the counter is in the 0x00FF the next number is 0x0100. Is there a way to change both of the registers in the same time because in my code first the low bit become 0x00 and then the high bit 0x01.

Thanks.
 
loop:
..increment count_low
.....IF =00 then increment count_high (if carry bit =1 then inc. count_high)
.
.
.
go to Loop
 
Thanks for the tip jpanhalt but i dont know how to do this, do you have in your mind a tutorial??
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top