Gast
#2774331
Hi, Ich benutze die RD9 von PIC24F128GA010 als meine Input Capture 2. Ich habe die configuriert wie auf daten blatt steht.. static inline void CONFIG_RD9_AS_DIG_INPUT() { _TRISD9 = 1; // Enable pull up // delay to settle } #define CONFIG_RINGI() CONFIG_RD9_AS_DIG_INPUT() #define RINGI _LATD9 //_LATD9 is port register for RD9 typedef enum { STATE_WAIT_FOR_FALL_EDGE = 0, STATE_WAIT_FOR_RISE_EDGE, } ICSTATE; ICSTATE e_isrICState = STATE_WAIT_FOR_FALL_EDGE; volatile uint16_t u16_oflowCount = 0; volatile uint8_t u8_captureFlag = 0; volatile uint16_t u16_lastCapture; volatile uint16_t u16_thisCapture; volatile uint32_t u32_pulseWidth; void configInputCapture2(void) { CONFIG_RINGI(); IC2CON = IC_TIMER3_SRC | //Timer 3 source IC_INT_1CAPTURE | //Interrupt every capture IC_IDLE_CON | // IC operate in sleep mode IC_EVERY_EDGE; //Capture every edge _IC2IF = 0; _IC2IP = 2; //higher than Timer3 so that Timer3 does not interrupt IC2 _IC2IE = 1; //enable } //void _ISRFAST _IC2Interrupt() void __attribute__((_interrupt_, auto_psv)) _IC2Interrupt(void) { _IC2IF = 0; u16_thisCapture = IC2BUF; //always read the buffer to prevent overflow clrLCD(); putstringLCD("SMS RXed"); main_mode = MODE_SMS; } Trözdem ländet er nicht wenn ich die pin nider ist. Kann jemand etwas merken bei diese konfiguration vielleicht ? VG Savio