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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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