- This topic has 1 reply, 2 voices, and was last updated 12 years, 6 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › help to programing 8051 timer
Hi !! i just want to know how do you do,to load thx e tlx with a number to create an delay. If i want to make a 20ms of delay how can i have the number for THX and TLX???
Your timer module get a clock for every 4(I guess) cloks from the crystal oscillator.
And you know the time period of the crystal you are using. Just divide that time period with 4 to get the time period of clock which goes to the timer module.
Now as you need 20ms time period, just calculate how many clocks you need. Set the register values in such a way that it will overflow and generate an interrupt after that much clocks.
Learn the datasheet for more clear and detailed information.