You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

225 lines
15 KiB

12 years ago
  1. ;---------------------------------------------------------------------------
  2. ;
  3. ;
  4. ;
  5. ;
  6. ; FILE NAME : C8051F310.INC
  7. ; TARGET MCUs : C8051F310, 'F311
  8. ; DESCRIPTION : Register/bit definitions for the C8051F31x product family.
  9. ;
  10. ; REVISION 1.3
  11. ; -- added ESPI0 and PSPI0
  12. ; REVISION 1.2
  13. ; -- added VDM0CN (0xff)
  14. ;
  15. ; REVISION 1.1
  16. ; -- changed TARGET MCUs to 'F310, 'F311
  17. ; -- SPICFG --> SPI0CFG
  18. ; -- SPICKR --> SPI0CKR
  19. ; -- SPIDAT --> SPI0DAT
  20. ; -- removed CLKMUL (0xb9)
  21. ; -- AMUX0N --> AMX0N
  22. ; -- AMUX0P --> AMX0P
  23. ;
  24. ;---------------------------------------------------------------------------
  25. ; BYTE Registers
  26. P0 DATA 080H ; PORT 0
  27. SP DATA 081H ; STACK POINTER
  28. DPL DATA 082H ; DATA POINTER - LOW BYTE
  29. DPH DATA 083H ; DATA POINTER - HIGH BYTE
  30. PCON DATA 087H ; POWER CONTROL
  31. TCON DATA 088H ; TIMER CONTROL
  32. TMOD DATA 089H ; TIMER MODE
  33. TL0 DATA 08AH ; TIMER 0 - LOW BYTE
  34. TL1 DATA 08BH ; TIMER 1 - LOW BYTE
  35. TH0 DATA 08CH ; TIMER 0 - HIGH BYTE
  36. TH1 DATA 08DH ; TIMER 1 - HIGH BYTE
  37. CKCON DATA 08EH ; CLOCK CONTROL
  38. PSCTL DATA 08FH ; PROGRAM STORE R/W CONTROL
  39. P1 DATA 090H ; PORT 1
  40. TMR3CN DATA 091H ; TIMER 3 CONTROL
  41. TMR3RLL DATA 092H ; TIMER 3 RELOAD LOW
  42. TMR3RLH DATA 093H ; TIMER 3 RELOAD HIGH
  43. TMR3L DATA 094H ; TIMER 3 LOW BYTE
  44. TMR3H DATA 095H ; TIMER 3 HIGH BYTE
  45. SCON0 DATA 098H ; SERIAL PORT 0 CONTROL
  46. SBUF0 DATA 099H ; SERIAL PORT 0 BUFFER
  47. CPT1CN DATA 09AH ; COMPARATOR 1 CONTROL
  48. CPT0CN DATA 09BH ; COMPARATOR 0 CONTROL
  49. CPT1MD DATA 09CH ; COMPARATOR 1 MODE
  50. CPT0MD DATA 09DH ; COMPARATOR 0 MODE
  51. CPT1MX DATA 09EH ; COMPARATOR 1 MUX
  52. CPT0MX DATA 09FH ; COMPARATOR 0 MUX
  53. P2 DATA 0A0H ; PORT 2
  54. SPI0CFG DATA 0A1H ; SPI0 CONFIGURATION
  55. SPI0CKR DATA 0A2H ; SPI0 CLOCK CONFIGURATION
  56. SPI0DAT DATA 0A3H ; SPI0 DATA
  57. P0MDOUT DATA 0A4H ; PORT 0 OUTPUT MODE
  58. P1MDOUT DATA 0A5H ; PORT 1 OUTPUT MODE
  59. P2MDOUT DATA 0A6H ; PORT 2 OUTPUT MODE
  60. P3MDOUT DATA 0A7H ; PORT 3 OUTPUT MODE
  61. IE DATA 0A8H ; INTERRUPT ENABLE
  62. CLKSEL DATA 0A9H ; CLOCK SOURCE SELECT
  63. EMI0CN DATA 0AAH ; EXTERNAL MEMORY INTERFACE CONTROL
  64. P3 DATA 0B0H ; PORT 3
  65. OSCXCN DATA 0B1H ; EXTERNAL OSCILLATOR CONTROL
  66. OSCICN DATA 0B2H ; INTERNAL OSCILLATOR CONTROL
  67. OSCICL DATA 0B3H ; INTERNAL OSCILLATOR CALIBRATION
  68. FLACL DATA 0B5H ; FLASH ACCESS LIMIT
  69. FLSCL DATA 0B6H ; FLASH SCALE
  70. FLKEY DATA 0B7H ; FLASH LOCK & KEY
  71. IP DATA 0B8H ; INTERRUPT PRIORITY
  72. AMX0N DATA 0BAH ; ADC0 MUX NEGATIVE CHANNEL SELECTION
  73. AMX0P DATA 0BBH ; ADC0 MUX POSITIVE CHANNEL SELECTION
  74. ADC0CF DATA 0BCH ; ADC0 CONFIGURATION
  75. ADC0L DATA 0BDH ; ADC0 DATA LOW
  76. ADC0H DATA 0BEH ; ADC0 DATA HIGH
  77. SMB0CN DATA 0C0H ; SMBUS CONTROL
  78. SMB0CF DATA 0C1H ; SMBUS CONFIGURATION
  79. SMB0DAT DATA 0C2H ; SMBUS DATA
  80. ADC0GTL DATA 0C3H ; ADC0 GREATER-THAN LOW
  81. ADC0GTH DATA 0C4H ; ADC0 GREATER-THAN HIGH
  82. ADC0LTL DATA 0C5H ; ADC0 LESS-THAN LOW
  83. ADC0LTH DATA 0C6H ; ADC0 LESS-THAN HIGH
  84. TMR2CN DATA 0C8H ; TIMER 2 CONTROL
  85. TMR2RLL DATA 0CAH ; TIMER 2 RELOAD LOW
  86. TMR2RLH DATA 0CBH ; TIMER 2 RELOAD HIGH
  87. TMR2L DATA 0CCH ; TIMER 2 LOW BYTE
  88. TMR2H DATA 0CDH ; TIMER 2 HIGH BYTE
  89. PSW DATA 0D0H ; PROGRAM STATUS WORD
  90. REF0CN DATA 0D1H ; VOLTAGE REFERENCE 0 CONTROL
  91. P0SKIP DATA 0D4H ; PORT 0 CROSSBAR SKIP
  92. P1SKIP DATA 0D5H ; PORT 1 CROSSBAR SKIP
  93. P2SKIP DATA 0D6H ; PORT 2 CROSSBAR SKIP
  94. PCA0CN DATA 0D8H ; PCA0 CONTROL
  95. PCA0MD DATA 0D9H ; PCA0 MODE
  96. PCA0CPM0 DATA 0DAH ; PCA0 MODULE 0 MODE
  97. PCA0CPM1 DATA 0DBH ; PCA0 MODULE 1 MODE
  98. PCA0CPM2 DATA 0DCH ; PCA0 MODULE 2 MODE
  99. PCA0CPM3 DATA 0DDH ; PCA0 MODULE 3 MODE
  100. PCA0CPM4 DATA 0DEH ; PCA0 MODULE 4 MODE
  101. ACC DATA 0E0H ; ACCUMULATOR
  102. XBR0 DATA 0E1H ; DIGITAL CROSSBAR CONFIGURATION REGISTER 0
  103. XBR1 DATA 0E2H ; DIGITAL CROSSBAR CONFIGURATION REGISTER 1
  104. IT01CF DATA 0E4H ; INT0/INT1 CONFIGURATION
  105. EIE1 DATA 0E6H ; EXTERNAL INTERRUPT ENABLE 1
  106. ADC0CN DATA 0E8H ; ADC 0 CONTROL
  107. PCA0CPL1 DATA 0E9H ; PCA0 MODULE 1 CAPTURE/COMPARE REGISTER LOW BYTE
  108. PCA0CPH1 DATA 0EAH ; PCA0 MODULE 1 CAPTURE/COMPARE REGISTER HIGH BYTE
  109. PCA0CPL2 DATA 0EBH ; PCA0 MODULE 2 CAPTURE/COMPARE REGISTER LOW BYTE
  110. PCA0CPH2 DATA 0ECH ; PCA0 MODULE 2 CAPTURE/COMPARE REGISTER HIGH BYTE
  111. PCA0CPL3 DATA 0EDH ; PCA0 MODULE 3 CAPTURE/COMPARE REGISTER LOW BYTE
  112. PCA0CPH3 DATA 0EEH ; PCA0 MODULE 3 CAPTURE/COMPARE REGISTER HIGH BYTE
  113. RSTSRC DATA 0EFH ; RESET SOURCE
  114. B DATA 0F0H ; B REGISTER
  115. P0MDIN DATA 0F1H ; PORT 0 INPUT MODE REGISTER
  116. P1MDIN DATA 0F2H ; PORT 1 INPUT MODE REGISTER
  117. P2MDIN DATA 0F3H ; PORT 2 INPUT MODE REGISTER
  118. P3MDIN DATA 0F4H ; PORT 3 INPUT MODE REGISTER
  119. EIP1 DATA 0F6H ; EXTERNAL INTERRUPT PRIORITY 1
  120. SPI0CN DATA 0F8H ; SPI0 CONTROL
  121. PCA0L DATA 0F9H ; PCA0 COUNTER REGISTER LOW BYTE
  122. PCA0H DATA 0FAH ; PCA0 COUNTER REGISTER HIGH BYTE
  123. PCA0CPL0 DATA 0FBH ; PCA MODULE 0 CAPTURE/COMPARE REGISTER LOW BYTE
  124. PCA0CPH0 DATA 0FCH ; PCA MODULE 0 CAPTURE/COMPARE REGISTER HIGH BYTE
  125. PCA0CPL4 DATA 0FDH ; PCA MODULE 4 CAPTURE/COMPARE REGISTER LOW BYTE
  126. PCA0CPH4 DATA 0FEH ; PCA MODULE 4 CAPTURE/COMPARE REGISTER HIGH BYTE
  127. VDM0CN DATA 0FFH ; VDD MONITOR CONTROL
  128. ;------------------------------------------------------------------------------
  129. ;BIT DEFINITIONS
  130. ;
  131. ; TCON 88H
  132. IT0 BIT TCON.0 ; EXT. INTERRUPT 0 TYPE
  133. IE0 BIT TCON.1 ; EXT. INTERRUPT 0 EDGE FLAG
  134. IT1 BIT TCON.2 ; EXT. INTERRUPT 1 TYPE
  135. IE1 BIT TCON.3 ; EXT. INTERRUPT 1 EDGE FLAG
  136. TR0 BIT TCON.4 ; TIMER 0 ON/OFF CONTROL
  137. TF0 BIT TCON.5 ; TIMER 0 OVERFLOW FLAG
  138. TR1 BIT TCON.6 ; TIMER 1 ON/OFF CONTROL
  139. TF1 BIT TCON.7 ; TIMER 1 OVERFLOW FLAG
  140. ; SCON0 0x98
  141. RI0 BIT SCON0.0 ; RECEIVE INTERRUPT FLAG
  142. TI0 BIT SCON0.1 ; TRANSMIT INTERRUPT FLAG
  143. RB80 BIT SCON0.2 ; RECEIVE BIT 8
  144. TB80 BIT SCON0.3 ; TRANSMIT BIT 8
  145. REN0 BIT SCON0.4 ; RECEIVE ENABLE
  146. MCE0 BIT SCON0.5 ; MULTIPROCESSOR COMMUNICATION ENABLE
  147. S0MODE BIT SCON0.7 ; SERIAL MODE CONTROL BIT 0
  148. ; IE 0xA8
  149. EX0 BIT IE.0 ; EXTERNAL INTERRUPT 0 ENABLE
  150. ET0 BIT IE.1 ; TIMER 0 INTERRUPT ENABLE
  151. EX1 BIT IE.2 ; EXTERNAL INTERRUPT 1 ENABLE
  152. ET1 BIT IE.3 ; TIMER 1 INTERRUPT ENABLE
  153. ES0 BIT IE.4 ; UART0 INTERRUPT ENABLE
  154. ET2 BIT IE.5 ; TIMER 2 INTERRUPT ENABLE
  155. ESPI0 BIT IE.6 ; SPI0 INTERRUPT ENABLE
  156. EA BIT IE.7 ; GLOBAL INTERRUPT ENABLE
  157. ; IP 0xB8
  158. PX0 BIT IP.0 ; EXTERNAL INTERRUPT 0 PRIORITY
  159. PT0 BIT IP.1 ; TIMER 0 PRIORITY
  160. PX1 BIT IP.2 ; EXTERNAL INTERRUPT 1 PRIORITY
  161. PT1 BIT IP.3 ; TIMER 1 PRIORITY
  162. PS0 BIT IP.4 ; UART0 PRIORITY
  163. PT2 BIT IP.5 ; TIMER 2 PRIORITY
  164. PSPI0 BIT IP.6 ; SPI0 INTERRUPT PRIORITY
  165. ; SMB0CN 0xC0
  166. SI BIT SMB0CN.0 ; SMBUS0 INTERRUPT FLAG
  167. ACK BIT SMB0CN.1 ; ACKNOWLEDGE FLAG
  168. ARBLOST BIT SMB0CN.2 ; ARBITRATION LOST INDICATOR
  169. ACKRQ BIT SMB0CN.3 ; ACKNOWLEDGE REQUEST
  170. STO BIT SMB0CN.4 ; STOP FLAG
  171. STA BIT SMB0CN.5 ; START FLAG
  172. TXMODE BIT SMB0CN.6 ; TRANSMIT MODE INDICATOR
  173. MASTER BIT SMB0CN.7 ; MASTER/SLAVE INDICATOR
  174. ; TMR2CN 0xC8
  175. T2XCLK BIT TMR2CN.0 ; TIMER 2 EXTERNAL CLOCK SELECT
  176. TR2 BIT TMR2CN.2 ; TIMER 2 ON/OFF CONTROL
  177. T2SPLIT BIT TMR2CN.3 ; TIMER 2 SPLIT MODE ENABLE
  178. TF2LEN BIT TMR2CN.5 ; TIMER 2 LOW BYTE INTERRUPT ENABLE
  179. TF2L BIT TMR2CN.6 ; TIMER 2 LOW BYTE OVERFLOW FLAG
  180. TF2H BIT TMR2CN.7 ; TIMER 2 HIGH BYTE OVERFLOW FLAG
  181. ; PSW 0xD0
  182. P BIT PSW.0 ; ACCUMULATOR PARITY FLAG
  183. F1 BIT PSW.1 ; USER FLAG 1
  184. OV BIT PSW.2 ; OVERFLOW FLAG
  185. RS0 BIT PSW.3 ; REGISTER BANK SELECT 0
  186. RS1 BIT PSW.4 ; REGISTER BANK SELECT 1
  187. F0 BIT PSW.5 ; USER FLAG 0
  188. AC BIT PSW.6 ; AUXILIARY CARRY FLAG
  189. CY BIT PSW.7 ; CARRY FLAG
  190. ; PCA0CN 0xD8H
  191. CCF0 BIT PCA0CN.0 ; PCA0 MODULE 0 CAPTURE/COMPARE FLAG
  192. CCF1 BIT PCA0CN.1 ; PCA0 MODULE 1 CAPTURE/COMPARE FLAG
  193. CCF2 BIT PCA0CN.2 ; PCA0 MODULE 2 CAPTURE/COMPARE FLAG
  194. CCF3 BIT PCA0CN.3 ; PCA0 MODULE 3 CAPTURE/COMPARE FLAG
  195. CCF4 BIT PCA0CN.4 ; PCA0 MODULE 4 CAPTURE/COMPARE FLAG
  196. CR BIT PCA0CN.6 ; PCA0 COUNTER RUN CONTROL
  197. CF BIT PCA0CN.7 ; PCA0 COUNTER OVERFLOW FLAG
  198. ; ADC0CN 0xE8H
  199. AD0CM0 BIT ADC0CN.0 ; ADC0 CONVERSION MODE SELECT 0
  200. AD0CM1 BIT ADC0CN.1 ; ADC0 CONVERSION MODE SELECT 1
  201. AD0CM2 BIT ADC0CN.2 ; ADC0 CONVERSION MODE SELECT 2
  202. AD0WINT BIT ADC0CN.3 ; ADC0 WINDOW COMPARE INTERRUPT FLAG
  203. AD0BUSY BIT ADC0CN.4 ; ADC0 BUSY FLAG
  204. AD0INT BIT ADC0CN.5 ; ADC0 CONVERISION COMPLETE INTERRUPT FLAG
  205. AD0TM BIT ADC0CN.6 ; ADC0 TRACK MODE
  206. AD0EN BIT ADC0CN.7 ; ADC0 ENABLE
  207. ; SPI0CN 0xF8H
  208. SPIF BIT SPI0CN.7 ; SPI 0 INTERRUPT FLAG
  209. WCOL BIT SPI0CN.6 ; SPI 0 WRITE COLLISION FLAG
  210. MODF BIT SPI0CN.5 ; SPI 0 MODE FAULT FLAG
  211. RXOVRN BIT SPI0CN.4 ; SPI 0 RX OVERRUN FLAG
  212. NSSMD1 BIT SPI0CN.3 ; SPI 0 SLAVE SELECT MODE 1
  213. NSSMD0 BIT SPI0CN.2 ; SPI 0 SLAVE SELECT MODE 0
  214. TXBMT BIT SPI0CN.1 ; SPI 0 TRANSMIT BUFFER EMPTY
  215. SPIEN BIT SPI0CN.0 ; SPI 0 SPI ENABLE