We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi,
my code is too long so i put snapshot of my code
#include<..........> . . . . . main() { ...... } void down(void)//down { ES=0; //disable serial ISR timer_flag=0; ph_sensor_error(); motor_direction=ANTI_CLOCK_WISE; while(ph_sensor_down==OFF && timer_flag==0) motor_power=ON; motor_power=OFF; timer_flag=0; ES=1; //enable serial ISR } void ph_sensor_error(void) { TR0 = 1; /* Start Timer 1 Running */ } /*** timer0 interrupt service routine ***/ void timer0_ISR (void) interrupt 1 { TR0 = 0; TF0 = 0; TH0 = 0x00; TL0 = 0x00; counter++; // Increment the overflow count if(counter>=10)//0.71s { TR0 = 0; TF0=0; counter=0; timer_flag=1; } else TR0 = 1; } /*** serial interrupt ***/ void serial_ISR (void) interrupt 4 { unsigned char moh=0; if (RI == 1) { RI = 0; moh=SBUF; if(SBUF==0x31) down(); }*/ }
my problem is when i entered in serial_ISR and the SBUF=0x31 it mean the condition true,when i call down() function i can not from it enter to timer0_ISR never. how can i solve this problem?
"forgetting to KISS has been the bane of many projects."
Ah - but it have also given consultants lots of money to buy christmas presents for :)
Including the undesigned
Erik