Executing instance of a task function

Assignment Help C/C++ Programming
Reference no: EM132488495

HOMEWORK-1

Difference between a task and a task function a task is an "executing instance" of a task function; a task occupies memory with its own stack space and text space; whereas a task function is simply a template for how to construct a task in memory

EXERCISE: modify board.h/board.c so that we can access the LPC1769 red and blue LEDs

GPIOs are bit-mapped in an embedded system--- there is a register corresponding to each GPIO port; each BIT of the register corresponds to one of the GPIO pins
for reference: Red LED (P0.22), Green LED (P3.25), Blue LED (P3.26)
be careful how you modify your board.h/board.c libraries because others will use them! --- you will find these libraries in the lpcboard1769 project !
We are dealing with two APIs:
1) NXP LPCXpresso API
2) FreeRTOS API
Please download the tutorial video on changing the NXP board driver code (Part 1), found on the github repository...
Part 2 video just uploaded! Please watch as well...
Please download "getting started with FreeRTOS Blinky" video and watch...
Note that FreeRTOSConfig.h is a "local" parameters file that is specific to a project (in other words, it's "your file" rather than a part of the FreeRTOS API)
FreeRTOS special API delay functions: vTaskDelay(), vTaskDelayUntil() --- these are ways to put a task in Block state
from task.h:
#define tskIDLE_PRIORITY( ( unsigned portBASE_TYPE ) 0U )
If you use a for-loop instead of vTaskDelay() or vTaskDelayUntil() to create a time delay, your task does not go into Block state. Remember that Block means that the task does not need to run for a particular length of time. In other words, if your highest priority task does not have a vTaskDelay() or vTaskDelayUntil() call in it, it will never allow another task to run!
In FreeRTOS, you must make the task Block state EXPLICIT! You need to use the API functions like vTaskDelay() or vTaskDelayUntil() to create a Block state.
Homework:
Compose a FreeRTOS application that flashes the LPC1769 RGB LED as follows:
0) all LEDs OFF
1) RED LED On for 1 second
2) all LEDs are off 0.5 seconds
3) GREEN LED On for 1 second
4) all LEDs are off 0.5 seconds
5) BLUE LED On for 1 second
6) all LEDs are off for 0.5 seconds
7) go to 1)
NOTE: there can be no color overlapping. While any given colour is on, there is no other colour on.
Do it using THREE LED task functions and THREE LED tasks. Moreover, you must prioritize the tasks as follows:
RED LED Task priority = 3
GREEN LED Task priority = 2
BLUE LED Task priority = 1
HINT: Use vTaskDelay() in each task to help you accomplish this--- it may be helpful to draw out a timing diagram for this problem!!!

HOMEWORK-2

FreeRTOS Enhanced Blinky Project

Now that you're getting a handle on FreeRTOS applications, your next assignment should take your embedded-C RTOS skills another step higher.

See if you can refine your non-overlapping-colours Blinky project so that only one task function is needed (you will need to use pvParameters). Strive to make your code as streamlined as possible.

Next, for periodic applications, vTaskDelayUntil() is preferred, because it operates on a kind of absolute clock (rather than relative to when it was last called). Read up on vTaskDelayUntil() in the Mastering FreeRTOS documentation, and modify your code to incorporate this function, rather than vTaskDelay().

Finally, look into incorporating two buttons in your project. Look at the schematic of the LPC1769 board provided in the documentation folder of the teaching repository on github.com. Identify two GPIOs that you can use for push buttons. Check out board.h/board.c to identify suitable API functions to setup your GPIO pins as inputs and include (if possible) internal pull-up or pull-down resistors. Now, designate one button to increase the 0.5-second sampling period of this application. The other button should decrease the interval. Use steps corresponding to 125-milliseconds, and the minimum allowed sampling period should be 0.125 seconds (corresponding to 125 ticks). Allow a user to adjust the period of your program and record the results.

Attachment:- Homework - task and a task function.rar

Reference no: EM132488495

Questions Cloud

Distinction between the short run and the long run : a) A phone cost J$100,000 in Jamaica and US$680 in the US. e = US $0.0074 per JA $1. Calculate the real exchange rate.
What are the buyers and sellers choke prices : What are the buyers' and sellers' choke prices in your graph? How can you find those same choke prices by looking at the inverse demand and inverse supply
Determine the book value of the furniture : Determine the book value of the furniture and fixtures on the date of exchange. Record the journal entry Gameplay would make for this exchange
Calculate the firm profit function : Suppose there are 1,000 identical firms producing diamonds and the total cost curve for each firm is given by: C = q2 + wq where q is the firm's output level
Executing instance of a task function : Difference between a task and a task function a task is an "executing instance" of a task function - FreeRTOS Enhanced Blinky Project
Profit maximizing quantity for the individual firm : Calculate the profit maximizing quantity for the individual firm. Calculate the firm's short run profit(loss) at that quantity, and the firm's producer surplus.
Determine the cost of goods sold for each sale : Determine the cost of goods sold for each sale and the inventory balance after each sale, presenting the data in the form illustrated
Calculate washed waters capital expenditure : Calculate Washed Water's capital expenditure. Washed Water, a technology manufacturer that produces water purification products
Prepare the journal entry to record the note on september : Prepare the journal entry to record the note on September 1. Many businesses borrow money during periods of increased business activity

Reviews

len2488495

4/8/2020 4:05:42 AM

Hi I am attaching the word file of my assignment. There are two homework in this file named Homework 1 and homework 2 . I need solution for homework 2 but I am sending you homework 1 also as it will help you because both are interlinked

Write a Review

C/C++ Programming Questions & Answers

  Determine whether or not there is data pertaining

For each employee you are to compute the number of overtime hours worked by that employee, the salary, and the overtime pay. An employee earns straight time for the first forty hours of work, time-and-a-half for up to the first 10 hours in excess ..

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  Definition of two queues

Write a code in C language for the definition of two queues, one to hold the process in ready state and one to hold the process in waiting state.

  How many whole numbers they wish to enter

Write a program, which will ask the user how many whole numbers they wish to enter. The program will then read that many numbers, print them in the order they were entered, sort them in order by increasing value, and print them in sorted order.

  Rewrite the scanner class in package ast

Rewrite the Scanner class in package ast5 so that it has an instance variable of type java.io.StreamTokenizer. The Scanner should use the StreamTokenizer.

  Write a program to find value of sin

Write a program to find value of sin(x) using expansion series given below by using a function.

  Calculating the gcd greatest common divisor

Write a C++ code for calculating the GCD Greatest Common Divisor between two positive integer numbers. You  should  use Euclid's  original  subtraction  based  GCD algorithm ( not  using  modulo operator).

  Implement a varying-sized two-dimensional array

You can implement a varying-sized two-dimensional array data member of a class by using allocation on the stack of a fixed maximum number of rows.

  Make a class constructor that initializes a customer

Make a class constructor that initializes a customer with a name, number, and order size.Make class member functions to print each of: name, number, and order size.

  Check the product code and calculate the amount

Instead of getting the product names and prices from the standard input, enhance the program to read it from a file instead

  How is the scope resolution operator use in class definition

How and why is the scope resolution operator :: used in class definitions? Which member functions are created automatically by the compiler if they are not included (by the programmer) in the class definition?

  Converting the raw score to a percentage

How to code a C++ program that reads data from an input file, takes the data and computes student grades for an assignment by converting the raw score

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