pwn3xt / Microwave-Oven-Controller

Introduction to Embedded Systems (CSE 211) Final Project (Group Project)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Microwave Oven Controller Project

LCD_sendString("CSE 211 | Introduction to Embedded Systems");
LCD_moveCursor(1, 0);
LCD_sendString("Final Project");

Overview

In this project, we used Tiva™ C Series TM4C123G LaunchPad in order to develop Microwave Oven Controller1

Components

Tiva™ C Series TM4C123GXL (ARM Cortex M4F Based) LaunchPad

16×2 LCD

Keypad

LEDs, potentiometer, etc.

Steps

1. The LCD

in the first step, our goal was only to display a sequence of ASCII characters on the LCD, with the full control of it's position.

In LCD.c we started by initializing the used pins from PORT B and PORT F

we have known that the LCD functions will be used a lot in the project, so we needed to make the code reuseable and readable. so we followed the functional programming paradigm, so our code became nothing more than a set of functions that call each other2, we can summarize as following

1. The control functions

  • LCD_vInit calls the initializing functions, clears the LCD and sets the cursor

  • LCD_cmd initializes the Command ports

  • sendPulse sends a pulse to the enable pin(E) in the LCD to enable it

  • tostring converts integer to string

2. The basic instruction functions

2. Helper function

we made some helper files and function to make the code reuseable and readable. so our code became nothing more than a set of functions that call each other2. We can summarize as following:

Instead of using meaningless delay such as looping in an empty loop, we have used the systick timer, giving us the choice from choosing between 2 modes in counting wait_secs for seconds, and wait_ms for milliseconds, and of course the number of counts in the selected mode.

Instead of using repeated and long port names and port regesters, we made this file to deal with ports more easly. Like for example when we need to initalize a port we use port_vInit. And when we need to write or read from a specific pin we use DIO_u8ReadPin or DIO_vWritePort, etc.

we made this header file to deal with the problem of choosing which bit to work on, for example to set a BIT in specific register we use SET_BIT and for toggling a bit we use TOG_BIT, etc.

In this file we made a function for in case we wanted to use a led in specific pin and port, so to initialize the pin connected to the led we use LED_vInit, and to light up the led we use LED_vON and the same for closing it LED_vOFF.

same as LED.c but for switches. We use switch_vint function to initialize a switch connected to a specific pin, and the same for switch_vint_pullup but include the enabling the pullup for the switch, and switch_vRead to check if the swich is pressed or not.

3. Keypad

in keypad.c, we started by initializing the used pins from PORT A and PORT E

we have known that the Keypad functions will be used a lot in the project, so we needed to make the code reuseable and readable. so we followed the functional programming paradigm, so our code became nothing more than a set of functions that call each other2, we can summarize as following

4. Parsing the Data

The main Parsing process was implemented in cookingModes.c which take the user input search for the right mode after checking its availability. We also created LEDxBuzzer which enables the buzzer and the led during mode functions

Footnotes

1 The functionality of Microwave Oven Controller is limited for the time being duo to problems with intrrupts, but we will fix it as soon as possible

2 The implementation of many functions is nothing more than just calling another functions.

About

Introduction to Embedded Systems (CSE 211) Final Project (Group Project)


Languages

Language:C 96.1%Language:Assembly 3.9%