1 / 10

SGDRS

SGDRS. Software System Design Justin A. King WWU EET Senior project 2013. Hardware Resources. MCU – MSP430G2553 available resources Memory 512B RAM / 16KB ROM 2x 16 bit Timer modules, TA0 and TA1 14 GPIO pins Up to 16MHz bus speed Used resources Memory 6 bytes pf RAM / 1KB ROM

sharne
Download Presentation

SGDRS

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SGDRS Software System Design Justin A. King WWU EET Senior project 2013

  2. Hardware Resources • MCU – MSP430G2553 available resources • Memory • 512B RAM / 16KB ROM • 2x 16 bit Timer modules, TA0 and TA1 • 14 GPIO pins • Up to 16MHz bus speed • Used resources • Memory • 6 bytes pf RAM / 1KB ROM • Both 16 bit Timer modules, TA0 and TA1 • 3 GPIO pins • 1MHz bus speed (lower power)

  3. Basic overview • The program functions as follows • Initialize the GPIO • Initialize the Timers • Go into LPM3 • When TA0ISR verifies that output should happen, it wakes the CPU up • FOREVER() • IOTask() • Enter LPM3 (until P1ISR wakes the CPU up again)

  4. Kernel • Interrupt driven Kernel • No specific timing requirements • No time slice execution • No task pre-emption • RTC Period • 1 second • Tasks and ISRs • StartTask(), IOTask() • TA0 int, TA1 int, P1 int

  5. StartTask() • Used to start the clocks and set up interrupt pins • Utilizes IO initialize functions from IO module • Sets up Input and Output pins • Sets up a tie down resistor for the PIR sensor so it is not left floating • Utilizes Timer initialize functions from timer module • Sets up the 32.768kHz crystal for RTC timer, TA0 • Sets up parameters for TA1 PWM generation • Execution time: ~1ms • Period: once (at start-up)

  6. IOTask() • Handles mostly output functionality • Checks to see if the spray flag is set by the TA0ISR • If the flag is set, the output pin that drives the FET that is attached to the servo is set • Changes output phase to adjust PWM pulse width for the TA1ISR • Execution time: Up to 2s • Waits for the servo to turn for half a second and then turns it back • Period: Sporadic (occurs when P1ISR wakes the program up from LPM3)

  7. TA0ISR • Functions as the RTC timer for the program • Uses the 32.768kHz crystal • Clock dividers provide a 1s periodic interrupt • On interrupt, it increments a variable SecCount • After 3600 seconds, HourCount is incremented • If HourCount > 24, a SprayFlag is set • Execution time: <3us • Period: Periodic, every 1s

  8. TA1ISR • Used to generate the PWM signal for the servo control • Uses continuous mode timer and adjusts the interrupt period to produce the PWM signals • Produces servo_down and servo_up signals • PWMs with different duty cycles • Depends on the phase that is set by IOTask() • Execution Time: <2us • Period: Sporadic (once a day)

  9. P1ISR • Handles the PIR sensor input functionality • Triggers when a pin on port 1 transitions from logic low to logic high • Checks the spray flag from TA0ISR • If the spray flag is set, it wakes the CPU up from LPM3 • Execution time: ~2us • Period: Sporadic (occurs when PIR is tripped)

  10. Modules

More Related