|
Post by tegwyntwmffat2 on Aug 24, 2019 22:36:14 GMT
I'm looking at this: The function used to make the measurement is “MeasurePwm()”. This has parameters as per:
MeasurePwm(uint8 _pin, uint32 *Period, uint32 *Duration, float *DutyRatio);
It expects to receive the address of the variable into which you want the new data to be inserted, e.g.
MeasurePwm(8, &PWM_Period0, &PWM_Duration0, &DutyRatio0);..... Can you give a quick example of how this actually needs to be set up? Is PWM_Period0 defined in setup somehow eg PWM_Period0 = 1200? ..... Or do i do this: MeasurePwm(8, 1200, 2400, 55); Does it work for MeasureFrequency() in the same way?
I need to set a duration in order to minimise the time it takes to make a reading. Ideally it would be just one period.
A bit of background info: I need to sample ultrasonic frequencies between 10KHz and 95KHz as fast as possible, at least at 10KHz. I've noticed that the TC275 can give out interference sometimes, depending on how fast any one of the cores is running at, so sampling at 10KHz may give problems. Another option is to convert the frequency to voltage and read that through analog port, maybe shifting the sampling frequency above 95 KHz to prevent interference. What do you advise?
Thanks!
|
|