It's simpler than you think. Just increment a variable in the TIM1 IRQ Handler for each CH1 interrupt.
RM0008 the All Densities Reference Manual Section 8 has a complete description of how to configure pins. Table 19 defines the configuration needed for TIM1 pins. Cheers, Hal
Posted on May 17, 2011 at 14:34 Refere to ''External clock source mode 1'' in the reference manual. In this mode, the timer counter is incremented each time a valid edge is deteced on external pin. Thanks to let me know if you get out.MCU Lüfter
Consider also that the counter is only 16-bit, so you'll need to increase your sample rate, or cascade the counter.
If the 1PPS has any precision to it, I'd be tempted to use a free running 32-bit counter off the 1 MHz, and latch it to a buffer every second, so as not to accumulate error.
Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..