SD card based Data Logging and Data Retrieval for Microcontrollers to usingμc/os-II

DOI : 10.17577/IJERTV2IS110392

Download Full-Text PDF Cite this Publication

Text Only Version

SD card based Data Logging and Data Retrieval for Microcontrollers to usingc/os-II

K.Tamilselvan

PG Scholar

Nandha engineering college, Erode

ABSTRACT

The main objective of this paper is data acquisition based on the microcontroller using c/os-II. Here the temperature and pressure value are measured by the sensors. The value are fetch from the input and directly given to the RTOS (real time operating device) with microcontroller. The capacity of operating system carry out multitask real time scheduling and it completely meets a reliability technique.SD memory card plays an efficient real time archival system. The data access from the card by different task and current mode and reading are displayed in LCD. Here hardware architecture of the system is displayed.

Keywords

8051 microcontroller, RTOS, SD-memory card, LM 35, LCD, c/os-II.

  1. INTRODUCTION

    act/OS-II is a portable, ROMable, scalable, preemptive, real-time deterministic multitasking kernel for microprocessors, microcontrollers and DSPs. Offering unprecedented ease-of-use, act/OS-II is delivered with complete 100% ANSI C source code and in-depth documentation. act/OS-II runs on the largest number of processor architectures, with ports available for download from the Micrium Web site act/OS-II manages up to 250 application tasks. act/OS-II includes: semaphores; event flags; mutual-exclusion semaphores that eliminate unbounded priority inversions; message mailboxes and queues; task, time and timer management; and fixed sized memory blockmanagement

    1. Features of Micro C/OS-II

      It is a very small real-time kernel.Memory footprint is about 20KB for a fully functional kernel.Source code is written mostly in ANSI C.Highly portable, ROM able, very Ithas connectivity with c/GUI and c/FS (GUI and File Systems for c/OS. It is ported to more than 100 microprocessors and microcontrollers. It is simple to use and simple to implement but very effective compared to the price/performance ratio. It supports all type of processors from 8-bit to 64-bit. act/OS-IIwas designed for embedded

      applications. This means that if you have the proper tool chain (i.e. C compiler,assembler and linker/locator), you can embed act/OS-II as part of a product.

    2. Microcontroller 8051

      A micro controller consists of a powerful CPU tightly coupled with memory RAM,ROM or EPROM, various I / O features such as Serial ports, Parallel ports, Timers/Counters, Interrupt Controller, Data Acquisition interfaces-Analog to Digital Converter (ADC), Digital to Analog Converter (DAC), everything integrated onto a single Silicon Chip.

      It does not mean that any microcontroller should have all the above said features on chip, depending on the need and area of application for which it is designed, the on chip features present in it may or may not include all the individual section said above.

    3. Temperature Sensor (LM35)

      The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require anyexternal calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°Cover a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level.

    4. PRESSURE SENSOR

      This is a simple breakout board for the BMP085 high-precision, low-power barometric pressure sensor. The BMP085 offers a measuring range of 300 to 1100 hPa with an absolute accuracy of down to 0.03 hPa. It's based on piezo- resistive technology for EMC robustness, high accuracy and linearity as well as long term stability. This sensor supports a voltage supply between 1.8 and 3.6VDC. It is designed to be connected directly to a micro-controller via the I2C bus

    5. HARDWARE CIRCUIT

      LCD

      LCD

      TEMPERATURE SENSOR (LM35)

      TEMPERATURE SENSOR (LM35)

      MICRO CONTROLLER

      (c/os-II)

      MICRO CONTROLLER

      (c/os-II)

      INPUT

      PARAMETER 1

      SD CARD

      SD CARD

      INPUT

      PRESSURE SENSOR (BMP 085)

      PRESSURE SENSOR (BMP 085)

      PARAMETER 2

      INPUT

      PARAMETER 1

      INPUT PARAMETER 2

      PUSH BUTTON

      PUSH BUTTON

      Table 1. Comparison between sensors

      Instruments

      Accuracy

      Sensor gain

      Minimum Accuracy

      Temperature Sensor

      Typical

      ±0.2

      +10.0

      +1.5

      Pressure sensor

      Good

      Similar

      Very well

      Fig 1:Bloch diagram of parameter measurement

    6. Kernel structure

      The kernel has full access to the system's memory and must allow processes to safely access this memory as they require it. Often the first step in doing this is virtual addressing, usually achieved by paging and/or segmentation. Virtual addressing allows the kernel to make a given physical address appear to be another address, the virtual address. Virtual address spaces may be different for different processes; the memory that one process accesses at a particular (virtual) address may be different memory from what another process accesses at the same address. This allows every program to behave as if it is the only one (apart from the kernel) running and thus prevents applications from crashing each other.

    7. Porting of act/OS-

      Real-time kernel can run on other microprocessors orMicrocontrollers. A processor can run act/OS-II. if it meets the following general requirements: There must be a C compiler for the processor and the C compiler must be able to

      generate reentrant code. It must be able to disable and enable interrupts from C. It must support interrupts and need to provide an interrupt that occurs at regular intervals.It must support a hardware stack, and the processor must be able to store a fair amount of data on the stack.It must have instructions to load and store the stack pointer and other CPU registers either on the stack or in memory Microcontroller 8051 meets all abovementioned requirements, so act/OS-

      .can run on 8051. The main work of porting act/OS-is

      programming. We chooseintegrated development environment provided ARM Company as software development kit. The code contains three files as follows: OS_CPU.H: This file mainly contains some definitions of date types, constants and macros related to processor. Because some data types in C such as short, into and long are related to the word length of processor and complier, so they are non-portable. In order to ensure the portability, we should define these data types in this file.OS_CPU_A.ASM: This file contains the operations

      Fig 2: Porting configuration

      on register, and must be programmed using assembly language. There are four functions related to processor need to be modified here, such as OSStartHighRdy function to start

      the highest priority task ready-to-run, OSCtxSw function for a task level context switch, OSIntCtxSw function to perform a context switch from an interrupt service routine and OSTickISR function to provide a periodic time source to keep track of time delays and timeouts.

      OS_CPU_C.C: Thisfile contains ten C functions to implement some basic operations. These functions are

  2. PROGRAM FLOW

    This mechanism shows to execute a task in a periodic and multi task performation. Simple main function given below. Whenever initialize the task as on the programming technique.

    int main ( void )

    {

    TargetInit ( ); OSInit ( );

    OSTaskCreate( R_Test, ( void * ) 0, (OS_STK *) & R_Test[ R_Test_STK_SIZE-1], 20 );

    OSStart ( ); Return 0;

    }

  3. SOFTWARE DESIGN

    Traditional embedded software systems are designed using single task with foreground / background style. Each task in the system has the same priority. Manual scheduling is the main way to occupy cpu and other resources. This strategy is clearly ownerlessto a complex system. So we adopt c/os-. here which is a kind of free and open source embedded operating system. it has high efficiency, takes small space, and has excellent real-time performance and scalability. Thekernel of c/os-has functions of task scheduling and management, time management, synchronization and communication between tasks, memory management and interruption service. So far, c/os-has run on more than 40 microprocessors with different Architecture. so it is suitable for the software platform of this control system.

    1. SD Card

      The SD-memory cards are the most popular memory cards in moderncommunication, computer and consumer appliances. They support state-of-the-art security and capacity requirements of modern audio and video applications in consumer and communication products.

      3.1.1 Interfacing configuration

      In that interface 2.7 V to operate a memory card, it enables to fixed voltage interface and power supply to reduce cost and

      Pin number

      Name

      Type

      Description

      1

      CD

      I/O/PP

      chip select (active low)

      2

      CMD

      PP

      data in

      3

      GND1

      S

      supply voltage ground

      4

      VDD

      S

      supply voltage

      5

      CLK

      I

      clock

      6

      GND

      S

      supply voltage ground

      7

      DAT0

      I/O/PP

      data out

      8

      DAT1

      I/O/PP

      reserved

      9

      DAT2

      I/O/PP

      reserved

      complexity of control circuitry.

      Table 2. Interfacing pins for SD memory card

      3.1.1.1 PUSH BUTTON

      They push button used to make a change of mode. Either we saw the parameter of temperature or pressure.

  4. CONCLUSION

    In this paper, the existing major parameter measurement of a temperature and pressure measurement. It is time consumption is more.

    Whenever we using an embedded C program. Thats only drawback of an existing system. RTOS perform a real time interfaces with an applications. The scaled- version of act/OS-II with multiple tasks uses 4 kobo of flash and 512 bytes of RAM in 8051 board. The results obtained indicate optimum utilization of processor with RMA scheduler for realizing low cost software for developing the application on embedded boards with least software development effort. Here measurement of a parameter with in a less time and high efficiency. In this application measurement of a more inputs. Whenever the mode changing is perform by the push button. Values and the parameters are of a particular time it will be displayed on the LCD.

  5. REFERENCES

  1. Hue Chen Resistance-temperature Characteristic Measurement System for Automotive Temperature Sensor Based on act/OS-II International Conference on Information Science and Technology March 26-28, 2011 Nanjing, Jiangsu, China

  2. Omar Elkeelany,Data Archival to SD Card Via Hardware Description Language IEEE embedded systems letters, vol. 3, no. 4, December 2011

  3. Jean J. Labrosse (USA), act/OS, The Real-Time Kernel [M], Beijing: BEIHANG UNIVERSITY PRESS, 2003.

  4. R.R.Maggavi, D.A.Torse RM Analysis On COS for Embedded SystemsInternational Journal of Latest Trends in Computing (E-ISSN: 2045-5364) 89 Volume 2, Issue 1, March 2011.

  5. AN10911SD memory card and MMC interface conditioning data sheet, Rev.2-4 April 2013

Leave a Reply