Docsity

System Software Design and Documentation - Lecture Notes | ETEC 474, Study Guides, Projects, Research of Engineering

Partial preview of the text

Download System Software Design and Documentation - Lecture Notes | ETEC 474 and more Study Guides, Projects, Research Engineering in PDF only on Docsity!

System Software Design

System Software Design

and

and

Documentation

Documentation

Western Washington University Western Washington University

ETEC 474

ETEC 474

By Dale Nelsen By Dale Nelsen

General System Design

General System Design

z z

MC9S12DP256B

MC9S12DP256B

z z

Bus Frequency 24MHz Bus Frequency 24MHz

z z

Memory Memory

Æ

Æ

50k Bytes Ram 50k Bytes Ram

Æ

Æ

4k Bytes Rom 4k Bytes Rom

Priority of Tasks

Priority of Tasks

z z

Æ

Æ

StartTask StartTask

z z

Æ

Æ

ClockTask ClockTask

z z

Æ

Æ

UITask UITask

z z

Æ

Æ

KeyTask KeyTask

z z

Æ

Æ

RelayControl RelayControl

z z

Æ

Æ

MainTask MainTask

Start Task

Start Task

z z

Discription Discription

Initialize System Initialize System

Create other tasks Create other tasks

Displays initial startup screen Displays initial startup screen

Priority 4 Priority 4

This runs once at startup and the execution This runs once at startup and the execution

time is 10ms time is 10ms

UITask

UITask

z z

Description Description

This handles the user inputs This handles the user inputs

Allows user to navigate through Allows user to navigate through different settings options different settings options

User can set time, date, ideal temp, User can set time, date, ideal temp,

ideal humidity and watering times ideal humidity and watering times

Priority six Priority six

Period Period

Æ Æ

.5s sporadic .5s sporadic

Execution time Execution time

Æ Æ

1ms 1ms

KeyTask

KeyTask

z z

Description Description

Reads the keypad Reads the keypad

Period Period

Æ

Æ

10ms 10ms

execution time execution time

Æ

Æ

2us 2us

Priority seven Priority seven

MainTask

MainTask

z z

Description Description

Æ

Æ

Updates the LCD Updates the LCD

Æ

Æ

Receives the Sensor Data Receives the Sensor Data

Æ

Æ

Receives User inputs Receives User inputs

Æ

Æ

Priority nine Priority nine

Æ

Æ

Period = 10ms Period = 10ms

Æ

Æ

Execution Time = 2ms Execution Time = 2ms

ISR

ISR

z z

Description Description

= This will generate a semaphore = This will generate a semaphore

every one second for the clock task every one second for the clock task to update the clock and also to check to update the clock and also to check temperature and humidity inputs temperature and humidity inputs

= Period = Period

Æ

Æ

1ms periodic 1ms periodic

= Execution Time = Execution Time

Æ

Æ

1us 1us

Modules

Modules

Modules Modules

Tasks Tasks

Functions Functions

Main.c Main.c

UITask UITask,

, StartTask

StartTask,

, UITask

UITask

LCD.c LCD.c

LcdInit LcdInit()

() LcdClrDisp

LcdClrDisp()

()

LcdMoveCursor LcdMoveCursor()

() LcdDispStrg

LcdDispStrg()

()

LcdDispTime LcdDispTime()

() LcdDispTemp

LcdDispTemp()

()

LcdCursor LcdCursor()

()

Key.c Key.c

Keytask Keytask

SPI.c SPI.c

ReadSPI ReadSPI()

() WriteSPI

WriteSPI()

()

InitSPI InitSPI()

()

Control.c Control.c

RelayControlTask RelayControlTask

ATOD.c ATOD.c

AtdInit AtdInit()

() AtdTempRead

AtdTempRead()

()

Clock.c Clock.c

ClockTask ClockTask

Data Flow Diagrams

Data Flow Diagrams

KeyFlag

KeyBuffer

KeyTask()

KeyPad

Functions

Key Code

KeyPend()

KeyInit()

Data Flow Diagram

Data Flow Diagram

timeset

RHset

Watertimeset

Clockset

UITask

LCD

ClockTask