Search found 8 matches

by julian_lp
Thu Aug 03, 2023 2:50 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS


would suggest the following:
1. atomicity: the first thing to do in the isr is to save the overflow counter value;

Can the interrupt itself be interrupted? :roll:
You mean that overflow count could change while proccessing the code inside capture isr?



2. no multiplification: in the overflow ...
by julian_lp
Tue Aug 01, 2023 11:08 pm
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS

Just came again to paste some working code that is able to compute 2 different frequencies (same timer, 2 channels), just as I needed in my first post.
I'll hopefully improve it but what's important so far is that, with all your help, I'm starting to understand how "hardwaretimer" works
regards and ...
by julian_lp
Sun Jul 30, 2023 5:44 pm
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS

Need help now to confirm if my undestanding of this is correct
(using hardwaretimer abstaction)
First I go to the pinout diagram (bluepill) and see that PA1 is tied to TIMER 1 channel 2

so, with the intention of using timer1 and channel 2, I declare

#define pin_CAPTURE_T1C2 PA1


Now,


TIM ...
by julian_lp
Sat Jul 29, 2023 5:15 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS


So what is the minimum time between pulses then? Not knowing much about cars, I guess say 10,000RPM *2 and come up with 3ms for the tachometer, and say 200km/h * 1000 and come up with 18ms for the odometer. Those are not vastly different, so maybe you could use 2 channels on one timer, but it ...
by julian_lp
Sat Jul 29, 2023 5:02 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS


You will need to figure out if you want to runs one code or you want to learn to code.


Definately I want to do my own code. In fact I've my own speedometer and tachometer doing quite a decent job (atmel328=>vid6606=>x27 stepper ), the problem is that both of them are based on the atmel 328 that ...
by julian_lp
Wed Jul 26, 2023 5:09 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS


You just need to get it started.

I'm having hard time to get started :lol: :lol: :lol:

Well, I found this code to implement a frequency meter, but I made a modification to being able to measure lower freqs, what do you think?

Original (just a piece of it to get the idea):


volatile uint32_t ...
by julian_lp
Fri Jul 21, 2023 4:07 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Re: Bluepill: 2 different timers to read 2 different FREQS

I'm still confused about the whole channel topic....
Let me put it in an example,
I've 2 digital signals to read/measure:
A: car tachometer data (typically 2pulses/Revolution in 4 cylinder engines)
B: car speedometer data (lets say 1000pulses/KM)
Both of them are not strictly releated each other ...
by julian_lp
Mon Jul 10, 2023 12:40 am
Forum: General discussion
Topic: Bluepill: 2 different timers to read 2 different FREQS
Replies: 17
Views: 6907

Bluepill: 2 different timers to read 2 different FREQS

Hello,
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 ...

Go to advanced search