ComeNCapture is a small project, Quick and Dirty logic analyzer based on STM8L mcu. I wrote a little code for this project. Using timer 4 interrupt for adjustable data sampling rate. By manipulating 2 variables, ARR and prescaler. By using USART and baud rate of 115200. With USART interrupt, I can control when to start ot stop the data sampling. By sending 3 bytes {Start/Stop, ARR, Prescaler}. The start and stop is 0x01 and 0x00. ARR and Prescaler are the important for timer interrupt. I will get into this later.
For example. I want to capture the 50Hz square wave to see the duty cycle. I need the sample rate of 100Hz. A.K.A 2x ; x is the target frequency that we want to capture.
But the big problem is I’m not sure that it will work. And if yes from my perspective, It’s 0% reliable.
Link to project is Here