Writing specialised functions for the timer registers

Assignment Help Other Subject
Reference no: EM133751239 , Length: word count:2000

Advanced Embedded Systems

Task: Writing specialised functions for the Timer registers on the SAMD21G18A MCU on the Arduino Nano 33 IOT

Introduction
In event driven embedded programming, timing is a critical factor. Most of us using Arduino would use the delay(ms) function which takes arguments as number of milliseconds. The delay() function directly access the timers through the timer setup and timer control registers. What if we need a higher resolution in timing, for example 10.5 milliseconds? Can this be achieved? In this task, we look deeper at exactly how timers are configured to achieve the required functions.

Task:

In this task, you will write your own C-functions to directly access, configure and control the timer registers of the SAMD21G18A MCU. You will need to refer to the SAMD21G18A MCU datasheet. This task builds on Task 2.0, so you may want to complete that task first before attempting this one. The task is as follows:

Develop and write a class in C called TIMER_DEAKIN which contains the following methods:
config_timer(xxx) to configure and separately use 16-bit timers. The input arguments will be the timer number, the starting count value, the ending count value and the timer resolution in 0.1ms ticks. The method returns true if the configuration is successful and false otherwise. Ensure you select the appropriate data types for the input arguments, giving reasons why.
For each timer, write a method to return the value of the timer counter. For example, for TC0, you can name your method getTC0_count() to return the timer counter value. Consider what the return value should be. How many timers does the MCU SAMD21G18A have for the Arduino Nano 33 IoT to use?
Now write your own method called wait() that takes as its argument the period in terms of 0.1 ms. Note this is different to delay(ms) in Arduino C. You will need to configure the appropriate timer to use without interfering with the existing timers used for the Nano.

Modify the Arduino program to blink an LED using your developed class TIMER_DEAKIN and demonstrates that it works. This program can only use methods developed in GPIO_DEAKIN and TIMER _DEAKIN classes. The new methods developed by you in this task must directly write to the relevant timer registers and not use the default Arduino timer functions such as delay().

Reference no: EM133751239

Questions Cloud

Describe a significant organizational change : Describe a significant organizational change that you have witnessed or been a part of. Discuss its origins, impacts, and outcomes.
Prescribed protease inhibitor : A client has been newly diagnosed with HIV, and is prescribed a protease inhibitor.
Treated for exacerbation of chronic bronchitis : The client is being treated for an exacerbation of chronic bronchitis. He had been treated unsuccessfully on an outpatient basis.
Explain the lesson plan and your rationale for each activity : ECE 405- Explain the lesson plan and your rationale for each activity. Describe the literature you would use and how you would specifically use it.
Writing specialised functions for the timer registers : SIT329 Advanced Embedded Systems, Deakin University - Writing specialised functions for the Timer registers on the SAMD21G18A MCU on the Arduino Nano 33 IOT
Make optimal decisions about patient care : Describe the role of the nurse practitioner in providing evidence-based practice to make optimal decisions about patient care.
Describe all relevant variable that you will use in analysis : Describe all relevant variables that you will use in your analysis. Be sure to say which are categorical or quantitative.
Nurse is administering alteplase to client : A nurse is administering alteplase to a client. Which of the following are the nursing interventions before, during, and after IV administration of alteplase?
Explain your ideas by writing a summary paper : Based on your table, explain your ideas by writing a summary paper. Your essay should be 1500 to 1750 words and should include at least five citations.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd