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. 


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


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


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.


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.



FreeRTOS LCD Interfacing with LPC2148


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

0 0 vote
Article Rating
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Newest Most Voted
Inline Feedbacks
View all comments
November 21, 2017 11:22 PM

We are getting an error in a code..
__initail_st is undefined..please help

March 11, 2020 12:16 PM

code stuck at vTimeDelay function please help me thanks in advance.

Reply to  sumit
April 1, 2020 2:11 AM

Hi Sumit,
What is the argument that you are passing to that vTimeDelay function?

Would love your thoughts, please comment.x
%d bloggers like this: