Embedded C Programming Using FRDM to Enhance Engineering Students’ Learning Skill

Computer programming course that utilizes languages such as C/C++ is always packed with dreary syntax details that consume most of the students’ learning time to obtain ‘grammatically’ correct source code. Consequently, it is difficult for most of the students to apply the theory they have learned in a real life context. Thus, this project proposed a hardware based learning approach for C programming curriculum and reports the effectiveness of using microcontroller board named FRDM-KL05Z to assist teaching and learning activities. The USB-powered microcontroller board is very easy to use and is programmable using C programming language. Students will have the opportunity to learn selection statement with real sensors, touse repetition statement to blink LEDs and utilizing function as well as structure to control actual input and output peripherals. In general we evaluated the students’ response in five criteria namely the students attributes, lecturer’s profile, implementation, facilities and students’ understanding. From the survey, the results in exit survey are higher compared to entrance survey for all criteria. This shows that the students are satisfied with the implementation of the module which has increased their understanding in learning C Programming.


Introduction
Many educators realize the urgency of education reform to respond to the current needs and future trends of the society. The urge of re-engineering the curriculum is needed for new approaches in designing the curriculum and active learning methods for encouraging students to be more creative. Responding to these calls for education reform, this study was conducted as an extension of work originally presented in IEEE 8th International Conference on Engineering Education (ICEED2016) [1]. Projectbased learning (PBL) and "learning by doing"approach have been recognized as one of the effective means for students to obtain the problem-solving capability [2][3].
Another method in learning approach for engineering students is embedded system education. Teaching embedded system design is a challenging undertaking because a teacher cannot assume that all students enrolled in a class have solid prerequisite knowledge across all these areas. To speed up the learning process and motivate students to learn actively, the project-based learning approach [4][5][6][7] is applied in this embedded system design laboratory.
Introduction to the C programming is one of the basic elements in Electrical engineering course. The subject currently is offered in semester 2 [8], and it contains 7 chapters. Each chapter introduces the student with basic command of C programming to execute specific task such as compiling, linking, control flow statement, function and array [9]. The students will be evaluated based on the laboratory task which is only a computer-based laboratory, test that covers theoretical part of the syllabus and mini project. The main objective of the mini project is to gauge the understanding of students in the overall C programming course.
C programming is one of the most important subjects in Electrical Engineering course. However, the process of teaching and learning a programming subject is not an easy task as stated by many studies [10]. Students were reportedly having problem in grasping this subject due to the complex nature of this subject. The development of a program involves similar step like any problem-ASTESJ ISSN: 2415-6698 solving task. The processes include definition of the problem, planning of the solution, coding the program, testing the program and documenting the program. Thus, the ability to execute the whole flow of the process is very critical for a student in mastering the subject well.
Various methods in teaching and learning programming courses have been reported. As an example, several researchers have come with game-based digital learning for teaching C programming course [11][12]. Other method includes active learning by students, which may include in-class activities like peer learning, games and mnemonics [13][14]. A more advance approach as discussed in [15] described how LEGO Mindstorms robot was used as hands-on educational technology in teaching introductory programming courses. This proves that C programming is a complex subject and it requires creative way of delivering it to students.
More recently, Conceive -Design -Implement -Operate (CDIO) initiative are gaining significant popularity among educators around the world [16]. Authors in [17][18][19][20] reformed their teaching approach in delivering C/C++ curriculum based on CDIO approach.CDIO concept emphasis on the knowledge development by integrating engineering skills such as team cooperation, problem solving, communication andknowledge-application ability of students in real-life context. Results indicated that such initiative can effectively improve the students' ability to comprehend basic knowledge in programming and their applicationin engineering system analysis.
Throughout this course, the main drawback that has been observed by the lecturer is that students having difficulty to implement the theoretical part of the subject into practical. This may be caused by lack of experimental design task exposure. Majority of the students do not have the skill to expand their learning of C programming after finishing this course. This situation can be seen in their final year project course (FYP) where most of the students will use microcontroller in their project and majority of them do not have the ability to apply the C programming knowledge to program the microcontroller to execute the desired task. Therefore, a module has been proposed to help the lecturer to resolve this situation. The module will be included in the students' learning process throughout the semester and it does not change the main objective of the syllabus. This module will only be used as a tool to help the student to gain more knowledge and skill in C programming language.
In fact, the microcontrollers are commonly utilized in numerous industrial applications such as remote control devices, office machines, electrical gadgets, automobiles, motor control systems, robots and other industrial fields. For that reason, it is taught as an applied course at universities, especially in the departments such as engineering of electrical and electronics engineering. Freescale has designed the FRDM-KL05Z in collaboration with MBED for prototyping all sorts of devices, especially those requiring the size and price point offered by Cortex-M0+. It is packaged as a development board with connectors to break out to strip board and breadboard, and includes a built-in USB FLASH programmer.
The aim of this study is to measure the effectiveness of the proposed module which is C programming based on embedded system approach, and the students' perception of this course is also evaluated so that there will be more effective changes that can be made to this course to enhance the student's ability in the real application after their graduate.

Methodology
In order to enhance the students' understanding and interest in Introduction to C Programming (ECE126) subject, a one-day training module was conducted to expose them with the implementation of C-programming as shown in Figure 1.0. During the training, participants were given a set of training materials listed in Table 1.0 so as to boost students' engagement throughout the session, harness their interest and motivate them to use the knowledge learnt in ECE126 curriculum in real-life context. A laptop was used to write a program code in C language. Next, the code was transferred to FRDM board and after that user will run the program from the board. The execution of the code was monitored using a smart phone application in real time via a Bluetooth connection.   Figure 2 depicts the overall programming process carried out during the training session. Participants were taught to write a program code using a web-based MBED compiler. The software can be used to write and edit a program code using high-level languages such as C and C++. Next, a linking process was carried out in which the written code was linked to FRDM-KL05Z controller board or any hardware platform supported by the compiler. After that, the code was compiled and a binary machine code was generated should there be no syntax error. Next, the compiled code was transferred to the board via mass storage device (MSD) flash programming interface. Subsequently, a communication link between the FRDM board and a smart phone was established via HC05 Bluetooth module so that students can observe their program simply through their own smart phones. This approach is slightly different from the current practice where students were normally taught to create a console application that produced an executable file, which can only be used within the Windows environment [21].

FRDM KL05Z controller board
The FRDM-KL05Z microcontroller board depicted in Figure 3 was used in this project. It is one of the ARM Mbed supported platform based on 32-bit ARM Cortex-M processor [21]. It is a powerful tool to build an embedded system from prototyping stage to mass production. One can also write their own software on top of the board's operating system, Mbed OS, which offers an easy way of hardware control, interaction and integration with other tools. It offers convenient on-board sensors such as a touch sensor, an accelerometer and a Red-Yellow-Green (RGB) Light Emitting Diode (LED) that allow new users to practice and test their code without any need of additional hardware interface.

Training Modules
There were seven topics related to ECE126 subject that have been covered during the training session. They include selection statement, repetition, functions, arrays, pointer and structure. These topics were delivered in seven different modules utilizing the on-board peripherals such as the LED, accelerometer and touch sensor. The modules used during the training were listed in Table  II. In the first module, the participants were taught to observe the execution of their program via smartphones using a Bluetooth serial application known as "BT Term" developed by Futaba Inc. A printf() statement was used to output a "hello world!" sentence via the Bluetooth application as depicted in Figure 4. Besides, the second, third and fourth module manipulate the behavior of the on-board RGB LED using several sets of program codes. Students were taught to apply their knowledge on the selection statement to decide on the activation of the LED. Other than that, repetition statements such as while, do-while and for were also employed to create replications of the LED action. Participants were also assigned to blink the LED, in which they need to determine the suitable increment, decrement or assignment operators. Besides, they also learnt how to use break and continue statement to stop the repetition or to skip some iteration within the loop structure. In addition, functions were also been used in module 4 so that the participants can create several set of LED actions according to their preferences. Figure 5 illustrates the use of function to activate the red LED upon receiving value from the user. The program indicates that if a user specifies an input value is equal to 1, the red LED will be activated while red LED will be deactivated if other input value is given. The response of the LED is shown in Figure 6.  Besides, one of the most important topic in C programming such as arrays were also been given much attention during the training session. It has always been useful to store information about certain things under a single variable name. For example, in module 5, students were taught to use such concept to store measured data obtained from the accelerometer sensor every one second into an array variable. Next, they can manipulate the content of each array to do additional action such as activating the LED if certain condition is met. This allows students to think, try and explore more about the concept as well as drawing connections between what have been taught and real-world contexts.
Meanwhile, module 6 focuses on the workings of pointer variable, how to use them as well as the common mistakes faced by a programmer when dealing with it. In this exercise, pointer was used to access a memory location that contains user information. Participants were required to create a login interface that prompt user to input their login ID and password. The program will evaluate the input entered via the serial Bluetooth application before triggering the green LED if correct input is given and red LED if otherwise.
The final module attempted to enlighten the participants about the basic concept of structure in C programming language and how it can be used to hold several information within the same category that share common attributes. Figure 7 demonstrates the use of structure concept to control the brightness of the LED. A structure with a tag named LED was declared in this context and three members named "bright", "medium", and "dim" were defined. The member attributes can be accessed by using "." operator such as "RED.bright" which will provide the variable "LAMP" with 1.0 value. In order to evaluate the approach's acceptability and its effect on learning C programming within the training period, a statistical studies were carried before and after the training program. The results of the survey will be discussed in the following section. Figure 8 shows the bar graph descriptions for Criteria 1 to measure the students attribute towards C Programming subject. As shown in the figure, the mean scores for all questions in exit survey are higher compared to the entrance survey. The students responded that they have better programming skills and sufficient knowledge and understanding in C Programming after the module was implemented.

Results
From the survey, we also measured lecturer's ability in teaching the subject from the students' point of view and the statistic is depicted as in Figure 9 below. The mean scores in exit survey are higher than the entrance survey. Majority of the mean scores for all questions in this criteria are higher than 4.00. This indicates that the students felt that the lecturer is capable of teaching this subject. We also evaluated the effectiveness on how the lecturer implemented the module as shown in Figure 10 below. The mean scores for all questions are higher in exit survey than entrance survey, which are above 4.00. This shows that the students are satisfied with the implementation of the module.
Other than that, the students gave positive response towards the facilities provided during the module session. Figure 11 below shows the statistic of the criteria. The mean scores for equipment space (mean = 4.13) and functionality (mean = 4.10) are higher in the exit survey compared to entrance survey. The survey also tested the students understanding of the module as can be seen in Figure 12 below. From the figure, mostly students gave positive response that the module enhances their understanding of C Programming. This research study was further extended to evaluate the students' response reflecting the module execution and implementation. Figure 13 to 16 below depict the students' responses regarding the overall module assessment. Figure 13 shows the bar graph for Criteria Motivation and Students' interest toward the C Programming. The highest score from this criterion was 'Agree' for all three questions and this shows that they are motivated and interested in learning C Programming.  Figure 14 describes the difficulty of the course from the students response. Majority of the students found that the course was quite challenging which they were struggling to understand and complete the task given.  Figure 15 displays the third criterion which measured the Expectancy for Success among the students. The results shows positive feedback from the students which they believe this course will improve their academic performance. Figure 16 depicts the students response on the implementation of the course. They found that this course was enjoyable and they highly recommend that the course should be more fun and interesting which interactive games can be integrated and real life application can be interfaced.

Conclusions
This paper reports the effectiveness of the implementation of the C Programming module. In general we evaluated the students' response in five criteria namely the students attributes, lecturer's profile, implementation, facilities and students' understanding. From the survey, the results in exit survey are higher compared to entrance survey for all criteria. This shows that the students are satisfied with the implementation of the module, which has increased their understanding in learning C Programming.