Hi Caisson, Thanks for your attention. -----Mensagem Original----- De: Caisson Para: Enviada em: Terga-feira, 21 de Setembro de 1999 04:37 Assunto: Re: Increment/Decrement a 16 bit number > Van: Anbar > Aan: PICLIST@MITVMA.MIT.EDU > Onderwerp: Increment/Decrement a 16 bit number > Datum: maandag 20 september 1999 10:45 > > > Hi ! > > How can I get a 16 bit number in the PIC16F84? I 'll inc/dec the number > and > > I have to save It. For exemple: > > If I get a number like D '400' , how can I save It. I 'll need this > because > > in pin out of the PIC when a press a button of start, I will take a 400 > > pulses out. > > Thanks in advance. > > AnBar > > Hello Anbar, > > How do you store numbers above 9 ? Like the number 35 for example. You > store it as a "3" and a "5", where the "3" means 3 groups of 10. So, the > number 35 means 3 groups of 10 plus 5. This goes for a number with base 10 > ofcourse :-) > > If you have a number with base 256, a number like 400 will be written as 1 > group of 256 and 144. Or, in Hexa-decimal 190. This means you will need > *two* bytes. > > Creating a loop with two 8-bit counters (creating one 16-bit counter) goes > alike the counting-down of a decimal number. 21 goes to 20. 20 goes to > 19. If you can't decrement the right-most digit anymore (it's Zero), you > set it to the highest value, and decrement the digit next to it on the > right. The same goes for Bytes. 0201 goes to 0200. 0200 goes to 01FF. > > Greetz, > Rudy Wieser