Go to Post Get your team together. Get your priorities straight. Get busy having fun. See you on the field. - EricH [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2005, 20:21
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
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!
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!
  #2   Spotlight this post!  
Unread 13-02-2005, 20:26
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,187
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
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.
  #3   Spotlight this post!  
Unread 13-02-2005, 20:50
steven114 steven114 is offline
Programming Wizard and Team Captain
AKA: Steven Schlansker
FRC #0114 (Eaglestrike)
Team Role: Programmer
 
Join Date: Feb 2004
Location: Los Altos, CA
Posts: 335
steven114 is a jewel in the roughsteven114 is a jewel in the roughsteven114 is a jewel in the rough
Send a message via AIM to steven114
Re: Timer 0/Serial Communications?

Ah, that explains that. Thanks.
__________________
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accelerometer Timer Question psquared Programming 3 12-02-2005 01:34
How to use timer in the controller Thedarkmaster Programming 5 09-01-2005 12:48
Timer interrupt hic-cupping - HELP roknjohn Programming 9 15-03-2004 17:56
Interrupt timer, executing code asap? SeanCassidy Programming 10 07-03-2004 01:47
autonomous mode timer Don Programming 6 09-02-2003 22:16


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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