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

📄 main.ppl

📁 the timer control demo source for the NEC mcu
💻 PPL
📖 第 1 页 / 共 3 页
字号:
  239 : #define TMHn_TMCYC1_Remote      0x06
  240 :         #define TMHn_TMCYC1_Remote_Low  0x00
  241 :         #define TMHn_TMCYC1_Remote_High 0x02
  242 :         #define TMHn_TMCYC1_Remote_Low2 0x04
  243 :         #define TMHn_TMCYC1_Remote_Carrier      0x06
  244 : 
  245 : #define TMHn_TMCYC1_CarrierStatus       0x01
  246 :         #define TMHn_TMCYC1_Carrier_Disable     0x00
  247 :         #define TMHn_TMCYC1_Carrier_Enable      0x01
  248 : 
  249 : 
  250 : 
  251 : 
  252 : #define _TIMERCFG_
  253 : 
  254 : /*
  255 : *******************************************************************************
  256 : **  User control macro define
  257 : *******************************************************************************
  258 : */
  259 : 
  260 : /*
  261 : ***************************************
  262 : **  TM00 configure
  263 : **
  264 : **  Please set operation mode here
  265 : ***************************************
  266 : */
  267 : /* if no use set nouse = 1, if use some function set function = 1 */ 
  268 : #define TM00_NotUse     0
  269 : #define TM00_Interval   0
  270 : #define TM00_ExternalEvent      0



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

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


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

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


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

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


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

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

⌨️ 快捷键说明

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