Ejemplo n.º 1
0
void TMR2_Initialize(void) {
    // Set TMR2 to the options selected in the User Interface

    // TMR2ON off; T2CKPS 1:1; T2OUTPS 1:1;
    T2CON = 0x00;

    // T2CS FOSC/4;
    T2CLKCON = 0x00;

    // T2CKPOL Rising Edge; T2CKSYNC Not Synchronized; T2MODE Software control; T2PSYNC Not Synchronized;
    T2HLT = 0x00;

    // T2RSEL T2;
    T2RST = 0x00;

    // T2PR 255;
    T2PR = 0xFF;

    // TMR2 0x0;
    T2TMR = 0x00;

    // Clearing IF flag.
    PIR1bits.TMR2IF = 0;

    // Start TMR2
    TMR2_Start();
}
Ejemplo n.º 2
0
void TMR2_Initialize(void) {
    // Set TMR2 to the options selected in the User Interface

    // T2CKPS 1:1; T2OUTPS 1:1; TMR2ON off;
    T2CON = 0x00;

    // T2CS FOSC/4;
    T2CLKCON = 0x01;

    // T2PSYNC Not Synchronized; T2MODE Software control; T2CKPOL Rising Edge; T2CKSYNC Not Synchronized;
    T2HLT = 0x00;

    // T2RSEL T2CKIPPS pin;
    T2RST = 0x00;

    // PR2 179;
    T2PR = 0xB3;

    // TMR2 0;
    T2TMR = 0x00;

    // Clearing IF flag before enabling the interrupt.
    PIR4bits.TMR2IF = 0;

    // Enabling TMR2 interrupt.
    PIE4bits.TMR2IE = 1;

    // Set Default Interrupt Handler
    TMR2_SetInterruptHandler(TMR2_DefaultInterruptHandler);

    // Start TMR2
    TMR2_Start();
}
Ejemplo n.º 3
0
void initVGA( void)
{
    // 1. init Timer 2
    TMR2_Period8BitSet( 253);
    
    // 2. UART baudrate
    SPBRGL = 0;

    // 3. PWM intialize
    PWM4_LoadDutyValue( 60);

    // 5. init the vertical sync state machine
    VState = SV_PREEQ; 
    VCount = 1;                 

    TMR2_Start();
    
    // Enable the Global Interrupts
    INTERRUPT_GlobalInterruptEnable();

    // Enable the Peripheral Interrupts
    INTERRUPT_PeripheralInterruptEnable();

} // initVGA
Ejemplo n.º 4
0
void TMR2_StartTimer(void) {
    TMR2_Start();
}
Ejemplo n.º 5
0
/**
    void DRV_TMR2_Start (void)
 */
void DRV_TMR2_Start(void) {
    TMR2_Start();
}