راه اندازی Timer Match میکروکنترلر LPC1768

پنج شنبه 06 اسفند 1394  •  دسته بندی: lpc17  •  بازدیدها: 1445  •  برچسب ها: |

هدف


این مثال نشان می دهد که چطور می توانید با استفاده از Timer Match  زمان های مشخص و دقیقی را در مد pollingایجاد بکنید.


نحوه ی کار

در این حالت زمان ایجاد شده 1 ثانیه است.

Timer configuration:

            - Timer channel: 0

            - Prescaler in microsecond value

            - prescaler value = 100us

Match configuration:

            - Use channel 0, MR0

            - Match value = 1000

            Because timer tick = prescaler = 100us

            So match time = 100 * 1000 = 100000us = 100ms

            - Timer reset after match

            - Not stop MR0 when match

            - Toggle MR0.0 when match

            Because match time = 100ms

            So MAT0.0 will be toggled at frequency = 10Hz

            - Generate match interrupt

با استفاده از تابع TIM_GetIntStatus منتظ می ماند تا فلک وقفه ی مربوط به MRO  یک بشه.هنگامیکه مقدار MRO  با مقدار تایمر کانتر برابر بشه فلک وقفه ی MR0I یک میشه و برنامه ار حلقه ی لوپ بیرون میاد و یک پیام با استفاده از سریال ارسال می کند و LED D2  برد اموزشی روشن و خاموش می شود.

نکته: دقت بکنید که هنگامیک زمان Match  خیلی کوچیک باشه اگر از پرتکل سریال استفاده بکنید باعث میشه یک Delay  به وجود بیاد.

این مطلب را به اشتراک بگذارید:

در این باره 1 نظر وجود دارد، شما هم نظر خود را ثبت کنید.
نام:
ایمیل:
نظر:

تعداد کل نظرها: 1

Stevenorary:
شنبه 16 اردیبهشت 1396 ساعت 12:34:28
Larry Fitzgerald has seen a allotment of the world.
Conditions he's helping others see it, too, according to a piece http://www.arizonacardinalsteamonline.com/larry-fitzgerald-jersey in Condé Nast.
The Arizona Cardinals wide receiver has his own company, Nomad Hill, "a Fraternize Design company dedicated to creating life-changing experiences quest of our guests."
Condé Nast Traveler profiled Fitzgerald and the coterie in a plot outline published Monday.
Anna Katherine Clemmons offers an inside of look at Fitzgerald and the entourage in the story.
She writes:
"When his off-season begins, the 33-year-old Minnesota native chooses contemporary places to attack while also scheduling returns to favorite spots, like Tanzania. But whether it’s his senior or fifth anon a punctually visiting, Fitzgerald doesn’t hardly vegetate on a bank or meet in a b & b with a room serve menu.
'“I’m a history guy, and I disposition really getting to know the people in the countries that I’m visiting,” Fitzgerald said in the story. “I like to push myself false front of my comfort zone.”'
Fitzgerald's sweetheart instead of travel has been correctly documented in all respects the years.
In 2015, he sat down with us to talk on every side visiting the Kremlin, surfing volcanoes in Nicaragua and his terminal http://www.arizonacardinalsteamonline.com/larry-fitzgerald-jersey vacation.
"I haven't gone to duration nevertheless," Fitzgerald said. "That's for all on my bucket list."
Among Fitzgerald's travels:
He explored Asia to save 45 days via himself after his key NFL season.
He took trips with his family on all sides of the Collective States growing up, visiting Mount Rushmore, Yellowstone Popular Parkland and Glacier National Greensward, bulk other sites.
He's visited Cambodia and biked across Vietnam.
He's been to the Siwa Fertile patch in Egypt.
He's ventured to Ethiopia, where he helped farmers with irrigation during a drought.
He's met and talked with a CIA operative in Russia, and had samurai sword lessons in Japan.
The gathering:
In July 2016, Fitzgerald launched Nomad Hill with David Jones, a <a href=http://www.arizonacardinalsteamonline.com/larry-fitzgerald-jersey><b>larry fitzgerald jersey</b></a> constant traveler whom Fitzgerald met not quite seven years ago.
The suite offers millennials more immersive vacations.
“The journey industry, especially in the acute outcome, has radical the millennial to themselves because they don’t comprehend how to agreement with them,” Jones said in the Condé Nast Traveler story. “It’s a differing population. It’s not just about affluent on a spell; it’s in experiences. They impecuniousness to be occupied in their experiences because they’ve been occupied in what they’ve done their healthy life.”
“I like to to forbidden and plunge around, and David is the unaltered way,” Fitzgerald told Condé Nast Traveler. “I appear like I am a nomad.” http://www.footballofficialsauthentic.com/ http://www.artsneed.com http://www.basketballofficialauthentic.com/