![]() |
||||||||||||
Code Listing | ||||||||||||
ASM Code VHDL Code |
||||||||||||
Pseudo Code for the Motorola HC12 Program | ||||||||||||
* Set parallel I/O port registers * Initialize the Hardware ports * Initialize the LCD display * Set IRQ to level edge triggering PROGRAMSTART: * Display "System Ready" on the first line of the LCD * Display " " on the second line of the LCD * Enable IRQ so that IRQ_PROC can be called (CLI) * Scan for any triggered inputs * If none are triggered, allow for password to be entered * If triggered, loop in scanning mode until untriggered * Allow for password to be entered (CODEENTER) * If the proper sequence is entered, Display "System Armed" on the first line of the LCD * If an interrupt is called, display the appropriate message on the second line of the LCD * If triggered, send a signal to the Altera to activate siren * Scan for an entered password * When the correct password is entered branch to PROGRAMSTART Complex Description for Interrupt Subroutines * Clear the LCD * If the siren is on, assign a variable a specific value depending on which keypad button has been pressed (this means that the system will only register values from the keypad) * If the siren is not on, assign a variable a specific value depending on which button (or motion sensor) has been pressed (this allows for the system to know what is going on) For the on-board buttons and the motion sensor: * Display "Sensor Tripped" on the first line of the LCD * Display "Zone X" on the second line of the LCD, where X is the zone or * Display "Motion Sensor" on the second line of the LCD For the Keypad Buttons: * Display "*" on the second line of the LCD (this means no one else can see the code that is being typed in) |
||||||||||||
Pseudo Code for the Altera 7000 series Program | ||||||||||||
* Make references to the IEEE Library (ieee.std_logic1164.all ; ieee.std_logic_unsigned.all) * Define Entities (clock, port A, port B, LCDE, LCDRW, LCDRS, LCD, buttons, LED, PAOUT, Left Hp, Right Hp, IRQ, XIRQ, keypad, motion, siren) * Describe the System Architecture ***** Port B connects to the LCD bus ***** LCD register select ***** LCD read/write ***** LCD enable ***** Connect the buttons to 4 pins of Port A ***** Set XIRQ to "1" - no interrupt state ***** Set up ports for added hardware * Signals for port T come from HC12 * When port T = 1, turn siren on * When port T = 0, turn siren off * When a button or motion sensor is triggered, cause the LED to turn on and send a specific signal to the HC12 |
||||||||||||
Signals Sent to Port A After Being Encoded in the Altera Chip | ||||||||||||
![]() |
||||||||||||
![]() |
||||||||||||
Introduction User's Manual Project Design Discussion and Conclusions Team Members |