{"id":1425,"date":"2024-06-25T14:36:59","date_gmt":"2024-06-25T14:36:59","guid":{"rendered":"https:\/\/iotthinghub.com\/?p=1425"},"modified":"2024-08-11T15:43:39","modified_gmt":"2024-08-11T15:43:39","slug":"timer-counter-basic","status":"publish","type":"post","link":"https:\/\/iotthinghub.com\/?p=1425","title":{"rendered":"Timer\/Counter \u2013 Basic"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1425\" class=\"elementor elementor-1425\">\n\t\t\t\t<div class=\"elementor-element elementor-element-2362e47 e-flex e-con-boxed e-con e-parent\" data-id=\"2362e47\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-92f582c elementor-widget elementor-widget-text-editor\" data-id=\"92f582c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>A Timer\/Counter is actually a register which increases\/decreases automatically according to the logic you provided. In AVR there are two types of timers<\/p><ol><li>8 Bit timer<\/li><li>16 Bit timer<\/li><\/ol><p>Now what is the meaning of 8bits? As we already learn that 1byte is equal to 8bit. Now the formula of counting is-<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 n bit=2^n So 8 bit= 2^8=256<\/p><p>In real world we begin our counting from 1, but in computer world the counting begins from 0. So that in 8 bit the counting begin from 0 and the maximum value is 255 or in number from 0b11111111\/0xFF. So those in 16 bit counters the counting begins from 0 or 0x0000 and maximum value 65535 or 0xFFFF. The whole operation of Timer\/Counter depends on three elements-<\/p><ul><li>BOTTOM-The counter reaches the BOTTOM when it becomes 0x00<\/li><li>MAX- The counter reaches its MAXimum when it becomes 0xFF (8 bit Timer) or 0xFFFF (16 bit timer).<\/li><li>TOP- The counter reaches the top when it becomes equal to the highest value in the count sequence. The TOP value can be assigned to one of the fixed values : 0x00FF, 0x01FF or 0x03FF, or to the value stored in the OCRA or OCRx register of 16 bit counter\/ the TOP can be value assigned 0xFF or the value store in the OCRx register for 8 bit counter.<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6a35540 elementor-widget elementor-widget-text-editor\" data-id=\"6a35540\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><img decoding=\"async\" class=\"alignleft wp-image-1430\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/math-function-300x37.jpg\" alt=\"\" width=\"120\" height=\"15\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/math-function-300x37.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/math-function.jpg 345w\" sizes=\"(max-width: 120px) 100vw, 120px\" \/>Here come the fuse bit set up and F_CPU part. In makefile we can see the F_CPU. By default ATmega32 has F_CPU= 1MHz=1000000Hz and ATmega8 has F_CPU=8MHz=8000000Hz in internal oscillator. For proper operation it is necessary to set the HFUSE and LFUSE bit or we can calculate from default F_CPU value. The frequency of internal oscillator is not perfectly equal to the external crystal oscillator. There are counting error occur in internal oscillator, but external oscillator is nearly give the correct frequency. It is advise you to use the external crystal oscillator and make an appropriate setting to FUSE bit, since it set once and no need to set every time. For crystal setting The FUSE bit as follow-<\/p><h5><strong>HFUSE=0xc9 &amp; LFUSE=0xEF<\/strong><\/h5><p>The relationship between time and frequency is<\/p><h6>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 T=1\/ (F_CPU) s =1\/(F_CPU\/Prescaling ) s = Prescaling\/ F_CPU s<\/h6><p>Here prescaler is nothing but division factor of main scale. We will discuss later about prescaler. The maximum count is-<\/p><h6><strong><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Maximum count time = (Prescaler\/F_CPU)*(2^n) where n= 8bit or 16bit\u00a0<\/em><\/strong><\/h6><p>After maximum count the timer start from zero and this is timer overflow, i.e. for F_CPU=8HHz, prescaler = 1024 and 8bit timer\u00a0<\/p><h6><strong><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0Maximum count time= (1024\/8MHz)*(2^8) <\/em><\/strong><strong><em>=32.768ms<\/em><\/strong><\/h6><p>If our desire millisecond is less than the overflow, then we can calculate required delay as follow-\u00a0<\/p><h6><strong><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Required delay time=(prescaler\/F_CPU)*(Timer Count +1)\u00a0 <\/em><\/strong><\/h6><h6><strong><em>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0or, Timer count = Required delay *(F_CPU\/Prescaler)-1<\/em><\/strong><\/h6><p>Let\u2019s begin our journey with 8bit timer (timer0). Here the available register for Timer0<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-b39767a e-grid e-con-boxed e-con e-parent\" data-id=\"b39767a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-c6cfb70 elementor-widget elementor-widget-image\" data-id=\"c6cfb70\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"590\" height=\"749\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer11.png\" class=\"attachment-full size-full wp-image-1455\" alt=\"\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer11.png 590w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer11-236x300.png 236w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-98a4a78 e-flex e-con-boxed e-con e-parent\" data-id=\"98a4a78\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f66a6b6 elementor-widget elementor-widget-text-editor\" data-id=\"f66a6b6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h6><strong>Timer\/Counter Register \u2013 TCNT0<\/strong><\/h6><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 8 bit register. If we assign some value say 0x3F than TCNT0 start counting from zero and end at 0x3F.<\/p><h6><strong>Output Compare Register \u2013 OCR0<\/strong><\/h6><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 The output compare register contains an 8bit value that is continuously compared with the TCNT0 value. A match can be used to generate an output compare interrupt or to generate a waveform output to the OC0 pin.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-024a2a4 elementor-widget elementor-widget-image\" data-id=\"024a2a4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"590\" height=\"418\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer12.png\" class=\"attachment-full size-full wp-image-1462\" alt=\"\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer12.png 590w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/timer12-300x213.png 300w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-5716868 e-flex e-con-boxed e-con e-parent\" data-id=\"5716868\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-64c2a47 elementor-widget elementor-widget-text-editor\" data-id=\"64c2a47\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Note that all the flag registers bit is set (1) when the corresponding Interrupt occurs and it is cleared by hardware when executing the corresponding interrupt handling vector. It can also clear by writing one to it.<\/p><p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 In this article we discuss about the timer compare and overflow mode. In the normal mode operation \u00e0WGM00 and WGM01 clear. We already develop the timer count for require delay<\/p><h6>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>Timer count=(Required delay )*(F_CPU\/Prescaler)-1<\/em><\/strong><\/h6><p>Let make a 100ms delay with Timer0 and we have a crystal of 1MHz and prescaler 1024, then<\/p><h6>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <strong><em>Timer count=(100ms)*(1MHz\/1024)-1 <\/em><\/strong><strong><em>=96.65 \u224897<\/em><\/strong><\/h6><p>Let\u2019s make a program to Toggle PORTC of ATmega32 after 100ms delay. The coding is as follow-<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-64af3e5 elementor-widget__width-initial elementor-widget elementor-widget-image\" data-id=\"64af3e5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"878\" height=\"552\" src=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/program-Timer0.jpg\" class=\"attachment-full size-full wp-image-1473\" alt=\"\" srcset=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/program-Timer0.jpg 878w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/program-Timer0-300x189.jpg 300w, https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/06\/program-Timer0-768x483.jpg 768w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-6889099 e-grid e-con-boxed e-con e-parent\" data-id=\"6889099\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-5ce1b40 elementor-widget elementor-widget-text-editor\" data-id=\"5ce1b40\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>We also develop with Timer1 and Timer2. Download the programs and you will understand what happen.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-1b87e99 e-flex e-con-boxed e-con e-parent\" data-id=\"1b87e99\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-efcce70 e-con-full e-flex e-con e-child\" data-id=\"efcce70\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-38c5b72 elementor-align-center elementor-widget elementor-widget-button\" data-id=\"38c5b72\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer0.rar\" target=\"_blank\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-file-archive\" viewBox=\"0 0 384 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M128.3 160v32h32v-32zm64-96h-32v32h32zm-64 32v32h32V96zm64 32h-32v32h32zm177.6-30.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h79.7v16h32V48H208v104c0 13.3 10.7 24 24 24h104zM194.2 265.7c-1.1-5.6-6-9.7-11.8-9.7h-22.1v-32h-32v32l-19.7 97.1C102 385.6 126.8 416 160 416c33.1 0 57.9-30.2 51.5-62.6zm-33.9 124.4c-17.9 0-32.4-12.1-32.4-27s14.5-27 32.4-27 32.4 12.1 32.4 27-14.5 27-32.4 27zm32-198.1h-32v32h32z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">download<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-3204cb8 e-con-full e-flex e-con e-child\" data-id=\"3204cb8\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1f17eb8 elementor-widget elementor-widget-heading\" data-id=\"1f17eb8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer0.rar\" target=\"_blank\">Download Timer0.rar with proteus simulation<\/a><\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-75159d1 e-flex e-con-boxed e-con e-parent\" data-id=\"75159d1\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-2850c6a e-con-full e-flex e-con e-child\" data-id=\"2850c6a\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e1512fa elementor-align-center elementor-widget elementor-widget-button\" data-id=\"e1512fa\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer1.rar\" target=\"_blank\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-file-archive\" viewBox=\"0 0 384 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M128.3 160v32h32v-32zm64-96h-32v32h32zm-64 32v32h32V96zm64 32h-32v32h32zm177.6-30.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h79.7v16h32V48H208v104c0 13.3 10.7 24 24 24h104zM194.2 265.7c-1.1-5.6-6-9.7-11.8-9.7h-22.1v-32h-32v32l-19.7 97.1C102 385.6 126.8 416 160 416c33.1 0 57.9-30.2 51.5-62.6zm-33.9 124.4c-17.9 0-32.4-12.1-32.4-27s14.5-27 32.4-27 32.4 12.1 32.4 27-14.5 27-32.4 27zm32-198.1h-32v32h32z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">download<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-36ddf2d e-con-full e-flex e-con e-child\" data-id=\"36ddf2d\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-28620b5 elementor-widget elementor-widget-heading\" data-id=\"28620b5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer1.rar\" target=\"_blank\">Download Timer1.rar with proteus simulation<\/a><\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2469170 e-flex e-con-boxed e-con e-parent\" data-id=\"2469170\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div class=\"elementor-element elementor-element-e078b1e e-con-full e-flex e-con e-child\" data-id=\"e078b1e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-f48d3d9 elementor-align-center elementor-widget elementor-widget-button\" data-id=\"f48d3d9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer2.rar\" target=\"_blank\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t<span class=\"elementor-button-icon\">\n\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-far-file-archive\" viewBox=\"0 0 384 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M128.3 160v32h32v-32zm64-96h-32v32h32zm-64 32v32h32V96zm64 32h-32v32h32zm177.6-30.1L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM256 51.9l76.1 76.1H256zM336 464H48V48h79.7v16h32V48H208v104c0 13.3 10.7 24 24 24h104zM194.2 265.7c-1.1-5.6-6-9.7-11.8-9.7h-22.1v-32h-32v32l-19.7 97.1C102 385.6 126.8 416 160 416c33.1 0 57.9-30.2 51.5-62.6zm-33.9 124.4c-17.9 0-32.4-12.1-32.4-27s14.5-27 32.4-27 32.4 12.1 32.4 27-14.5 27-32.4 27zm32-198.1h-32v32h32z\"><\/path><\/svg>\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">download<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div class=\"elementor-element elementor-element-2024d7c e-con-full e-flex e-con e-child\" data-id=\"2024d7c\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-8ff3f36 elementor-widget elementor-widget-heading\" data-id=\"8ff3f36\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\"><a href=\"https:\/\/iotthinghub.com\/wp-content\/uploads\/2024\/08\/Timer2.rar\" target=\"_blank\">Download Timer2.rar with proteus simulation<\/a><\/h5>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>A Timer\/Counter is actually a register which increases\/decreases automatically according to the logic you provided. In AVR there are two types of timers 8 Bit timer 16 Bit timer Now what is the meaning of 8bits? As we already learn that 1byte is equal to 8bit. Now the formula of counting is- \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 n bit=2^n [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-1425","post","type-post","status-publish","format-standard","hentry","category-timer-counter"],"_links":{"self":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1425","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1425"}],"version-history":[{"count":97,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1425\/revisions"}],"predecessor-version":[{"id":2581,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=\/wp\/v2\/posts\/1425\/revisions\/2581"}],"wp:attachment":[{"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1425"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1425"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iotthinghub.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1425"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}