⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cc6.lst

📁 用于对无刷直流电机的启动及控制程序
💻 LST
📖 第 1 页 / 共 5 页
字号:
 149   1      
 150   1        ///  -----------------------------------------------------------------------
 151   1        ///  Configuration of CCU6 Timer 13:
 152   1        ///  -----------------------------------------------------------------------
 153   1        ///  - prescaler factor is 1
 154   1        ///  - timer 13 run bit is reset
 155   1        ///  - trigger control is disabled
 156   1        ///  - single shot mode is disabled
 157   1        ///  - interrupt on period match is disabled
 158   1        ///  - interrupt on compare match is disabled
 159   1      
 160   1        CCU6_T13PRL    =  0x01;        // load CCU6 T13 period register low
 161   1        CCU6_T13PRH    =  0x00;        // load CCU6 T13 period register high
 162   1      
 163   1        ///  -----------------------------------------------------------------------
 164   1        ///  Configuration of Dead-Time Control Register for Timer T12
C51 COMPILER V7.50   CC6                                                                   10/12/2005 16:46:09 PAGE 14  

 165   1        ///  -----------------------------------------------------------------------
 166   1      
 167   1        CCU6_T12DTCL   =  0x08;        // load CCU6 dead time control register low 
 168   1                                       // for timer T12
 169   1      
 170   1        CCU6_T12DTCH   =  0x01;        // load CCU6 dead time control register high 
 171   1                                       // for timer T12
 172   1      
 173   1        SFR_PAGE(_cc0, noSST);         // switch to page 0
 174   1      
 175   1        ///  -----------------------------------------------------------------------
 176   1        ///  Configuration of CCU6 Channel 0:
 177   1        ///  -----------------------------------------------------------------------
 178   1        ///  - hall sensor mode is selected
 179   1        ///  - T13 modulation for output CC60 is disabled
 180   1        ///  - the output CC60 is set to the passive state
 181   1        ///  - the trap functionality of the pin CC60 is disabled
 182   1        ///  - the passive level of the output CC60 is '0'
 183   1        ///  - T13 modulation for output COUT60 is disabled
 184   1        ///  - the output COUT60 is set to the passive state
 185   1        ///  - the trap functionality of the pin COUT60 is disabled
 186   1        ///  - the passive level of the output COUT60 is '0'
 187   1        ///  - dead time generation is enabled
 188   1      
 189   1        ///  - generation interrupt on flag ICC60R is disabled
 190   1        ///  - generation interrupt on flag ICC60F is disabled
 191   1      
 192   1        CCU6_CC60SRL   =  0x00;        // load CCU6 capture/compare shadow register 
 193   1                                       // low for channel 0
 194   1        CCU6_CC60SRH   =  0x00;        // load CCU6 capture/compare shadow register 
 195   1                                       // high for channel 0
 196   1      
 197   1      
 198   1        ///  -----------------------------------------------------------------------
 199   1        ///  Configuration of CCU6 Channel 1:
 200   1        ///  -----------------------------------------------------------------------
 201   1        ///  - hall sensor mode is selected
 202   1        ///  - T13 modulation for output CC61 is disabled
 203   1        ///  - the output CC61 is set to the passive state
 204   1        ///  - the trap functionality of the pin CC61 is disabled
 205   1        ///  - the passive level of the output CC61 is '0'
 206   1        ///  - T13 modulation for output COUT61 is disabled
 207   1        ///  - the output COUT61 is set to the passive state
 208   1        ///  - the trap functionality of the pin COUT61 is disabled
 209   1        ///  - the passive level of the output COUT61 is '0'
 210   1        ///  - dead time generation is disabled
 211   1      
 212   1        ///  - generation interrupt on flag ICC61R is disabled
 213   1        ///  - generation interrupt on flag ICC61F is disabled
 214   1      
 215   1        CCU6_CC61SRL   =  0x00;        // load CCU6 capture/compare shadow register 
 216   1                                       // low for channel 1
 217   1        CCU6_CC61SRH   =  0x00;        // load CCU6 capture/compare shadow register 
 218   1                                       // high for channel 1
 219   1      
 220   1      
 221   1        ///  -----------------------------------------------------------------------
 222   1        ///  Configuration of CCU6 Channel 2:
 223   1        ///  -----------------------------------------------------------------------
 224   1        ///  - hall sensor mode is selected
 225   1        ///  - T13 modulation for output CC62 is disabled
 226   1        ///  - the output CC62 is set to the passive state
C51 COMPILER V7.50   CC6                                                                   10/12/2005 16:46:09 PAGE 15  

 227   1        ///  - the trap functionality of the pin CC62 is disabled
 228   1        ///  - the passive level of the output CC62 is '0'
 229   1        ///  - T13 modulation for output COUT62 is disabled
 230   1        ///  - the output COUT62 is set to the passive state
 231   1        ///  - the trap functionality of the pin COUT62 is disabled
 232   1        ///  - the passive level of the output COUT62 is '0'
 233   1        ///  - dead time generation is disabled
 234   1      
 235   1        ///  - generation interrupt on flag ICC62R is disabled
 236   1        ///  - generation interrupt on flag ICC62F is disabled
 237   1      
 238   1        CCU6_CC62SRL   =  0x00;        // load CCU6 capture/compare shadow register 
 239   1                                       // low for channel 2
 240   1        CCU6_CC62SRH   =  0x00;        // load CCU6 capture/compare shadow register 
 241   1                                       // high for channel 2
 242   1      
 243   1      
 244   1        ///  -----------------------------------------------------------------------
 245   1        ///  Configuration of CCU6 Channel 3:
 246   1        ///  -----------------------------------------------------------------------
 247   1        ///  - T13 output is not inverted
 248   1      
 249   1      
 250   1        CCU6_CC63SRL   =  0x00;        // load CCU6 capture/compare shadow register 
 251   1                                       // low for channel 3
 252   1        CCU6_CC63SRH   =  0x00;        // load CCU6 capture/compare shadow register 
 253   1                                       // high for channel 3
 254   1      
 255   1      
 256   1        ///  -----------------------------------------------------------------------
 257   1        ///  Configuration of Multi-Channel Mode Output Register
 258   1        ///  -----------------------------------------------------------------------
 259   1      
 260   1        CCU6_MCMOUTSL  =  0x00;        // load CCU6 multi channel mode output 
 261   1                                       // control register low
 262   1        CCU6_MCMOUTSH  =  0x00;        // load CCU6 multi channel mode output 
 263   1                                       // control register high
 264   1      
 265   1      
 266   1        SFR_PAGE(_cc2, noSST);         // switch to page 2
 267   1      
 268   1        ///  -----------------------------------------------------------------------
 269   1        ///  Configuration of Timer Control Register
 270   1        ///  -----------------------------------------------------------------------
 271   1      
 272   1        CCU6_TCTR2L    =  0x00;        // load CCU6 timer control register 2 low
 273   1        CCU6_TCTR2H    =  0x00;        // load CCU6 timer control register 2 high
 274   1      
 275   1        ///  -----------------------------------------------------------------------
 276   1        ///  Configuration of CCU6 trap control:
 277   1        ///  -----------------------------------------------------------------------
 278   1        ///  - a trap can only be generated by SW by setting the bit TRPF
 279   1        ///  - the trap state is left when a zero-match of T12 (while counting up) 
 280   1        ///    is detected (synchronization to T12)
 281   1        ///  - bit TRPF is automatically cleared by HW (according to TRPPEN, TRPM0 
 282   1        ///    and TRPM1)
 283   1        ///  - trap interrupt is disabled
 284   1      
 285   1        CCU6_TRPCTRL   =  0x00;        // load CCU6 trap control register low
 286   1        CCU6_TRPCTRH   =  0x00;        // load CCU6 trap control register high
 287   1      
 288   1        ///  -----------------------------------------------------------------------
C51 COMPILER V7.50   CC6                                                                   10/12/2005 16:46:09 PAGE 16  

 289   1        ///  Configuration of Multi Channel Mode:
 290   1        ///  -----------------------------------------------------------------------
 291   1        ///  - multi channel mode is enabled
 292   1      
 293   1        ///  - switching selection:
 294   1        ///  - transfer on correct hall event
 295   1      
 296   1        ///  - switching synchronization:
 297   1        ///  - direct transfer
 298   1      
 299   1        ///  - interrupt on correct hall event is enabled
 300   1        ///  - interrupt on wrong hall event is disabled
 301   1        ///  - the automatic entering of the idle state is disabled
 302   1      
 303   1        CCU6_MODCTRL   =  0x80;        // load CCU6 modulation control register low
 304   1        CCU6_MODCTRH   =  0x00;        // load CCU6 modulation control register high
 305   1      
 306   1        ///  -----------------------------------------------------------------------
 307   1        ///  Configuration of Multi_Channel Mode Control Register
 308   1        ///  -----------------------------------------------------------------------
 309   1      
 310   1        CCU6_MCMCTR    =  0x01;        // load CCU6 multi channel mode control 
 311   1                                       // register 
 312   1      
 313   1        ///  -----------------------------------------------------------------------
 314   1        ///  Configuration of T12 Capture/Compare Mode Select Register
 315   1        ///  -----------------------------------------------------------------------
 316   1      
 317   1        CCU6_T12MSELL  =  0x88;        // load CCU6 T12 campture/compare mode 
 318   1                                       // select register low
 319   1      
 320   1        CCU6_T12MSELH  =  0x08;        // load CCU6 T12 campture/compare mode 
 321   1                                       // select register high
 322   1        ///  -----------------------------------------------------------------------
 323   1        ///  Configuration of Passive State Level Register
 324   1        ///  -----------------------------------------------------------------------
 325   1      
 326   1        CCU6_PSLR      =  0x00;        // load CCU6 passive state level register low
 327   1      
 328   1        ///  -----------------------------------------------------------------------
 329   1        ///  Configuration of CCU6 interrupt control:
 330   1        ///  -----------------------------------------------------------------------
 331   1        ///  - for channel 0 interrupts is node I3 selected
 332   1        ///  - for channel 1 interrupts is node I3 selected
 333   1        ///  - for channel 2 interrupts is node I3 selected
 334   1        ///  - for correct hall event interrupt is node I3 selected
 335   1        ///  - for error interrupts is node I3 selected
 336   1        ///  - for T12 interrupts is node I3 selected
 337   1        ///  - for T13 interrupts is node I3 selected
 338   1      
 339   1        CCU6_INPL      =  0xFF;        // load CCU6 capture/compare interrupt node 
 340   1                                       // pointer register low
 341   1        CCU6_INPH      =  0x3F;        // load CCU6 capture/compare interrupt node 
 342   1                                       // pointer register high
 343   1      
 344   1        CCU6_IENL      =  0x00;        // load CCU6 capture/compare interrupt 
 345   1                                       // enable register low
 346   1        CCU6_IENH      =  0x10;        // load CCU6 capture/compare interrupt 
 347   1                                       // enable register high
 348   1      
 349   1        SFR_PAGE(_cc3, noSST);         // switch to page 3
 350   1      
C51 COMPILER V7.50   CC6                                                                   10/12/2005 16:46:09 PAGE 17  

 351   1        ///  -----------------------------------------------------------------------
 352   1        ///  Configuration of Compare State Register
 353   1        ///  -----------------------------------------------------------------------
 354   1      
 355   1        CCU6_CMPSTATH  =  0x00;        // load CCU6 compare status register high
 356   1      
 357   1        ///  -----------------------------------------------------------------------
 358   1        ///  Configuration of CCU6 module input signals:
 359   1        ///  -----------------------------------------------------------------------
 360   1        ///  - signal CC60_0 is used as output
 361   1        ///  - signal CC61_0 is used as output
 362   1        ///  - signal CC62_0 is used as output
 363   1        ///  - signal #CTRAP is not used
 364   1      
 365   1        CCU6_PISEL0L   =  0x00;        // load CCU6 Port Input Select Register 0 Low
 366   1      
 367   1        ///  - signal CCPOS0_0 is used
 368   1        ///  - signal CCPOS1_0 is used
 369   1        ///  - signal CCPOS2_0 is used
 370   1        ///  - signal T12HR is not used
 371   1      
 372   1        CCU6_PISEL0H   =  0x00;        // load CCU6 Port Input Select Register 0 
 373   1                                       // High
 374   1      
 375   1        ///  - signal T13HR is not used
 376   1      
 377   1        CCU6_PISEL2    =  0x00;        // load CCU6 Port Input Select Register 2
 378   1      
 379   1        ///  Pin P3.0 is used as CC60_0 Output 
 380   1        ///  Pin P3.1 is used as COUT60_0 Output 
 381   1        ///  Pin P3.2 is used as CC61_0 Output 
 382   1        ///  Pin P3.3 is used as COUT61_0 Output 
 383   1        ///  Pin P3.4 is used as CC62_0 Output 
 384   1        ///  Pin P3.5 is used as COUT62_0 Output 
 385   1      
 386   1        SFR_PAGE(_pp2, noSST);         // switch to page 2
 387   1        P3_ALTSEL0      |= 0x3F;     //  set AltSel0 
 388   1        P3_ALTSEL1      &= ~(ubyte)0x3F;              //  set AltSel1
 389   1      
 390   1        SFR_PAGE(_pp0, noSST);         // switch to page 0
 391   1        P3_DIR          |= 0x3F;      //  set P3.7 OutPut
 392   1      
 393   1      
 394   1      
 395   1        ///  -----------------------------------------------------------------------
 396   1        ///  Configuration of the used CCU6 Channels Interrupts:
 397   1        ///  -----------------------------------------------------------------------
 398   1        ///  - capture/compare interrupt node 0 is disabled
 399   1        ///  - capture/compare interrupt node 1 is disabled
 400   1        ///  - capture/compare interrupt node 2 is disabled
 401   1        ///  - capture/compare interrupt node 3 is enabled
 402   1      
 403   1        IEN1          |=  0x80;        // load interrupt enable register 2
 404   1      
 405   1      
 406   1        SFR_PAGE(_cc0, noSST);         // switch to page 0
 407   1      
 408   1        ///  -----------------------------------------------------------------------
 409   1        ///  Timer Control Register
 410   1        ///  -----------------------------------------------------------------------
 411   1        ///  -  enable shadow transfer to T12 and T13
 412   1      

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -