1 / 23

HOME CONTROL SYSTEM

HOME CONTROL SYSTEM. By: Justin E. Klumpp & Leo L.S. Wan. Base Microcontroller. Motorola 9S12DP256B Bus Frequency at 24MHz Memory 256k bytes Flash 12k bytes RAM 4k bytes EEPROM. Kernel Choice. MicroC/OS-II Real-Time preemptive multitasking kernel

arav
Download Presentation

HOME CONTROL SYSTEM

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. HOME CONTROL SYSTEM By: Justin E. Klumpp & Leo L.S. Wan

  2. Base Microcontroller • Motorola 9S12DP256B • Bus Frequency at 24MHz • Memory • 256k bytes Flash • 12k bytes RAM • 4k bytes EEPROM

  3. Kernel Choice • MicroC/OS-II • Real-Time preemptive multitasking kernel • Semaphores used to communicate between tasks • Tick period, 1ms

  4. Kernel Tasks & Priority • StartTask Priority:4 • ControlTask Priority:5 • RTCTask Priority:6 • DAATask Priority:7 • SCITask Priority:8 • KeyTask Priority:9

  5. StartTask • Description: Initializes MicroC/OS and creates the other tasks during startup • Priority: 4 • Period: Executes once at startup • Execution Time: 150ms estimated

  6. ControlTask • Description: This task controls all remote modules and intertask communication. It interprets all user’s command, phone line termination, sprinkler control, DTMF input, and User Interface control. • Priority: 5 • Execution Time: 4ms (max) • Period: 10 ms (Periodic) • CPU Load: 0.4

  7. RTCTask • Description: Receive real time data from the DS1305 real time clock. • Priority: 6 • Execution Time: 35 us • Period: 1 second (Periodic) • CPU Load: 0.000035

  8. DAATask • Description: This task will scan the RING pin on the DAA chip for valid ring signals • Priority: 7 • Execution time: 50us • Period: 20ms • CPU Load: .0025

  9. SCITask • Description: Poll the SCI Receive Data Register Full (RDRF) flag, once flag is set, SCI clocks in data into a buffer. • Priority: 8 • Execution Time: 50us. • Period: 10 ms (Periodic) • CPU Load: 0.005

  10. KeyTask • Description: The main keypad scanning task. It scans the keypad and updates the keypad buffer if a key press was verified. • Priority: 9 • Period: 10ms • Execution Time: 50us • CPU Load: 0.005 Code Composed by: Todd Morton

  11. Total CPU Load • Max CPU Load: 0.4 + 0.000035 + 0.0025 + 0.005 + 0.005 = 0.412535 • Average CPU Load: 0.25

  12. Base Control Software

  13. Base Control Softwarecontinued….

  14. LCD Flow Diagram UI.c Public Function(s) LCD Driver LCD I/O LcdInit() LcdDispStrg() TimeSet() LcdDispChar() Lcd() PhoneSet() LcdMoveCursor() LcdCursor() AlarmSet() LcdDispTime() UIMenu() LcdClrDisp()

  15. Keypad Flow Diagram Keypad I/O Public Function(s) Keypad Driver 10msec KeyTask() KeyInit() Key.buffer KeyPend() KeyCode Table Key.flag

  16. Control Task Flow Diagram Awaiting Flags Functions to Call Control Task TimeSet() KeyPend() PhoneSet() AlarmSet() 10msec TimePend() UIMenu() ControlTask() SCIPend() PlayMSG() DTMFWrite() RingPend() EESectModify() DTMFRead() WriteSCI() LcdDispTime()

  17. MCU: Control Modules • MCU: PSoC CY8C29466 • Operating Voltage: 5 volts • Clock Frequency: 6 MHz • Microcontroller will only run one continuous task so no kernel is required • Memory, MCU #1 (Bytes): 25 RAM, 1042 ROM • Memory, MCU #2 (Bytes): 20 RAM, 904 ROM

  18. Wireless Alarm Software

  19. AlarmTask • Description: Send a byte of data at a rate of 300bps. The byte of data contains the current state of the alarm sensor, and a unique alarm ID number. • Period: Runs on a sleep timer that wakes up every second • Execution time: ~1us • CPU Load: 0.000001

  20. ISR: Sleep Timer • Description: This timer is used to put the Microcontroller into a sleep mode, where the current consumption on the PSoC is ~2.9uA. • Execution Time: ~1us • Period: 1 second • CPU Load: 0.000001

  21. Data Flow Diagram: ISR Sleep Timer Interrupt

  22. Appliance Control Software

  23. LightCtrlTask • Description: Polls on a valid data flag to be set, if set clocks in bits of data. Receive byte of data at 300bps; data contains control bits to turn on/off output pins. Controls the state of a relay; on or off. • Execution time: ~1us • Period: Continuous Operation • CPU Load: 1

More Related