final report smartwatch device

Upload: juweria-binte-nizamuddin-khan

Post on 01-Jun-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Final Report Smartwatch device

    1/9

    Basic Smart-watch Multimedia DeviceEE8205 Embedded Computer Systems

    Mohammed N. Ahmed - 500191879Electrical and Computer Engineering

    Ryerson UniversityToronto, Canada

    Abstract  — a smart-watch style multimedia device is designed in

    this presented project. A simple game, weather app and image

    gallery are implemented. The use of several hardware peripherals

    and software features are described in the design of the device.

    Final results and discussions are presented at the end. 

    I. I NTRODUCTION 

    Today’s smart devices industry is expanding rapidly.Initially, the smartphone was the device that initiated theeffort to make everyday devices “smarter” by integratingmicrocontroller electronics, user interactivity and internetconnectivity. A new effort in the industry is to create a smartwatch, expanding greatly on the traditional wrist watch thatdid little more than tell time. Smart watches include fitnesstracking, text and call capability, emails, navigation, andinternet enabled services. A basic smart-watch style devicewould include simple implementations of such a system.

    In this project, a basic smart-watch type embeddeddevice is designed with basic multimedia and interactivefeatures. A Cortex M4 SoC is used to interface with many

     peripherals to realize the feature list. The multimedia devicehad a few basic apps including a basic version of a classicvideo game Space Invaders, and a weather monitoringapplication is also implemented that displays basic ambientweather information. These programs are selectable to runon the device screen by the user. The device has beendesigned to be expandable in terms of its functionality toinclude an image gallery, compass, and possibly otherapplications.

    The hardware components used is the TexasInstruments TM4C123GXL development board with aCortex M4F SoC, a Sensor hub add-on also by TexasInstruments, a 1.8” Adafruit LCD screen, and a generic slide-

     potentiometer.

    II. OBJECTIVES AND FEATURES 

    On start-up of the device, a menu will be displayed on the LCDthat shows the apps available on the device. The user may selectthe app to start using it. The device will be designed to includea few basic apps. The video game app will be a simpleimplementation of the popular game “Space Invaders”, and a

    weather monitoring app. There’ll also be a simple image

    gallery.

    The interface for selecting an app will be a pushbutton on thedevice. In a more complex project, a touchscreen could beimplemented where the user interacts with the entire device onthe touch panel with a graphical user interface.

    The design features and user interfaces are discussed here:

    1.  Space Invaders Game:

    This game consists of a single user-controlled gun shipthat can fire missiles or laser beams at aliens. Thealiens move across the top of the screen in a time ofabout 10 seconds where the player has to score asmany points as possible. There is one obstacle onscreen that the user has to fire around. At the end ofthe game the score information is displayed. If the

     player scores more than 10 points, the player wins thegame, but if less than 10 points are scored, the alienswin the game.

    The user interface for this game includes a slide- potentiometer to control the left-right movement of thegun ship across the screen. To fire the laser or missile,one of two pushbutton switches are to be pressed.

    2.  Ambient Weather App:

    In this app the temperature, pressure, altitude andhumidity are displayed. The ambient weather appshows ambient temperature and the temperature of anyobject up to 10cm away from the temperature sensorin degrees Celsius. Also, atmospheric pressure isdisplayed in mbar along with altitude in masl (metersabove sea level). Lastly, the ambient humidity isdisplayed in percentage.

    3.  Image Gallery:

    The simple image gallery displayed saved imagesfrom system memory. These images can be scrolledthrough using the pushbuttons. Left scrolling by left

     pushbutton and right scroll by right pushbutton. This

  • 8/9/2019 Final Report Smartwatch device

    2/9

    app can be expanded to display images from a memorycard or SD card interface.

    III. DESIGN METHOD: FUNCTIONS & PERIPHERALS 

    There are many peripherals available on the CortexM4 SoC that are usable by the developer. In this project,many on-board peripherals were utilized that make this

     project possible. For the Space invaders game engine, a

    Systick based timer is used to generate an interrupt that runsthe game engine routine every 33.3 ms; the game engine runsat 30 Hz.

     Fig. 1. Game Engine software routine call graph

    The interrupt routine handles the movement of the player gunship, the aliens and the fired missiles or laser beam. The function to write to the LCD screen takes place inthe main foreground routine as it is a much more time-

    consuming task than running the game engine in the SysTickinterrupt handler routine.

     Fig. 2. Game Engine control flow graph.

    Also, the LCD screen is interfaced with themicrocontroller using an SSI module for datacommunication. The LCD peripheral is run through a driver

     provided by the vendor. The movement of the player gunshipis controlled through a slide-potentiometer interfacedthrough ADC. The ADC peripheral on board the M4 SoC is

    read by SysTick interrupt at 30Hz to process movement. Theuser slides the pot left or right to control movement of thegunship on screen, and fires missiles or lasers using one oftwo buttons on the device, which are interfaced throughGPIO. We see the game engine control flow graph in Figure2.

    The Ambient Weather app uses a special add-onsensor board to the Cortex M4 development board that

    contains sensors such as temperature, barometric pressure,humidity and accelerometer. Also sensors on the add-on

     board are interfaced using an I2C interface to the Cortex M4 board. Some of the sensors are polled using a SysTickinterrupt while other sensors are digital output that is readusing a hardware-triggered interrupt to the microcontroller.The readout is refreshed every 1s. The temperature, pressureand humidity information is obtained in float format, whichis then converted to a signed integer and decimal number

     before output to LCD. Also, altitude is calculated as afunction of atmospheric pressure. The low-level drivers foreach sensor are provided by the vendor and are used in themain program for initialization and reading data. Figure 3shows the connection interface to Cortex M4 using I2Cinterface.

     Fig. 3. Sensor board interface scheme.

    Finally, the simple image gallery displays imagessaved in the system ROM. The images are saved in bmpformat where each pixel is represented by a hexadecimalnumber. The user navigates the images using left and right

     pushbuttons on the device. The image gallery app can beexpanded to read images saved on an external memory card.This memory card such as a micro SD card can be interfaced

  • 8/9/2019 Final Report Smartwatch device

    3/9

    to the microcontroller through an SPI interface for high speedcommunication.

    IV. DESIGN METHOD: SOFTWARE/FIRMWARE DESIGN 

    The software design of the game and weather application aswell as the firmware design for the use of hardware modulessuch as GPIO ports, SystTick timer interrupts, and I2Cinterfaces are custom designed for this project. Vendor

     provided driver code is utilized for the sensor add-on board andthe LCD board. These drivers provide application level accessto low-level functions that drive the vendor hardware such asinitialization routines, setup, and reading or writing data fromthe add-on device.

    In this section, some basic code structure is provided thatdescribes the functionality of the Space Invaders game, thecomplete code is 2000 lines of code  –  not including peripheraldrivers! The code structure of the Ambient Weather app followsafter.

     A.  Space Invaders game:

    #include

    #include

    #include // … includes here for LCD andother peripherals 

    // this section contains global variable declarations

    // and function declarations

    void EnableInterrupts(void); // Enable interrupts

    void Delay10ms(unsigned long count); // time delay in 0.1 seconds

    unsigned long TimerCount;

    unsigned long buttonMissile;

    unsigned long buttonLaser;

    // ************Ports Initializations Section***************

    // Port F buttons and LEDs onboard: PF4, PF0 input, PF3 ouput LED// (moved to port F) Port E for Inputs: Slide Pot: PE2 (Ain1), Buttons:

    PE0, PE1

    // (moved to port F) Port B for Outputs: LEDs: PB4, PB5 4-bit DAC:

    PB3-0

    // LCD outputs not defined here.

    void PortFInit(void){

    // PortF Initialization sequences

    }

    void PortEInit(void){

    // PortE Initialization sequences

    }

    void ADC0_Init(void){

    //ADC0 periph. initialization sequence

    }

    //****************SysTick Initialization***************

    //Initialize SysTick power inturrepts for reading slit pot

    // Initialize SysTick interrupts to trigger at 40 Hz, 25 ms

    void SysTick_Init(unsigned long period){

    // SysTick initialize to period of 33.33ms

    }

    void SysTick_Init(unsigned long period){

    // SysTick initialize to period of 33.33ms

    }

    // ********************** Images **********************

    const uint16_t Missile0[] = {

    0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0xFFFF,

    0x0000, 0xFFFF, 0x0000, 0x0000, 0x0000, 0xFFFF, 0x0000, 0x0000,

    0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0xFFFF, 0x0000, 0x0000,

    0x0000, 0xFFFF, 0x0000,

    };

    // other images for onscreen instances are described similarly

    // … 

    // ************GAME ENGINE INIT AND ROUTINES************

    // This sections controls motion of sprite and aliens

    // Above defined images will be manipulated here

    void EnemyInit(void){

    // the enemy character draw generated here

    }

    void SpriteInit(void){

    // the player gunship routines here

    }

    void fireMissile (){

    // missile fire routine here

    }

    // similar routines for Laser fire

    void detectCollision (){

    // detect collision between fire and enemy here

    }

    void SysTick_Handler(void){

    //main game engine is run here at every interrupt

    // all functions are initialized and called here

    }

    //**************LCD OUTPUT ROUTINE*****************// the player gunship, aliens and missles/laser are all drawn using this

    routine

    // function calls made to the LCD driver include

    void Draw(void){

    // routines for drawing all characters and images on screen

    // routine for moving the characters on screen

    }

    //******************MAIN ROUTINE********************

    int main(void){

    // all routines initialized

    //peripherals initialized

    //SysTick initialized

    while(1){

    draw(); // the call to draw function here

    Flag = 0; // clear Flag for interrupt

    // game engine runs in interrupt routine

    }

    }

  • 8/9/2019 Final Report Smartwatch device

    4/9

    In this Space Invaders game application software, theroutines for drawing to the LCD peripheral are described in aseparate c file provided by the vendor, and that is declared inthis program as an include. The functions for string output,drawing bitmap images and initialization routines are all calledfrom within the main program. The game engine where thecharacters are moved, missiles and lasers fired, and thecollisions are detected, is run in the interrupt handler routine.

    This way we have good scheduling of processor time. TheSysTick interrupt occurs every 33.33 ms, which is more thanenough to run the game engine. The draw routines to the LCDis run the in the main super-loop as it takes longer to execute adraw to the LCD. We can see from the operation of the gameapp that everything runs smoothly, utilizing the processor timeefficiently.

    Once the game engine is initialized and is operating ascontrolled by the periodic interrupts, the flag is set in theinterrupt routine to draw the entire images and movementsequence in the main routine. The main routine then resets theflag. The LCD driver is used to draw the bmp images of aliens,gun ship, missile, laser and the textual information.In the following section, the registers set up needed for enablingand using the ADC peripheral on the SoC is described. Thereare several registers that need to be defined for the peripheral to

     be operational. Of note, the ADC runs at 125 kHz sampling rate,which is too fast, so we will only read the ADC using the 30HzSysTick interrupt that runs the gam engine.

    ADC Initialization, input and conversion are shown anddiscussed:

    Table 1. The ADC0 registers in the TM4C SoC. These registersare set in the following code.

    Steps to configure and initialize the ADC peripheral:

    1.  Enable clock for Port E for ADC input (ADC0 on port E)

    2.  DIR register set to 0 for pin input

    3. 

    AFSEL register enabled for alternate function(ADC)

    4.  DEN register disables as this is analog input5.  AMSEL register enabled as this is analog input6.  SYSCTL_RCGC0_R register enabled to enable

     port clock7.  Bit 8 and 9 of SYSCTL_RCGC0_R specify the

    max sampling rate of ADC0, which is 125KHz.8.  Sequencer priority is set.9.  Disable sequencer to prepare for configuration.

    Bit 3 in ADC_ACTSS_R register is set to 0.10.  Configure trigger event in sample sequencer in

    ADC_EMUX_R register.11.

     

    Configure input source in ADCSSMUX3_Rregister for PE4.

    12.  Configure sample control in theADC_SSCTL3_R register.

    13.  Finally, enable sample sequencer 3 but setting bitASEN3 in the ADC_ACTSS_R register.

    Address31-17

    1615-Oct

    9 8 7-0 Name

    0x400F.E100 ADC MAXADCSPD SYSCTL_RCGC0_R

    31-14

    13-Dec

    10- Nov

    08-Sep

    06-Jul04-May

    02-Mar 1-0

    0x4003.8020 SS3 SS2 SS1 SS0 ADC0_SSPRI_R

    31-16 15-Dec 08-Nov 04-Jul 3-0

    0x4003.8014 EM3 EM2 EM1 EM0 ADC0_EMUX_R

    Apr-31 3 2 1 0

    0x4003.8000 ASEN3 ASEN2 ASEN1 ASEN0 ADC0_ACTSS_R

    0x4003.80A0 MUX0 ADC0_SSMUX3_R

    0x4003.80A4 TS0 IE0 END0 D0 ADC0_SSCTL3_R

    0x4003.8028 SS3 SS2 SS1 SS0 ADC0_PSSI_R

    0x4003.8004 INR3 INR2 INR1 INR0 ADC0_RIS_R

    0x4003.800C IN3 IN2 IN1 IN0 ADC0_ISC_R

    31-Dec 11-0

    0x4003.80A8 DATA ADC0_SSFIFO3

  • 8/9/2019 Final Report Smartwatch device

    5/9

  • 8/9/2019 Final Report Smartwatch device

    6/9

    Table 2. SysTick set up registers. 

    Table 3. SysTick periodic interrupt priority register  

    Steps to configure and initialize the SysTick interrupt:

    1.  Fist, the NVIC_ST_CTRL_R register is cleared todisable SysTick during setup.

    2.  Set the NVIC_ST_RELOAD_R register with thecountdown value for periodic interrupt.

    3. 

    Clear the NVIC_ST_CURRENT_R register toclear the counter.

    4.  Re-enable NVIC_ST_CTRL_R for core clock periodic SysTick interrupts.

    5.  Set INTEN in the NVIC_ST_CTRL_R register toenable interrupts

    6.  Set the interrupt priority with NVIC_SYS_PRI3_R register.

    //*****************SysTick Initialization******************

    //Initialize SysTick power inturrepts for reading slit pot

    // Initialize SysTick interrupts to trigger at 30 Hz, 33.33 ms

    void SysTick_Init(unsigned long period){

    NVIC_ST_CTRL_R = 0; // disable SysTick during setup

    NVIC_ST_RELOAD_R = period; // reload value for 25ms (at PLL

    80MHz)

    NVIC_ST_CURRENT_R = 0; // any write to current clears it

    NVIC_SYS_PRI3_R = NVIC_SYS_PRI3_R&0x00FFFFFF; // priority 0

    NVIC_ST_CTRL_R = 0x00000007; // enable with core clock and

    interrupts

    EnableInterrupts();

    }

    // ***********SysTick Handler to run game engine***********

    // ISR handler for SysTick interrupt

    // executes every 33.33 ms, collects a sample, converts, moved

    gunship, and sets flag for main.void SysTick_Handler(void){

    //main game engine is run here at every interrupt

    // all functions are initialized and called here

    ADCdata = ADC0_In(); //read ADC

    Distance = Convert(ADCdata); //convert to distance for

    player

    Sptrite.x = Distance; //player position onscreen

    If (buttonMissile == 0){ //read button for missile

    MissileInit();

    PortFLED = 0x02 //Green LED on

    }

    If (buttonLaser == 0){ //read button for Laser

    LaserInit();

    PortFLED = 0x08 //Red LED on

    }

    fireMissile();

    fireLaser();

    Flag = 1; //semaphore for draw routine in main loop

    }

    B. 

     Ambient Weather app:

    In this section, the basic software structure is presented to showhow the sensors are interfaced by I2C, and how the gatherednumbers are converted to numbers that the viewer canunderstand. Again, the actual full code is about 1000 lines ofcode, so the simplified code structure will be presented, butwith all design details present.

    #include "sensorlib/i2cm_drv.h" //I2C driver#include "sensorlib/tmp006.h" // temperature sensor#include "sensorlib/bmp180.h" //pressure sensor#include "sensorlib/sht21.h" // humidity sensor#include // … other includes for gpio, LCD driver, stdio and etc. 

    // define I2C addresses#define TMP006_I2C_ADDRESS 0x41#define BMP180_I2C_ADDRESS 0x77#define SHT21_I2C_ADDRESS 0x40

    // global instance structure for each sensor:tTMP006 g_sTMP006Inst;tBMP180 g_sBMP180Inst;

    tSHT21 g_sSHT21Inst;

    // new data flag : set by interruptvolatile uint_fast8_t g_vui8DataFlagTMP006;volatile uint_fast8_t g_vui8DataFlagBMP180;volatile uint_fast8_t g_vui8DataFlagSHT21

    // TMP006 callback function. Called through interrupt routinevoidTMP006AppCallback(void*pvCallbackData,uint_fast8_tui8StatusTMP006){

    Address31-24

    23-17

    1615-Mar

    2 1 0 Name

    $E000E010 0 0 COUNT 0 CLK_SRC INTEN ENABLE NVIC_ST_CTRL_R

    $E000E014 0 24-bit RELOAD value NVIC_ST_RELOAD_R

    $E000E018 0 24-bit CURRENT value of SysTick counter NVIC_ST_CURRENT_R

    Address 31-2928-24

    23-2120-Aug

    05-Jul4-0

     Name

    $E000ED20 TICK 0 PENDSV 0 DEBUG 0 NVIC_SYS_PRI3_R

  • 8/9/2019 Final Report Smartwatch device

    7/9

      // check for data from temp sensor and set flag}

    // BMP180 callback function. Called through interrupt routinevoid BMP180AppCallback(void* pvCallbackData, uint_fast8_tui8StatusBMP180){

    // check for data from temp sensor and set flag}

    // SHT21 callback function. Called through interrupt routineSHT21AppCallback(void*pvCallbackData,uint_fast8_tui8StatusSH21){

    // check for data from temp sensor and set flag

    }

    // I2C interrupt handler for the sensors. I2C3 interface used on theTM4C SoCvoid TMP006I2CIntHandler(void){

    //data read sequence for TMP006

    }void BMP180I2CIntHandler(void){

    //data read sequence for BMP180}

    Void SHT21I2CIntHandler(void){

    //data read sequence for SHT21}

    // the hardware triggerd interrupt is read on Port Evoid IntGPIOe(void)

    {

    //GPIO port E pin is initialized to read interrupts from sensor board}

    // main section to initialize interrupts, initialize sensors, collect data,convert and display.Int main(void){// variables decleration

    float fAmbient, fObject;int_fast32_t i32IntegerPartTMP006;int_fast32_t i32FractionPartTMP006;float fPressure, fAltitude;int32_t i32IntegerPartBMP180;int32_t i32FractionPartBMP180;

    float fHumidity;int32_t i32IntegerPart;int32_t i32FractionPart;

    // initialize system clock to 40 MHz from PLLROM_SysCtlClockSet (SYSCTL_SYSDIV_5|YSCTL_USE_PLL |

    SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    // enable the port E peripheralROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);

    // Initialize the LCD displayST7735_InitR(INITR_REDTAB);

    // print welcome messageST7735_SetCursor(1,1);ST7735_OutString ("Weather Monitor");

    // section to initialize and configure the I2C interface and enableinterrupt on port E

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C3);ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

    // … other long initializations, initialize the 3 sensors

    // routines to handle hardware interrupt and collect data//… 

    //master interrupt enableROM_IntMasterEnable();

    while(1){

    // data flag reset routineg_vui8DataFlagTMP006 = 0;

    //read measurements for temperature//read measurements for pressure//read measurements for humidity

    //convert float numbers to integer and decimal parts for displayi32IntegerPartBMP180 = (int32_t) fMeasurement;i32FractionPartBMP180 =(int32_t) (fMeasurement * 1000.0f);i32FractionPartBMP180=i32FractionPartMeasurement-(i32IntegerPartMeasurement * 1000);

    // calculate altitude from pressure measurementfAltitude = 44330.0f * (1.0f - powf(fPressure

    / 101325.0f,

    1.0f / 5.255f));

    // display measurements to LCD (repeated for eachof 3 sensors)ST7735_SetCursor(1,5);ST7735_OutString ("Pressure: "); //ortemperature, or altitude, or humidityST7735_SetCursor(11,5);ST7735_OutUDec (i32IntegerPartMeasurement);//measurement for TMP, BMP or SHTST7735_SetCursor(14,5);ST7735_OutString (".");ST7735_SetCursor(15,5);ST7735_OutUDec(i32FractionPartMeasurement); //measurement

    for TMP, BMP or SHT}

    }

    In the above section, vendor provided driver code was utilizedto initialize the sensors, read measurements, and convert thedata. The I2C driver is also vendor provided. The Main codethat collects the data and presents information in readableformat for viewer is custom-written, as is the interrupt handlersthat read data from the sensors every 1s.

  • 8/9/2019 Final Report Smartwatch device

    8/9

     

    The information gathered from the sensors, and calculatedinto integers and decimal numbers is then output to the LCDusing the LCD driver routine calls. The LCD driver definescursor position, text string output and numerical output for thisapplication.

    V. R ESULTS 

    In this project, a basic multimedia device was designand implemented that could be used as a basis for a smart-watch. We have 3 apps where the user can play a game, see theambient weather conditions, and browse images stored inmemory. So far, the complexity of each component shows thedesign effort required in implementing a marketable smartdevice.

    In the design of user control, a home screen wascreated that shows all the applications available to be selected.The user can select which application to run. However, only theSpace Invaders game can be selected to run form this homescreen. The complete implementation of other apps into onelarge program controlled through the home screen selection

     proved to be very difficult as discussed in the discussion sectionto follow.

    The Space Invaders game is successful in allowingcomplete user interaction. The player gun ship can be movedthrough the use of the slide pot, the missile and lasers can befired using the two pushbuttons, and the game keeps record ofthe aliens shot. Also, the user has only 10 seconds to shoot thealiens. If 10 points are scored, the user wins the game with anon-screen message. The game can be further expanded toinclude aliens that are constantly refreshed, and aliens that canfire back at player. Also, graphics can be improved wheredamage to items on screen is visualized with the use of missilesor laser.

    The Ambient Weather app is also implementedsuccessfully, but needs to be loaded separately to use as thehome-screen selection could not be made to work.

     Nevertheless, the ambient temperature in C, atmospheric pressure in mbar, the altitude in meters above sea level, and percent humidity are shown on screen. Furthermore, thetemperature sensor also shows object temperature of any objectheld about 5-10cm away from the sensor, such as a hand. Themeasured information is shown on the screen in the form oftext.

    With increased effort in user-interface design andgraphical design, a better weather app can be implemented that

    includes graphics, and also real time location-based weatherthrough the use of internet connectivity. With the limitations ofon-board memory, it is difficult to implement fancy graphics. Asystem with expandable storage memory would be needed toimplement better user interface design.

    Finally, the image gallery is a simple app the displaysimages saved in system memory. The images are small as bmpgraphics use large memory space. The total ROM size on theTM4C SoC board is about 256 KB. The user can scroll throughthe images left or right using the on-board left or right

     pushbuttons.

    The feature list was successfully implemented.However, it proved difficult to design a home-screen where anyof the apps could be launched. Also, a compass could not beimplemented due to the complexity in calculating north fromthe device’s magnetometer which p returns values in Tesla in anx-y-z plane. Lastly, an important part of a smart-watch would,of course, be a time read-out. A time program could be easilyimplemented using periodic SysTick interrupts, however, the

    time would be reset every time power was cut to the device andan interface would have to be designed to set the time everytime the device is powered up. A smaller separate battery

     powered MCU could be used to keep the system clock runningwould need to be implemented to have the device always counttime. 

    VI.  DISCUSSION 

    The described feature list in the Objectives and Resultssection was successfully achieved. However, some featurescould not be fully integrated into a stand-alone system wherethe user could run any program from an app selection home

    screen. This is due to the increased complexity of code thatneeds to be integrated into one large program.The Space Invaders game is selectable to run from the

    home screen, however, the weather monitoring app is not.This is because there are driver incompatibilities in thedrivers provided by the vendor for use with the sensor board.In integrating the ambient weather app with the completesystem including home screen and Space Invaders game,there are sensor board drivers that cause driver redefinitionerrors for ports and peripherals on the device as definesseparately in the game and weather apps. A large effortwould need to be undertaken to modify the vendor driversfor the sensors and the peripheral definitions used for the

    game to make sure that no variable, port or peripherals are being multiply defined. Also, the vendor provided interruptroutines used in the sensor board drivers conflict with theSysTick periodic interrupt used to run the game engine, the

     priorities are mismatched which causes the processor to getendlessly locked in never ending interrupts. Again thehardware interrupt drivers would need to be redesigned touse a different interrupt scheme that does not interfere withthe game app, or other device apps.

    Finally, as discussed previously, a compass app was to be implemented, but proved to be large project on its own.The magnetometer sensor on the sensor board generated 3-dimensional magnetic field values in Tesla. This 3

    dimensional matrix would need to be manipulated to generatea magnetic north compass direction in the 2 dimensional flat plane. This matrix computation is a complex process that can be implemented as a separate project on its own, rather thanwith a complete device with a game and weather app that wasalso implemented with considerable design effort.

    VII. CONCLUSION 

    This project was an attempt to create a basicmultimedia device that can be used as a basis for a moreadvanced development where a much larger set of features is

  • 8/9/2019 Final Report Smartwatch device

    9/9

    implemented into an actual smart-watch product. An ARMCortex M4 SoC was used, which provided enough power torun the programs and tasks required for the project.

    A successful development resulted in theimplementation of the Space Invaders game, an AmbientWeather app, and a simple image gallery. The design of eachcomponent required a system-level understanding of how thesoftware flow architecture will control the underlying

    hardware assets. Using the software structure, thesoftware/firmware was designed to create the applicationsneeded. There was success in creating each of the applicationneeded, however more effort would be needed to fullyintegrate the device into a true smart-watch multimediadevice.

    The firmware design effort created the interfacesneeded to control the peripherals on the Cortex M4 SoC suchas SysTick periodic interrupts, ADC, GPIO interface forswitches and LEDs, SPI for LCD and I2C for the sensors.The software design used the firmware interface to create anapplication for the user such as the game, weather app orimage gallery. 

    R EFERENCES [1]

     

    J. Valvano, Embedded Systems: Introduction to ARM Cortex-MMicrocontrollers, 5th ed., vol. 1. UT Austin, 2014

    [2] 

    J. Valvano, Embedded Systems: Real-Time Interfacing to ARMCortex-M Microcontrollers, 4th ed., vol. 2. UT Austin, 2014