reading post=what is prescaler?

Status
Not open for further replies.

MrDEB

Well-Known Member
have seen reference to this several times.
then 1:8 or 1:4 etc???
bear in mind this PIC stuff is new to my old mind.
trying to comprehend all this jargen.
planning on visiting Portland Oregon in couple of weeks and buying a book on programming language. Visiting the largest bookstore on the west coast as its several city blocks, several stories tall.
Just decding on basic or C.
Been stating out with Swordfish (seems easy enough ?) but looks very similar to basic C or ??
 
PiC's generally have several on chip periferals called timer/counters. Depending on how they are used we can either count or time events. Please note that timers come in at least 3 flavors.

The prescaler is a divider that goes between signal source and the timer input. A prescaler of 1:4 will reduce the input frequency to 1/4 the source.

The processor datasheets have good diagrams illustrating the timers and the bits used to set them up. There is also processor family datasheet (PIC16F family, PIC18F family) that goes into more detail.

Regarding language. Microchips provides code for TCIP, USB, and Zigbee stacks in C18. Other language vendors may or may not have them.

I try not to be a language bigot. The problem I have with most BASIC languages is that people have a difficult time transitioning from BASIC to other languages. Swordfish is closer to main stream procedural languages.

Another advantage that C has is standard syntax. However there are no standards regarding how the processor registers are accessed and named.

I use C18 and BoostC.

3v0


 
Last edited:
A simple example.

Lets say we have a 16Mhz oscillator, a counter which we require to count 1,000,000 in one second. Gets a bit difficult.
If we put a 1:16 prescaler between the oscillator and counter, the counter will be clocked at 1Mhz, and so it will count to 1,000,000 in 1 second.

I hope this helps.

JimB
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…