CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

is this a way around my calculation delay?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Blob



Joined: 02 Jan 2006
Posts: 75
Location: Neeroeteren, Limburg, Belgium

View user's profile Send private message

PostPosted: Tue Oct 14, 2008 4:36 am     Reply with quote

I was wrong again,

T1_External does not take the osc1 and osc2 input, but T1OSO and T1OSI...

now the big problem is that i don't have any pins but one left on my pic.

So I was thinking to use Timer2 instead.
I can do a DIV_BY_16 with Timer 2.

But it is only 8 bit, so I have to think of something else...

or someone has an idea?


Best Regards
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

PostPosted: Tue Oct 14, 2008 1:57 pm     Reply with quote

Why can't you use Timer 1 with DIV_BY_8?
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
Blob



Joined: 02 Jan 2006
Posts: 75
Location: Neeroeteren, Limburg, Belgium

View user's profile Send private message

PostPosted: Wed Oct 15, 2008 1:33 am     Reply with quote

because it runs too fast, i have my program running on 20Mhz,

but some parts of it are too slow for high rpm of the disc.

So I wanted to double the clock speed, and thus I have to double the prescaler from 8 to 16
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

PostPosted: Wed Oct 15, 2008 5:13 am     Reply with quote

Can't you make adjustments in your program to accommodate the faster clock? Would you have a problem with overflow at lower speeds? If so, perhaps that can be handled by software extensions to the Timer.
_________________
Robert Scott
Real-Time Specialties
Embedded Systems Consulting
Ttelmah
Guest







PostPosted: Wed Oct 15, 2008 7:59 am     Reply with quote

Blob wrote:
I was wrong again,

T1_External does not take the osc1 and osc2 input, but T1OSO and T1OSI...

now the big problem is that i don't have any pins but one left on my pic.

So I was thinking to use Timer2 instead.
I can do a DIV_BY_16 with Timer 2.

But it is only 8 bit, so I have to think of something else...

or someone has an idea?


Best Regards

I'm sorry, but 'of course' it takes it's own OSC pins. This is why you would need an oscillator that is capable of driving two pins....
If you have no spare pins, then I'm afraid you will have to look at doing the extra division yourself. As another poster has said, handle the timer overflow, so you get an 'extended' timer, usig 17bits, not 16, and just divide the result by two.

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Oct 15, 2008 8:23 am     Reply with quote

The usual PIC crystal oscillator circuit is capable of driving several pins. I have had one master PIC with the crystal, and its crystal drive pin also driving the crystal input pins of 3 or 4 other PICs so they are all clocked together.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group