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

set_timer1() Question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Mill



Joined: 16 Jul 2006
Posts: 5
Location: Vancouver

View user's profile Send private message Send e-mail

set_timer1() Question
PostPosted: Sun Jul 16, 2006 10:35 am     Reply with quote

According to the following code, I think PIN A1 should be HIGH for 262msecs and LOW for 102msecs. This is not what is happening. I tried changing the SET_TIMER1(X) number but it doesn't seem to change anything.
What is it that I am doing wrong?

void main()
{
int16 delay = 0x4E20;
SET_TIMER1(delay);
SETUP_TIMER_1(T1_INTERNAL|T1_DIV_BY_8);

while(TRUE)
{
if(GET_TIMER1() <32768)
OUTPUT_LOW(PIN_A1);
if(GET_TIMER1()>32768)
OUTPUT_HIGH(PIN_A1);
}
}
//For some reason the code changed. So I fixed it again.
Crying or Very sad


Last edited by Mill on Sun Jul 16, 2006 1:02 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jul 16, 2006 12:09 pm     Reply with quote

Re-post your code, but this time, select the box in the posting window
to disable HTML. Example:

Code:
x  Disable HTML in this post



Also, post the PIC that you're using.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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