PIC

can someone please explain in simple terms why I need to and how i can initialize the Fosc and Timer2.

...and what effects these have on the program. i am fairly new to micro-controller programming.

thank you

--------------------------------------- Posted through

formatting link

Reply to
tha switch
Loading thread data ...

Go to the microchip forums on the microchip website. Look in the forums about timers & oscillators. Lots of good information there.

Reply to
Dennis

Fosc presumably means the oscillator (clock) frequency. It determines how long each instruction will take to execute, but it's also the base clock for many peripherals. It's usually initialised by "config" directives in the source code, and may be changed at run time; the precise details depend upon whether you're using C or assembler and exactly which PIC you're using (there are hundreds of different models).

Timer2 is a timer. It's clock will be derived from Fosc, and may be used to derive the clock for other peripherals (e.g. PWM). Again, the details depend upon exactly which PIC you are using.

To do anything with a PIC, you need the datasheet for the specific model which you are using. You also need a reasonable understanding of digital electronics and low-level programming (familiarity with assembly language programming is useful even if you're going to be programming in C). None of these can be learnt in a few hours. Nor can they be learnt by accumulating isolated facts; you need to understand how the various concepts interact.

If there's a demo board for the PIC you are using (or a similar model), you might want to look at the datasheet for the demo board, as that may have an introductory tutorial.

Reply to
Nobody

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.