FreeRTOS – LPC2148 (LCD Scroll and LED Blinking)

Hi Guys…….. Today i came with new tutorial (FreeRTOS LCD Interfacing with LPC2148). Before that you should know How to interface  and with LPC2148. 

Prerequisites

Before we will start i would suggest you to read these topics. Then only you can understand this strongly. If you already know, please go ahead.

FreeRTOS LCD Interfacing with LPC2148

Introduction

We already know why we are using RTOS. Because we can develop multi threads in RTOS whereas without RTOS we cant. Create the RTOS project. Here I’ve created two threads.

  1. LED blinking
  2. LCD scroll

Connections

LED Blinking

LED is connected into Port 0.8 to P0.15. This thread will blink the LEDs.

LCD Scroll

LCD is connected into Port 1.

Before that, FreeRTOS has many API. Here we are going to use API for Task creating and Delay.

FreeRTOS APIs

xTaskCreate()  API

            This FreeRTOS API is used to create a task. Using this API we can create more number of tasks.

portBASE_TYPE xTaskCreate  (      pdTASK_CODE pvTaskCode,

                                  const signed portCHAR * const pcName,

                                  unsigned portSHORT usStackDepth,

                                  void *pvParameters,

                                  unsigned portBASE_TYPE uxPriority,

                                  xTaskHandle *pxCreatedTask );

 

  • pvTaskCode: a pointer to the function where the task is implemented. (Address of the fuction)
  • pcName: given name to the task. This is useless to FreeRTOS but is intented to debugging purpose only.
  • usStackDepth: length of the stack for this task in words. The actual size of the stack depends on the micro controller.
  • pvParameters: a pointer to arguments given to the task.
  • uxPriority: priority given to the task, a number between 0 and MAX_PRIORITIES – 1.
  • pxCreatedTask: a pointer to an identifier that allows to handle the task. If the task does not have to be handled in the future, this can be leaved NULL.

VtaskDelay() API

            We are using this API for delay purpose.

 

Now go through the code.

CODE

OUTPUT

lcd-2 FreeRTOS - LPC2148 (LCD Scroll and LED Blinking)

 

If you have any doubt in this please ask us by commenting below. Thank you.

Download our new Android app. You can learn all Embedded Tutorials from your Android Phone easily.

Click Here to Download App!