PDA

View Full Version : Resources used py PBP?



milestag
- 19th September 2005, 04:38
Hi all,

What PIC hardware resources are used by PBP? Do I have all the Timers available to use? Or is one of them already used by the compiler library functions for things like "Pause"?

Bottom line...can I freely use Timer0, Timer1 and Timer2 without affecting internal operations of the compiler?

thanks (couldn't find this in the manual, though someone will surely point it out)

Jim

Melanie
- 19th September 2005, 07:10
PICBasic uses NO Hardware features of the PIC (besides Stack, RAM and Codespace of course) with a few exceptions...

ADCIN will use the A/D Converters
HSERIN and HSEROUT will use the USART
HPWM will use the CCP Modules and note that TMR2 is usually associated with timing those (but best check the Datasheet for your PIC)
The USB Commands will use the USB Module

otherwise all the TIMERS. SPI module, Comparators, OP-Amps are free for your use. Naturally if you don't use those Hardware Commands of PICBasic then those PIC features are free to be driven by you howsoever you please. PAUSE (since you mentioned it) is a software timer.

milestag
- 20th September 2005, 01:44
Thanks for the quick response! That's a huge relief. Now I can really get down to debugging my code ;-)

regards,
Jim

Ingvar
- 20th September 2005, 08:10
In the good old days, PBP assigned and needed the TMR0/WDT prescaler to be assigned to WDT and set to the longest timeoutperiod. My guess is that this is still true. You could run into problems if you assign the prescaler to TMR0 (and run the pic at low speeds). No problem to use TMR0 without the prescaler.

milestag
- 20th September 2005, 12:26
I usually turn the WDT off anyway in most of my projects. But I DO need to use the prescaler with TMR0 for the current project.

You'd think these things would be spelled out more clearly in the manual to avoid confusion. But then the manual does leave alot to be desired overall.