system software design colin gatlin may 12, 2009 western washington university
TRANSCRIPT
System Software Design
Colin GatlinMay 12, 2009
Western Washington University
Supported Protocols RC5 (Phillips) RC6 Mode 0/6 (Phillips) NEC (Japan) SIRCS 12/15/20 (Sony/PS2) NRC17 (Nokia) REC-80 (Panasonic) RECS-80 normal/extended (Phillips) JVC Sharp RCA (XBOX)
General Protocol Features Encoding
ManchesterPulse DistancePulse Width
Carrier frequency Number of information bits Packet length/width Maximum and minimum high and low pulse
duration Start and end signals
Determining The Protocol1) Number of pulses
2) Packet length
3) Maximum zero duration within bit stream
Determining The Protocol – cont.Pulse Count Possible Protocols Final Method
7-9 RC5 -
10-12 RC5, NRC17 Packet Length
13 RC5, NRC17, RC6Mode0, RECS-80norm, SIRCS12 Max. Low Time
14 RC5, NRC17, RC6Mode0, RECS-80ext Max. Low Time
15 NRC17, RC6Mode0 Packet Length
16 NRC17, RC6Mode0, SIRCS15 Max. Low Time
17 NRC17, RC6Mode0, JVC Max. Low Time
18 NRC17, RC6Mode0 Packet Length
19,20 RC6Mode0 -
21 RC6Mode0, SIRCS20 Max. Low Time
22 RC6Mode0, RC6Mode6 Packet Length
23,24, 26-32, 34-38 RC6Mode6 -
25 RC6Mode6, RCA Packet Length
33 RC6Mode6, NEC Packet Length
50 REC-80 -
General Device Requirements Processor:
Cypress PSoC CY8C24894
Clock Frequency:24MHz
Memory Requirements:ROM: 6kB (2.5kB API + 3.5kB Project Code)RAM: 300B (45B API + 120B Buffer + 135B Code)
PSoC Block Requirements:2 Digital Blocks1 Analog Continuous Time Block
Kernel
Cooperative Timeslice Kernel Shortest IR pulse:
158μs
Timeslice Period: 100μs
3 main operations:Store IR bit streamDecode bit streamUSB communication
TimeSlicer() Requires an 8-bit Timer (1 digital block)
to generate an interrupt every 100μs. TimeSlicer() polls a variable, blocking
until the variable is non-zero. Execution Time:
<1μs Execution Period:
100μs (Periodic) CPU Load:
1%
StoreIR() Requires a comparator (1 analog
continuous time block). Comparator output connected through an inverter to the Enable of an 8-bit Counter (1 digital block).
Stores the appropriate bit in the next position of the buffer.
Counts pulses and maximum consecutive zero reads.
Determines the end of an IR signal and initiates the decode process.
StoreIR() - continued
Execution time (max): 15μs Execution period: 100μs (Periodic) CPU Load: 15%
DecodeIR() Determines the IR protocol from specific
features of the stored bit stream.Number of pulsesPacket lengthMaximum consecutive zero reads
Decodes the bit stream accordingly. Execution time (max): 40μs Execution period (min): 30ms (Sporadic) CPU Load:
0.133%
USB
4 Transfer TypesControlBulkInterruptIsochronous
Only host can initiate a transfer
USBComm()
Uses Cypress API to communicate to a host USB device.
Uses IN interrupt transfers to send the decoded data to the host.
Execution time (max): 60μs Execution period (min): 30ms (Sporadic) CPU Load:
0.2%
CPU Load
DecodeIR() and USBComm() always run on adjacent slices.
Max execution time per slice:1μs + 15μs + 60μs = 76μs
Max CPU Load:1% + 15% + 0.133% + 0.2% = 16.33%
ModulesModule Name API Functions
Timer8 Timer8_Start()Timer8_EnableInt()
CMPPRG(Comparator)
CMPPRG_Start()
Counter8 Counter8_Start()Counter8_bReadCounter()
USBFS USBFS_Start()USBFS_SetPowerStatus()USBFS_bGetConfiguration()USBFS_bGetEPState()USBFS_LoadInEP()
Requesting A USB Transfer1) PC application uses Windows API
2) User-mode custom driver sends IRP to kernel-mode USB host driver
3) Host initializes the transfer on the bus
4) Response returned, either new data or no data
Requesting A USB Transfer – cont.