?? readme.txt
字號:
This directory contains 8051 firmware that is based on the frameworks source
code for the Cypress EZ-USB FX chip.
For more information on the firmware frameworks, see the firmware frameworks
document in the DOCS directory.
peripheral protoboard hardwired pin-assignments:
KEYPAD -> FX
==================
1 PD0 -needs 470k ohm pull-up resistor to 3.3v
2 PD1 -needs 470k ohm pull-up resistor to 3.3v
3 PD2 -needs 470k ohm pull-up resistor to 3.3v
4 PD3 -needs 470k ohm pull-up resistor to 3.3v
5 PD4
6 PD5
7 PD6
8 PD7
NOTES:
It's usually a good idea to include ~100 ohm series resistor(s)
right at the header to all keypad I/O to help against ESD strikes...
This example provides/demonstrates the following:
- interface 4x4 keypad module via port I/O
- basic low-level physical interface function(s), to scan keys, etc.
- background timer2 usage for key closure software debouncing
- simple queue buffering user inputs (4), utilizing circular buffer, and ef/ff/bc
- endp 2 in buffer available in TD_Poll() to dequeue user input (1 per endp buf)
- vend cmnds: flush queue (0xB0), read queue byte count (0xB1)
After downloading the firmware "kpdio.hex" the DK should look like this:
- all debug LED[3:0]'s should be "OFF" (must have RevD or later DK board)
- green bkpt LED should be "ON" (should remain so throughout testing)
Steps:
- do a "GetPipes"...
- do a "View|PendingOps", if not already selected...
- select "PIPES: Endpoint 2 IN", if not already selected...
- type "0xB0" into "REQ" dialog box, to flush the queue...
- type "1" into "LENGTH" dialog box...
- select "DIR: 1 IN", if not already selected...
- hit "VENDREQ" button...the "text box" last line should show "0000 00"
- type "0xB1" into "REQ" dialog box, to read queue byte count...
- type "1" into "LENGTH" dialog box, if not already selected...
- select "DIR: 1 IN", if not already selected...
- hit "VENDREQ" button...the "text box" last line should show "0000 00"
...feel free to use these vend cmnds, as you wish...
- press & hold key "1", debug LED3 should turn "ON" until...
- release key "1", debug LED3 should turn "OFF"
- select "PIPES: Endpoint 2 IN", if not already selected...
- hit "BulkTrans" button, request should return with "0000 31"...
- select "PIPES: Endpoint 2 IN", if not already selected...
- hit "BulkTrans" button, request should pend until...
- press & release key "1", request should return with "0000 31"...
:to test enqueue:
- press & release key "1", LED3 should "blink" (key gets dequeued into endp buf)
- press & release key "2", LED3 should "blink" (key gets dequeued into endp buf)
- press & release key "3", LED3 should "blink",
& LED0 turns "ON" (queue "not empty", endp full)
- press & release key "4", LED3 should "blink",
& LED0 stays "ON" (queue "not empty", endp full)
- press & release key "5", LED3 should "blink",
& LED0 stays "ON" (queue "not empty", endp full)
- press & release key "6", LED3 should "blink",
& LED0 stays "ON" (queue "not empty", endp full)
& LED1 turns "ON" (queue "full")
:to test dequeue:
- select "PIPES: Endpoint 2 IN", if not already selected...
- hit "BulkTrans" button, request should return with "0000 31",
LED1 turns OFF (queue "not full")
- hit "BulkTrans" button, request should return with "0000 32"
- hit "BulkTrans" button, request should return with "0000 33"
- hit "BulkTrans" button, request should return with "0000 34",
LED0 turns OFF (queue "empty")
- hit "BulkTrans" button, request should return with "0000 35", (endp buf)
- hit "BulkTrans" button, request should return with "0000 36", (endp buf)
NOTES:
- if debug LED3 is constantly "OFF" when keys pressed, then no keypad found
- if debug LED3 is constantly "ON", check hardware connections (row stuck lo)
- if "green bkpt" LED is constantly "OFF" then TD_Poll( ) isn't being serviced
- typ. when a standard 4x4 keypad module is installed in the opposite direction
- ...the following keys may still be decoded properly ('A','6','8','*')
- ...if so, this can easily be fixed in firmware by using an alternate key_mat
- ...typ. the array values will be rotated by 90 degrees to the right/left
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -