| ??? 07/25/06 06:18 Read: times |
#121009 - not enough info Responding to: ???'s previous message |
hi,
Please show timer 2 initialization code. Please show interrupts setup (enabling,priority) code as well. How this interrupt is long in time: /*timer 1 interrupt used for four 7-segment displays multiplexing*/Have you calculated its time duration? By the way,there is possible logic error: /* timer 2 interrupt used to increment count every 1 msec*/
void inter_2(void) interrupt 5
{if(P0_0==1)
count1++;
TF2=0;
if((count1%10)==0)
g=3;Look atcount1++; if((count1%10)==0)Assume the variable count1 is uchar (8 bit). What does happen during it rolls over 255? You think that you do set variable g to value 3 at each 10 interrupts of timer 2 (when (P0_0==1)) but in fact it happens at values of count1 equal to: 0,10,20...240,250 and then? Yes, at value 0 (after only 6 interrupts! because there are no uchar values 256..259). Regards, Oleg |
| Topic | Author | Date |
| problem in timer with a least count of 1 millisec | 01/01/70 00:00 | |
| Code as shown should work methinks | 01/01/70 00:00 | |
| clarifications | 01/01/70 00:00 | |
| atomicity | 01/01/70 00:00 | |
| atomicity problem? | 01/01/70 00:00 | |
| about atomicity | 01/01/70 00:00 | |
| Back to basic | 01/01/70 00:00 | |
| reply to vishal sinha | 01/01/70 00:00 | |
| bible time | 01/01/70 00:00 | |
| Hm ... | 01/01/70 00:00 | |
| reply to Christoph Franck | 01/01/70 00:00 | |
| totally imprecse | 01/01/70 00:00 | |
| What is the size of the variables? | 01/01/70 00:00 | |
| not enough info | 01/01/70 00:00 | |
| other details about code | 01/01/70 00:00 | |
| here you go again | 01/01/70 00:00 | |
yet questions more | 01/01/70 00:00 |



