Hello.

Hello, is it okay if any of you can explain to me these codes?
Im using microcontroller C8051f226 and i know this has something to do with the datasheet.


void Timer2_Init (int counts)
{
T2CON = 0x08;
CKCON &= ~0x20; // T2M=0 (use SYSCLK/12 as timebase)
RCAP2 = -counts;
T2 = 0xffff;
ET2 = 1;
TR2 = 1;
}
Here's an idea. Read the datasheet.

&= and_eq andwf register,f operates on bits.
~ compl comf register,w toggles the bits
Yep, I've tried reading the datasheet.
i know this line "T2CON = 0x08" and SYSCLK/12 has something to do with the blinking of the LED. Like how many times it blinks in a minute. I still cant seem to figure it out. :/

ohh, okay. Thanks! :)
Topic archived. No new replies allowed.