Re: asistance am in hot waters
Hi,
You should provide complete informations:
* what microcontroller
* link to datasheet
* what section/page do you refer to
What did you do so far?
What are the results?
Where exactely is the problem?
****
Your first job is to re-arrange the formula and solve it for "TMR0" value.
1ms = (256 - TMR0)(1us)(1)
* the (1) is useless and may be omitted
* "1ms" may be replaced with 1000us
* you may add a "×" between tge brackets
--> 1000us = (256 - TMR0) × 1us
* divide both sides with "1us"
--> 1000us / 1us = 256 - TMR0
--> 1000 = 256 - TMR0
* subtract 256 on both sides
--> 1000 - 256 = - TMR0
--> 744 = - TMR0
* subtract 744 on both sides, add TMR0 on both sides
--> TMR0 = - 744
Most probably (we don't know microcontroller type) your valid range is 0...255 (uint8), and thus you can't work with -744.
Therefore I assume (again we don't know what the datasheet says) you need to work with prescalers.
Klaus