SOLAR POWERED FIELD WEATHER STATION System Software Design Dean - - PowerPoint PPT Presentation

solar powered
SMART_READER_LITE
LIVE PREVIEW

SOLAR POWERED FIELD WEATHER STATION System Software Design Dean - - PowerPoint PPT Presentation

SOLAR POWERED FIELD WEATHER STATION System Software Design Dean Zimmermann WWU Spring 2010 General System Design Freescale 9S08QE128 Microcontroller 24 MHz Bus Frequency Available Memory: 128K Flash/8K RAM Required Memory: 10K


slide-1
SLIDE 1

SOLAR POWERED FIELD WEATHER STATION

System Software Design Dean Zimmermann

WWU Spring 2010

slide-2
SLIDE 2

General System Design

 Freescale 9S08QE128 Microcontroller  24 MHz Bus Frequency  Available Memory:

128K Flash/8K RAM

 Required Memory:

10K Flash/4K RAM

 Timeslice Kernel – 10ms Period

slide-3
SLIDE 3
  • Timeslice Task
  • User Interface Task
  • Clock Task
  • Sensor Task
  • SD-Card Write/Read Task
  • Key Task

Timeslice Kernel Tasks

slide-4
SLIDE 4

Timeslice Task

 Period: 10ms  Waits for periodic timing event to initialize task

loop

 Puts the MCU to sleep to save power

slide-5
SLIDE 5

User Interface Task

 Period: 50ms (periodic)  Execution Time ~ 2ms (max)  Displays information on the LCD and controls LEDs  Handles user inputs to:

 Change State  Set Time and Date  Set Sample Rate  Navigate Stored Data

slide-6
SLIDE 6

Clock Task

 Period: 1s (periodic)  Execution Time ~ 4us (max)  Updates Time and Date information

slide-7
SLIDE 7

Sensor Task

 Period: 500ms (periodic)  Execution Time ~ 3ms (max)  Receives information on A/D convertor  Reads timer channel  Communicates with pressure module through SPI  Performs necessary calculations and uses lookup

tables to convert data into meaningful forms

slide-8
SLIDE 8

SD-Card Write/Read Task

 Period: Sample Rate (sporadic)  Execution Time ~ 1 ms (max)  Uses SPI to communicate with SD-Card module  Writes data to SD-Card

 Writes at the sample rate specified by user  Stores data blocks with time and date stamp

 Reads Data blocks to display on LCD

slide-9
SLIDE 9

Key Task

 Period: 10ms (periodic)  Execution Time ~ 2 us (max)  Checks for key presses  Updates key buffer

slide-10
SLIDE 10

Maximum

CPU Load

slide-11
SLIDE 11

Modules

Module Tasks Public Functions and Data Author Main.c User Interface Task Timeslice Task Current State Data Current Time/Date Data Struct Local Time/Date Data Struct Dean Zimmermann Time.c Clock Task Time_DateGet(), Time_DateSet() Dean Zimmermann Weather.c SD-Card R/W Task Sensor Task Weather Data Structure WeatherDataGet() Dean Zimmermann Key.c Key Task KeyInit() GetKey() Todd Morton SPIDriver.c

  • InitSPI(), Read SPI(), WriteSPI()

Dean Zimmermann LCD.c

  • LcdClrDisp(), LcdDispChar()

LcdDispByte(), LcdDispString() LcdMoveCursor(), LcdCursor() Todd Morton OCDelay.c

  • OCDelay(), GetmsCnt()

Todd Morton

slide-12
SLIDE 12

Overall State Diagram

REC REC LIVE/PAST LIVE/PAST SET SET’ SET (3 sec.) SET Past Live (reset) Button Hold Set Record

slide-13
SLIDE 13

Data Flow: Sensors

Weather.c ADC I/O SPIDriver.c SpiRead() Timer 3 Channel 0 PTF0 PTF1 Weather Data Structure Sensor Task

slide-14
SLIDE 14

Data Flow: SD-Card

Weather.c Main.c SPIDriver.c SpiRead() Weather Data Structure SD-Card R/W Task SpiWrite() Time/Date Data Structure

Time_DateGet()

slide-15
SLIDE 15

Data Flow: User Interface-Display

Main.c Weather.c Time.c Port E Time/Date Data Structure User Interface Task Clock Task Weather Data Structure

Time_DateGet() Time_DateSet()

LCD Display

WeatherDataGet()

slide-16
SLIDE 16

Data Flow: User Interface-Keypad

Main.c Key.c User Interface Task Port B Key Task

GetKey()

slide-17
SLIDE 17

Questions?