clear_interrupt(int_timer1) // clear timer1 interrupt's flag flag_counter //this is a counter for timer1 overflows You have done, that the compiler does not generate any ASM code for You will see that when you put the #int_xxx lines "up in the air" like LST file for your program, after you compile it. See where to put the #int_xxx statements. Look at any of the programs in the links that I gave you, and you will They mustīe placed in front of the routine that they are used for. One problem is that you have stuck these interrupt routine declarations I think the program routine is true but there are bugs that I can't find them. But I want to find my program's bugs if is possible. Software measurement of frequency (Does not use CCP or Timer): If you want to measure the frequency of a signal (Not just the pulse If you want to measure the pulse width entirely in software (without theĬCP or Timer0), this thread has code to do that: They show how to measureĬCS also has an example which uses Timer0 (not the CCP) to measureĬ:\program files\picc\examples\ex_pulse.c If you want to use only one CCP module, then look at the sample Set_tris_c(0xff) //CCP1 pin is declared as a inputĬCS has an example to measure the pulse width by using two CCPĬ:\program files\picc\examples\ex_ccpmp.c Setup_timer_1(T1_INTERNAL|T1_DIV_BY_8) //set timer1 in 8us resolution Period=((new_rise)-(old_rise) (256*(multiple 1)))*8u Ĭlear_interrupt(int_ccp1) //clear ccp1 flag to run for next edge #define use_lcd_portd true //set port D to use LCDįlag_counter //this is a counter for timer1 overflowsĬlear_interrupt(int_timer1) // clear timer1 interrupt's flag I've connected a digital pulse to PIN_C2 by a pullup resistor in Proteus. But when I run it in Proteus, unfortunately the CCP interrupt doesn't work (MCU doesn't detect an interrupt on its input). There is my source code (CCS C compiler). I want to measure a pulse wave's period(T) that its duty cycle is variable. Please do not post bug reports on this forum. Separate map page here.CCS :: View topic - problem in CCP (capture mode)įAQ Forum Help Official CCS Support Search Register Profile Log in to check your private messages Log inĬCS does not monitor this forum on a regular basis. To locate the extractions use the maps below the table.Ĭlick for fullscreen. Note: It is rare, but possible that they appear in the health resort and at one of the other two locations in the same raid. Western of the river in the area between the power station and the gas station LBT-1961A Load Bearing Chest Rig (Goons Edition) Mystery Ranch NICE COMM 3 BVS frame system S
0 Comments
Leave a Reply. |