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

📄 timer_user.ppl

📁 the timer control demo source for the NEC mcu
💻 PPL
📖 第 1 页 / 共 3 页
字号:
  243 : */
  244 : 
  245 : /*
  246 : ***************************************
  247 : **  TM00 configure
  248 : **
  249 : **  Please set operation mode here
  250 : ***************************************
  251 : */
  252 : /* if no use set nouse = 1, if use some function set function = 1 */ 
  253 : #define TM00_NotUse     0
  254 : #define TM00_Interval   0
  255 : #define TM00_ExternalEvent      0
  256 : #define TM00_SquareOut  1
  257 : #define TM00_PPGOut     0
  258 : #define TM00_OneshotOut 0
  259 : #define TM00_PulseMeasurement   0
  260 :         /* if no use some method of pulse measurement set method = 1 */ 
  261 :         #define TM00_Pulse_TI00nAndTI01nFreeRunning     0
  262 :         #define TM00_Pulse_TI00nFreeRunning     0
  263 :         #define TM00_Pulse_TI00nRestart 1
  264 :         
  265 : /* macro for setting of different functions */
  266 : 
  267 :         /*
  268 :         ***************************************
  269 :         **  TM00 squarewave output
  270 :         **



/*
78K/0 Series C Compiler V3.60 Preprocess List                                                           Date: 9 Oct 2005 Page:   6
*/

  271 :         **  user set square width = 0.005s
  272 :         ***************************************
  273 :         */
  274 :         
  275 :         /* Count clock and compare value */
  276 :         /* Use register bit macro
  277 :                 TM0n_PRM0n_CountClock_Internal0 :       fprs    or
  278 :                 TM0n_PRM0n_CountClock_Internal1 :       fprs/2^2        or
  279 :                 TM0n_PRM0n_CountClock_Internal2 :       fprs/2^8        or
  280 :                 TM0n_PRM0n_CountClock_TI00nEdge
  281 :                         TM0n_PRM0n_TI00nEdge_Falling    or
  282 :                         TM0n_PRM0n_TI01nEdge_Rising     or
  283 :                         TM0n_PRM0n_TI01nEdge_Both
  284 :                 Note :  Please select the higher frequency you can,
  285 :                         so the precision will be higher.
  286 :         */
  287 :         #define TM00_Clock      TM0n_PRM0n_CountClock_Internal0
  288 :         /* 
  289 :                 Value range :   0x0001 - 0xffff
  290 :                 Square width = (CR00n_value + 1) * count_clock
  291 :         */
  292 :         #define TM00_CR00nValue 0x9c3f
  293 :         #define TM00_CR01nValue 0xffff
  294 :         
  295 :         /* Register settings */
  296 :         #define TM00_TMC0nValue TM0n_TMC0n_Operation_ClearByMatchCR00n
  297 :         #define TM00_PRM0nValue TM00_Clock
  298 :         #define TM00_CRC0nValue TM0n_CRC0n_CR00nMode_Compare
  299 :         #define TM00_TOC0nValue /* Value selection
  300 :                                                                 TM0n_TOC0n_TO0nOut_NoChange
  301 :                                                                 TM0n_TOC0n_TO0nOut_Clear0
  302 :                                                                 TM0n_TOC0n_TO0nOut_Set1
  303 :                                                         */                                                      TM0n_TOC0n_T
      : O0nOut_Clear0|                                                  TM0n_TOC0n_TO0nReverseByCR00n_Enable|                       
      :                         TM0n_TOC0n_TO0nOut_Enable
  304 :         
  305 :         /* Interrupt settings */
  306 :         #define TM00_INTTM000   0
  307 :         #define TM00_INTTM010   0
  308 : 
  309 : 
  310 : /*
  311 : ***************************************
  312 : **  TM01 configure
  313 : **
  314 : **  Please set operation mode here
  315 : ***************************************
  316 : */
  317 : /* if no use set nouse = 1, if use some function set function = 1 */ 
  318 : #define TM01_NotUse     0
  319 : #define TM01_Interval   0
  320 : #define TM01_ExternalEvent      0
  321 : #define TM01_SquareOut  1
  322 : #define TM01_PPGOut     0
  323 : #define TM01_OneshotOut 0
  324 : #define TM01_PulseMeasurement   0



/*
78K/0 Series C Compiler V3.60 Preprocess List                                                           Date: 9 Oct 2005 Page:   7
*/

  325 :         /* if no use some method of pulse measurement set method = 1 */ 
  326 :         #define TM01_Pulse_TI00nAndTI01nFreeRunning     0
  327 :         #define TM01_Pulse_TI00nFreeRunning     0
  328 :         #define TM01_Pulse_TI00nRestart 1
  329 :         
  330 : /* macro for setting of different functions */
  331 : 
  332 :         /*
  333 :         ***************************************
  334 :         **  TM01 squarewave output
  335 :         **
  336 :         **  user set square width = 0.01s
  337 :         ***************************************
  338 :         */
  339 :         
  340 :         /* Count clock and compare value */
  341 :         /* Use register bit macro
  342 :                 TM0n_PRM0n_CountClock_Internal0 :       fprs    or
  343 :                 TM0n_PRM0n_CountClock_Internal1 :       fprs/2^4        or
  344 :                 TM0n_PRM0n_CountClock_Internal2 :       fprs/2^6        or
  345 :                 TM0n_PRM0n_CountClock_TI00nEdge
  346 :                         TM0n_PRM0n_TI00nEdge_Falling    or
  347 :                         TM0n_PRM0n_TI01nEdge_Rising     or
  348 :                         TM0n_PRM0n_TI01nEdge_Both
  349 :                 Note :  Please select the higher frequency you can,
  350 :                         so the precision will be higher.
  351 :         */
  352 :         #define TM01_Clock      TM0n_PRM0n_CountClock_Internal1
  353 :         /* 
  354 :                 Value range :   0x0001 - 0xffff
  355 :                 Square width = (CR00n_value + 1) * count_clock
  356 :         */
  357 :         #define TM01_CR00nValue 0x1387
  358 :         #define TM01_CR01nValue 0xffff
  359 :         
  360 :         /* Register settings */
  361 :         #define TM01_TMC0nValue TM0n_TMC0n_Operation_ClearByMatchCR00n
  362 :         #define TM01_PRM0nValue TM01_Clock
  363 :         #define TM01_CRC0nValue TM0n_CRC0n_CR00nMode_Compare
  364 :         #define TM01_TOC0nValue /* Value selection
  365 :                                                                 TM0n_TOC0n_TO0nOut_NoChange
  366 :                                                                 TM0n_TOC0n_TO0nOut_Clear0
  367 :                                                                 TM0n_TOC0n_TO0nOut_Set1
  368 :                                                         */                                                      TM0n_TOC0n_T
      : O0nOut_Clear0|                                                  TM0n_TOC0n_TO0nReverseByCR00n_Enable|                       
      :                         TM0n_TOC0n_TO0nOut_Enable
  369 :         
  370 :         /* Interrupt settings */
  371 :         #define TM01_INTTM001   0
  372 :         #define TM01_INTTM011   0
  373 : 
  374 : 
  375 : /*
  376 : ***************************************
  377 : **  TM50 configure
  378 : **



/*
78K/0 Series C Compiler V3.60 Preprocess List                                                           Date: 9 Oct 2005 Page:   8
*/

  379 : **  Please set operation mode here
  380 : ***************************************
  381 : */
  382 : /* if no use set nouse = 1, if use some function set function = 1 */
  383 : #define TM50_NotUse     0
  384 : #define TM50_Interval   0
  385 : #define TM50_ExternalEvent      0
  386 : #define TM50_SquareOut  1
  387 : #define TM50_PWMOut     0
  388 : 
  389 : 
  390 :         /*
  391 :         ***************************************
  392 :         **  TM50 square wave output
  393 :         **
  394 :         **  user set square width = 0.01s
  395 :         ***************************************
  396 :         */
  397 :         
  398 :         /* Count clock and compare value */
  399 :         /* Use register bit macro
  400 :                 TM5n_TCL5n_CountClock_Internal0 :       fprs
  401 :                 TM5n_TCL5n_CountClock_Internal1 :       fprs/2
  402 :                 TM5n_TCL5n_CountClock_Internal2 :       fprs/2^2
  403 :                 TM5n_TCL5n_CountClock_Internal3 :       fprs/2^6
  404 :                 TM5n_TCL5n_CountClock_Internal4 :       fprs/2^8
  405 :                 TM5n_TCL5n_CountClock_Internal5 :       fprs/2^13
  406 :                 Note :  Please select the higher frequency you can,
  407 :                         so the precision will be higher.
  408 :         */
  409 :         #define TM50_Clock      TM5n_TCL5n_CountClock_Internal5
  410 :         /* 
  411 :                 Value range :   0x00 - 0xff
  412 :                 Square width = (CR5n_value + 1) * count_clock
  413 :         */
  414 :         #define TM50_CR5nValue  0x09
  415 :         
  416 :         /* Register settings */
  417 :         #define TM50_TCL5nValue TM50_Clock      /* internal count clock only*/
  418 :         #define TM50_TMC5nValue TM5n_TMC5n_Operation_Start|                                                     TM5n_TMC5n_M
      : ode_ClearByMatchCR5n|                                                   /* Value selection
  419 :                                                                 TM5n_TMC5n_OutPut_NoChange
  420 :                                                                 TM5n_TMC5n_OutPut_Clear0
  421 :                                                                 TM5n_TMC5n_OutPut_Set1
  422 :                                                         */                                                      TM5n_TMC5n_O
      : utPut_Clear0|                                                   TM5n_TMC5n_OutPut_InversionActiveLow|                       
      :                         TM5n_TMC5n_OutPut_Enable
  423 :         
  424 :         /* Interrupt settings */
  425 :         #define TM50_INTTM50    0
  426 : 
  427 : 
  428 : /*
  429 : ***************************************
  430 : **  TM51 configure
  431 : **



/*
78K/0 Series C Compiler V3.60 Preprocess List                                                           Date: 9 Oct 2005 Page:   9
*/

  432 : **  Please set operation mode here
  433 : ***************************************
  434 : */
  435 : /* if no use set nouse = 1, if use some function set function = 1 */
  436 : #define TM51_NotUse     0
  437 : #define TM51_Interval   0
  438 : #define TM51_ExternalEvent      0
  439 : #define TM51_SquareOut  1
  440 : #define TM51_PWMOut     0
  441 : 
  442 : 
  443 :         /*
  444 :         ***************************************
  445 :         **  TM51 square wave output
  446 :         **
  447 :         **  user set square width = 0.015s
  448 :         ***************************************
  449 :         */
  450 :         
  451 :         /* Count clock and compare value */
  452 :         /* Use register bit macro
  453 :                 TM5n_TCL5n_CountClock_Internal0 :       fprs
  454 :                 TM5n_TCL5n_CountClock_Internal1 :       fprs/2
  455 :                 TM5n_TCL5n_CountClock_Internal2 :       fprs/2^4
  456 :                 TM5n_TCL5n_CountClock_Internal3 :       fprs/2^6
  457 :                 TM5n_TCL5n_CountClock_Internal4 :       fprs/2^8
  458 :                 TM5n_TCL5n_CountClock_Internal5 :       fprs/2^12
  459 :                 Note :  Please select the higher frequency you can,
  460 :                         so the precision will be higher.
  461 :         */
  462 :         #define TM51_Clock      TM5n_TCL5n_CountClock_Internal5
  463 :         /* 
  464 :                 Value range :   0x00 - 0xff
  465 :                 Square width = (CR5n_value + 1) * count_clock
  466 :         */
  467 :         #define TM51_CR5nValue  0x1c
  468 :         
  469 :         /* Register settings */
  470 :         #define TM51_TCL5nValue TM51_Clock      /* internal count clock only*/
  471 :         #define TM51_TMC5nValue TM5n_TMC5n_Operation_Start|                                                     TM5n_TMC5n_M
      : ode_ClearByMatchCR5n|                                                   /* Value selection
  472 :                                                                 TM5n_TMC5n_OutPut_NoChange
  473 :                                                                 TM5n_TMC5n_OutPut_Clear0
  474 :                                                                 TM5n_TMC5n_OutPut_Set1
  475 :                                                         */                                                      TM5n_TMC5n_O
      : utPut_Clear0|                                                   TM5n_TMC5n_OutPut_InversionActiveLow|                       
      :                         TM5n_TMC5n_OutPut_Enable
  476 :                                                         
  477 :         /* Interrupt settings */
  478 :         #define TM51_INTTM51    0
  479 : 
  480 : 
  481 : /*
  482 : ***************************************
  483 : **  TMH0 configure
  484 : **



/*
78K/0 Series C Compiler V3.60 Preprocess List                                                           Date: 9 Oct 2005 Page:  10
*/

⌨️ 快捷键说明

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