Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Timer 0/Serial Communications? (http://www.chiefdelphi.com/forums/showthread.php?t=34582)

steven114 13-02-2005 20:21

Timer 0/Serial Communications?
 
I'm trying to appropriate TMR0 on the PIC for my own use, but when I do so the RC starts scrambling all my printf() calls.
Code:

T0CONbits.T08BIT = 1;
causes this:
Quote:

joyx = 127,joyy = 126
joyx = 127,joyy = 126
joyx = 127,joyy = 125
joyx = 127,joyy = 126
joyx = 127,joyy = 125
joyx = 127,joyy = 125
joyx = 127,joyy = 126
joyx = 127,joyy = 125
to look like this:
Quote:

joyx = 1536,joyy = 17185
joyx = 127,joyy = 155
joyx = 127,joyy = 1565
ocessor Initialized ...
joyx = 36,joyy = 17185
joyx = 1536,joyy 17575
ocessor Initialized..
joyx = 127,joyy = 155
joyx = ,joyy = 153685
joyx = 127,joyy = 1557185
joyx = 1536,joyy = 17185
joyx = 1536,joyy =7185
Quote:

printf("joyx = %d,joyy = % d\r\n",(int)DRIVEX,(int)DRIVEY);
is the only printf() called.

I've isolated it to that single instruction - if I remove that line, everything works great, except I can't use the timer. I seem to remember a sheet saying exactly what the code itself uses (in terms of processor resources) but I don't remember any of the timers being listed there and I can't find it again (after extensively searching the IFI site - does anyone else find it difficult to find stuff on it?)

Any ideas/pointers to where that information is? Thanks!

Tom Bottiglieri 13-02-2005 20:26

Re: Timer 0/Serial Communications?
 
Quote:

Originally Posted by steven114
I'm trying to appropriate TMR0 on the PIC for my own use, but when I do so the RC starts scrambling all my printf() calls.
Code:

T0CONbits.T08BIT = 1;
causes this:

to look like this:


is the only printf() called.

I've isolated it to that single instruction - if I remove that line, everything works great, except I can't use the timer. I seem to remember a sheet saying exactly what the code itself uses (in terms of processor resources) but I don't remember any of the timers being listed there and I can't find it again (after extensively searching the IFI site - does anyone else find it difficult to find stuff on it?)

Any ideas/pointers to where that information is? Thanks!

Timer 0 is used for internal processes. Try using timer 2 or 4, they are both easy to use.

steven114 13-02-2005 20:50

Re: Timer 0/Serial Communications?
 
Ah, that explains that. Thanks.


All times are GMT -5. The time now is 23:56.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi