Tool/software: Code Composer Studio
Hi Everybody,
I have some strange event that i can't understand why it is happenning
i have an external ADC (HX711).
I'm getting numbers around 8561023 which is good
when i divide the answer by 100 (85610) i'm getting an unstable results (sometimes numbers arround 8561023 and sometimes very large numbers like 14701165)
i thought the time is the problem so i set delay of 2500 ms it returnning numbers around 8561023 which is good
but than i tried another approach (maybe the arithmatic is the problem) so i set the divide to another parameter (not connected in any way to the adc response), the numbers around 8561023
for example,
wt_curr = ((long)bitbang_data_in()) ---> gives me good response
wt_curr = ((long)bitbang_data_in())/100; --> gives me bad response
wt_curr = ((long)bitbang_data_in())/100;
__delay_cycles(2500); --> gives me good response
wt_curr = ((long)bitbang_data_in());
wt_zero /= 100; --> gives me good response
bitbang_data_in is a function that gets the data from adc.
how can i devide the wt_curr by 100 without a delay?
I hope i made myself clear about my issue
Thank you