I have setup Timer1 and it is outputting a steady stream of pulses. Now I want to change the speed of the pulses in steps of 2X, 4X, 8X, 16X etc. I am working in Assembler
I have played with developing the number and saving it in the EEPROM and calling it and loading it into the timer1 registers. This will work no problem. However I am wondering if I can take the number for the original pulse rate and shift it right once for 2X, twice for 4X etc.
I know how to do this with an 8 bit number but this is working on only one register. Now with a 16 bit number it is two registers! I have read about shifts and carries and my head hurts.
So my question is how does one do a divide by 2 on a 16 bit number? Or should I not be trying to be so clever and go with the original plan?
Can I do this operation on the OCR1AH and OCR1AL registers directly or do you have to do this in R24/25 and load the result into OCR1AH/L?