Morning,
I have some stupid troubles with my SAB80C535 µP. I'm trying to read a acceleration sensor (ADXL202JE) with timer 1 and 2. It works aproximatily fine, excepting the "turbulent" resolution, when the timers work separately. But when i put the two timers together in the main programm then all is messed up. The equation is all disturbed and i get astronomical numbers close to ininit or zero. Can it be posible that the timer 1 and 2 cant work together or are there any priority confuses?? Its driving me crazy !!!!!
Thanks for any answer....
The first timer that starts is the Timer 1:
while (test_Y == 0) { IE1 = 0; TMOD = TMOD | 0x90; TR1 = 1; EX1 = 1; }
The while statement is there so the program can't change to anouther while statement. It waits till the interrupt of timer1 is over and then goes to the next statement. I dont know if this is the problem. Because even if i put timer 1 first or second it doesn't matter, the reaction is the same. What i am seeing on the Timer 1 register is 0. That meens he doesent start o something like that. How could that be?
Just to see, Y would try
{ IE1 = 0; TMOD = TMOD & 0x0f; TMOD = TMOD | 0x90; TR1 = 1; EX1 = 1; }
Erik