|
|

这这……,你是怎么作出这篇有板有眼的理论的?
Saphire 发表于 2011-7-27 12:51  就拿先在刚出的V7芯片来举例吧。它用的是 holtek HT82A523R 。简介如下:
Features
- Operating voltage:
fSYS=6MHz & 12MHz: 3.3V~5.5V - 40 bidirectional I/O lines (max.)
- One 16-bit programmable timer/event counter with overflow interrupt
- One 8-bit programmable timer/event counter with overflow interrupt
- Only crystal oscillator (6MHz or 12MHz)
- Watchdog Timer
- 4096x15 program memory ROM
- 192x8 data memory RAM
- HALT function and wake-up feature reduce power consumption
- 6-level subroutine nesting
- 2 sets of SIO (synchronous serial I/O) function
- Supports Interrupt, Control, Bulk transfer
- USB 2.0 full speed function compatible
- 4 endpoints supported (endpoint 0 included)
- Total FIFO size is 152 bytes
(8, 8, 8, 64x2 for EP0~EP3) - Bit manipulation instruction
- 15-bit table read instruction
- 63 powerful instructions
- All instructions in one or two machine cycles
- Low voltage reset function
- 32/64-pin LQFP package
48-pin SSOP package
52-pin QFP package
注意我标红的RAM是 192字节(192x8bits)。
然后看 holtek HT82A523R 的data sheet(来源:http://www.holtek.com/pdf/computer/82a523rv150.pdf)第18页
USB Interface
The HT82A523R has 4 Endpoints (EP0~EP3).
EP0~EP2 are support Interrupt transfer, EP3 is support
Bulk transfer.
There are 12 registers, including USC (20H), USR
(21H), UCC (22H), AWR (address+remote wake-up
23H), STALL (24H), SIES (25H), MISC (26H), SETIO
(27H), FIFO0 (28H), FIFO1 (29H), FIFO2 (2AH) and
FIFO3 (2BH) used for the USB function.
The FIFO size of each FIFO is 8 byte (FIFO0), 8 byte
(FIFO1), 8 byte (FIFO2) and 128 byte (FIFO3), and total of 152
bytes.
但是看第8页的RAM layout得知General Purpose Data Memory(192Bytes)是从040H开始的,
那些USC USR UCC...FIFO3 register不占这部分RAM,所以USB实际占用的RAM是FIFO buffer 0-3,一共是
8+8+8+128=152字节。留给程序的可用内存只有40字节了,当然不可能保存下全部的键盘按键状态。
而更早推出的键盘,用的芯片规格还要低,比如Plum无冲金标,用的是 holtek HT82K95E,RAM只有160字节。用了USB后程序可以用的才8字节,能做6键无冲已经很不容易了。
|
|