I need to be able to read 2 different frequencies (digital pulses) that comes through 2 different pins
(note that the capture registers must be independent, I mean, if one signal makes the proccessor saves "n" value, the other signal should not count FROM "n", it should count independently)
I'm a little confused about what a "Channel" means, dunno if different channels in the same timer object counts in the same register or not...
I just found an example of hardware timer, in which I see:
Code: Select all
TIM_TypeDef *Instance = (TIM_TypeDef *)pinmap_peripheral(digitalPinToPinName(pin), PinMap_PWM);
channel = STM_PIN_CHANNEL(pinmap_function(digitalPinToPinName(pin), PinMap_PWM));
// Instantiate HardwareTimer object. Thanks to 'new' instantiation, HardwareTimer is not destructed when setup() function is finished.
MyTim = new HardwareTimer(Instance);
now, how do I know available timers and pins related to them?
Im using the bluepill board, and again, I need to get 2 different frequencies,
Hope I explained clear enough the problem,
regards
julian