Hello, everybody.
I am into this acceleration measuring project because a friend requested a meter for his nice car
I got the ADXL202AE which outputs PWM. Questions:
1) Of course I have to measure the high state of each pulse to determine the sample value. To do this with 16f627 I thought of the following:
a. Interrupt RB0 set to trigger when high
b. When the pulse goes high start the timer etc etc
c. Return from the interrupt and change the interrupt RB0 to tirgger when LOW
d. When pulse goes low, stop the timer, return from interrupt and change the RBO to trigger when high, to be ready for the next pulse.
Although it seems it is going to work, I dont like it so much. Is there a better way to do this? I remember I worked with another mc in a similar situation and there was a pin that would trigger on both high/low changes, but I could not find this here.
2) ADXL takes also 2 capacitors for filtering the two axis samples. The datasheet talks about bandwidth.
a. What is this bandwidth? The rate of which the samples are taken? i.e. when bandwidth is set to 10Hz, ADXL will generate 10 pulses per second?
b. We do this to eliminate spikes from the output pin, so we dont have false measurements in PIC?
3) To analyse the data you have to aplly a small mathematical formula :
(variable/constant - 0.5)/12.5%
How to do this with assemly?
That all for now! Thank you very much for reading and I would be greatful if you could help me out!
ADXL DATASHEET : https://www.analog.com/UploadedFiles/Data_Sheets/567227477ADXL202E_a.pdf#search="adxl datasheet"
I am into this acceleration measuring project because a friend requested a meter for his nice car
I got the ADXL202AE which outputs PWM. Questions:
1) Of course I have to measure the high state of each pulse to determine the sample value. To do this with 16f627 I thought of the following:
a. Interrupt RB0 set to trigger when high
b. When the pulse goes high start the timer etc etc
c. Return from the interrupt and change the interrupt RB0 to tirgger when LOW
d. When pulse goes low, stop the timer, return from interrupt and change the RBO to trigger when high, to be ready for the next pulse.
Although it seems it is going to work, I dont like it so much. Is there a better way to do this? I remember I worked with another mc in a similar situation and there was a pin that would trigger on both high/low changes, but I could not find this here.
2) ADXL takes also 2 capacitors for filtering the two axis samples. The datasheet talks about bandwidth.
a. What is this bandwidth? The rate of which the samples are taken? i.e. when bandwidth is set to 10Hz, ADXL will generate 10 pulses per second?
b. We do this to eliminate spikes from the output pin, so we dont have false measurements in PIC?
3) To analyse the data you have to aplly a small mathematical formula :
(variable/constant - 0.5)/12.5%
How to do this with assemly?
That all for now! Thank you very much for reading and I would be greatful if you could help me out!
ADXL DATASHEET : https://www.analog.com/UploadedFiles/Data_Sheets/567227477ADXL202E_a.pdf#search="adxl datasheet"