i'm currently doing a code on counting timer but there are error while my port3^2 and port^2(START==0&&STOP==0)and port3^2 and port^2(START==0&&STOP==1) and then it goes into the disassembly then cant debug anyone can help me to correct my error please and thank you...^^ my code goes like this: #include <AT898252.H> unsigned char pulse_low=0,pulse_high=0 ; unsigned int overflow_count=0,int_count=1,pulse=0; long int pulse_width=0; sbit STOP=P3^2; sbit START=P3^3; void main() { TMOD=0x90; TF1=0; IT1=1; IE=0x8c; while(1) { unsigned int a; if(START==1&&STOP==0) { a=0; } else if(START==0&&STOP==1) { a=1; } else if(START==0&&STOP==0) { a=2; } else if (START==1&&STOP==1) { a=3; } switch(a) { case 0: { TR1=1; break; } case 1: { pulse_low=TL1; pulse_high=TH1; pulse=(TH1<<8)+TL1; pulse_width=(overflow_count)*65536+pulse; TH1=0x00: TL1=0x00; overflow_count=0; break; } default: { break; } } } } void timer1_int()interrupt 3 { overflow_count++; }
use the pre and /pre markers!
But copy the code from the editor, and not from one of the already broken posts!
Did you actually look at the instructions?
They are immediately above the box where you enter your message!
One thing they don't mention: do not use TABs - use only spaces!
(any decent editor - even uVision - can be set to insert spaces when you press the TAB button)