T2 of 89X52

How to use timer2 of 89X52?
(e.g.how to write T2CON, T2MOD?)

  • "how to write T2CON, T2MOD"

    #include <REGX52.H>
    
    void write_to_t2con_and_t2mod( void )
    {
       T2CON = 0x01;
    
       T2MOD = 0x35;
    }

    You need to start by reading the uVision Getting Started Guide, and working through the example projects in it.

    This will give you a proper introduction to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep end.
    (The uVision Getting Started Guide is available on the 'Books' tab in the 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS51.PDF in your Keil folder)

    You should also look at the example downloads on this very site, and included in your Keil\C51\Examples folder

More questions in this forum