i wanted to configure timer 2 of at89c51ed2 can any one give code to do so and and tell how to obtain a specific frequency.
code calculetes number for th1 and tl2 and is revelant!
bcoz you dis me i not help you any more!
have a nice day goodbye
any more?????????????????? what help have you given so far? I see NONE that you post some irrelevant and/or faulty code snippets hardly constitute help
Erik
The SILabs F12x and the Philips P89C668 datasheets both describe timer 2 in excruciating detail. Since T2 is a 'standard device' (except for the SILabs deviates F3x -up) you can refer to a datasheet for another device without any problems.
te siemens 80517a has difrfeent t2 cofinguration!
"code calculetes number for th1 (sic) and tl2"
Here is the code that you posted, then:
int getBAUDSPEED( float SPEED) { float t, q; // variebles t = 1 / ( CLOCK / SPEED ); // sum it clock divided by speed t = t * 100 + 27; // add magic amunt q = t * SPEED; // change to variable return t + q / 113; // return the asnwer }
Is see no mention of either TH2 or TL2 in that!!
It is, therefore, irrelevant!
"i not help you any more!"
That's a relief!
no no no
the code calcs the number you load to timer.
see the retrun number answer.
so code is relevent
see!
ex;
th2 = getBAUDSPEED( 9500 ) >> 8; // set high timer tl2 = getBAUDSPEED( 9500 ) & 255; // set low timr <//pre>
so code is relevent float t, q; // variebles using floats for a simple calculation to just about the most irrelevant, or should I say ridiculous, I have ever seen for a '51
See... it IS good for something (i.e., a good laugh).
And, after all, don't you think that's what the poster's looking for?