winnie 发表于 2009-3-26 10:38:42

CCSC有没有象汇编代码中的关于SFR的定义

#asm
      bcf   0x03,6      //选中BANK 1
      bcf   0x03,5
      btfsc   0x17,0         //取反CCP检测的边缘
      goto    SetCCP1FE
      bsf   0x17,0
      goto    SetIsFinish
SetCCP1FE:
      bcf   0x17,0
SetIsFinish:
      bcf   0x0c,2      //清除中断标志位
    #endasm

winnie 发表于 2009-3-26 10:39:26

用 CCS 就根本不需要用到 SFR
查 Help -> index -> setup_ccp1()

查 Help -> index -> #int_ccp1

根本不需要用到 SFR

SETUP_CCP1( )
SETUP_CCP2( )
SETUP_CCP3( )
SETUP_CCP4( )
SETUP_CCP5( )


Syntax:
setup_ccp1 (mode)

setup_ccp2 (mode)

setup_ccp3 (mode)

setup_ccp4 (mode)

setup_ccp5 (mode)



Parameters:
mode is a constant.Valid constants are in the devices .h file and are as follows:

Disable the CCP:

CCP_OFF



Set CCP to capture mode:

CCP_CAPTURE_FE
Capture on falling edge

CCP_CAPTURE_RE
Capture on rising edge

CCP_CAPTURE_DIV_4
Capture after 4 pulses

CCP_CAPTURE_DIV_16
Capture after 16 pulses




Set CCP to compare mode:

CCP_COMPARE_SET_ON_MATCH
Output high on compare

CCP_COMPARE_CLR_ON_MATCH
Output low on compare

CCP_COMPARE_INT
interrupt on compare

CCP_COMPARE_RESET_TIMER
Reset timer on compare




Set CCP to PWM mode:

CCP_PWM
Enable Pulse Width Modulator




Returns:
undefined



Function:
Initialize the CCP.The CCP counters may be accessed using the long variables CCP_1 and CCP_2.The CCP operates in 3 modes.In capture mode it will copy the timer 1 count value to CCP_x when the input pin event occurs.In compare mode it will trigger an action when timer 1 and CCP_x are equal.In PWM mode it will generate a square wave.The PCW wizard will help to set the correct mode and timer settings for a particular application.



Availability:
This function is only available on devices with CCP hardware.



Requires
Constants are defined in the devices .h file.



Examples:
setup_ccp1(CCP_CAPTURE_RE);



Example Files:
ex_pwm.c, ex_ccpmp.c, ex_ccp1s.c



Also See:
set_pwmX_duty()
页: [1]
查看完整版本: CCSC有没有象汇编代码中的关于SFR的定义