EE 446 Project Assignment • Top Design • Sensor Components • Pin Assignment and Configuration • Completed Physical Setup • Project Tasks
Dec 28, 2015
EE 446 Project Assignment
• Top Design• Sensor Components• Pin Assignment and Configuration• Completed Physical Setup• Project Tasks
Project Top Design
Motion Detector (HC-SR501)
• Select Digital Input Pin component
• Drag and drop to design
Motion Detector (HC-SR501)
Configure Digital Input Pin
Motion Detector (HC-SR501)
Configure Digital Input Pin
PWM – Servo Motor
• Add PWM component to design.
PWM – Servo Motor
Configure PWM
PWM – Servo Motor
Configure PWM
PWM – Clock
• Add clock to design.
PWM - Clock
Configure Clock
PWM - Clock
Configure Clock
PWM - Clock
• Connect the clock to the PWM.
Servo Motor – Digital Output Pin
• Add Digital Output Pin.
Servo Motor – Digital Output Pin
Configure digital output pin, then connect it to the pwm output port of the PWM.
Servo Motor – Digital Logic Zero
• Add Digital Logic Zero.
Servo Motor – Digital Logic Zero
• Connect Digital Logic Zero to the kill and reset inputs of the PWM.
Timer
• Add Timer.
Timer
Configure Timer
Timer
Configure Timer
Timer Clock
Configure the clock componentattached to the timer.
Timer Clock
Interrupt Service Routine (ISR)
• Add isr and connect it to the interrupt output of the timer.
Interrupt Service Routine (ISR)
Configure the isr.
Interrupt Service Routine (ISR)
Configure the isr.
LED Output
Add a Digital Output pin and attach it to the tc ouput of the timer.Configure the Digital Output Pin.
Cap Sense
• Add a CapSense component.
Cap Sense - General
Configure the CapSense component.
Cap Sense - General
Configure the CapSense component.
Cap Sense - Widgets Configuration
Configure the CapSense component.
Cap Sense - Widgets ConfigurationAdd Button0, Button1, and LinearSlider0
Configure the CapSense component.
Cap Sense – Scan Order
Configure the CapSense component.
Cap Sense – Scan Order
Configure the CapSense component.
Cap Sense – Advanced
Configure the CapSense component.
Cap Sense – Advanced
Configure the CapSense component.
LCD Char Display
• Add a Character LCD component.
LCD Char Display
Configure the Character LCD.
Inter-Integrated Circuit (I2C)
• Add an I2C Master component.
Inter-Integrated Circuit (I2C)
Configure the I2C.
Inter-Integrated Circuit (I2C)
Configure the I2C.
I2C – Serial Clock (SCL) Type
Configure the I2C.
I2C – Serial Data Line (SDL) Type
Configure the I2C.
Digital Output Pin – Temp Alarm
Add a Digital Output Pin to the design. Do not connect it to anything.Configure the pin.
Pin Configuration
Complete Physical Set-up
LCD Display
Servo MotorJTAG Programming Cable
Cap Sense Area
P0_6 Cap Sense
TMP 102 Sensor
Power Cable
USB to JTAG Cable
JTAG PROG
HC-SR501 Motion Sensor
PSoC and PSoC-related Datasheets
PSoC Tutorials and Project Documents
Assignment 1: Initialization / Startup Code
Assignment 2: PWM Configuration
Assignment 3: Motion Detection Infinite Loop
Assignment 4: Timer, TMP102, and Interrupt Service Routine (ISR)
Assignment 5: Password Set
Assignment 6: LCD Configuration
Assignment 7: Password Verification
Assignment 8: I2C Protocol Configuration - TMP 102 Sensor
Transaction over I2C Bus
Datasheet: CyI2C_V_2.0_001-62887_I2C_Master_Multi_Master_Slave
Datasheet: CyI2C_V_2.0_001-62887_I2C_Master_Multi_Master_Slave
Assignment 9: Setting ISR Interrupt using Timer
Assignment 10: Initialize TMP 102 Interrupt
New Slides
Timer: Datasheet Access
Timer API
Timer API
Starting Timer – main.c
TMP102.H Header File
•temp_interrupt is a software flag that is set when the interrupt occurs• when this flag is set, read the temperature in the main.c
Interrupt Service Routine Clearing Register, Setting a flag
•Interrupt Service Request (ISR) has been set to TEMPISR vector•Read Timer Status Register to clear Interrupt and set the software flag
Interrupt Service Routine: Datasheet Access
Interrupt Service Routine API
Interrupt Service Routine API
Interrupt Service Routine Function Description: ISR_Start
Interrupt Service Routine Function Description: ISR_SetVector
Interrupt Service Routine Initializing Interrupt
Set the Interrupt Vector : ISR_SetVector(…)
Conversion Rate Time
TMP102 Serial Bus Address
TMP102 Serial Bus Address
I2C
• I2C connects to multiple slave devices (e.g. temperature sensor).• Each of the slave devices has a unique address• To access I2C devices a device address, register address, a number of bytes, buffer pointer have to be specified• In the project, use existing PSoC_i2c_read() function to read information from the temperature sensor
I2C Datasheet Access
Provided I2C Functions
I2C Read Function