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

weird working: timer1!!!

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



Joined: 14 Jul 2007
Posts: 38

View user's profile Send private message

weird working: timer1!!!
PostPosted: Thu Feb 19, 2009 1:18 am     Reply with quote

hi everyone.

I had a difficult situation that i could not comment on it.

I have some program codes that uses only LCD subfunction and transmitting some values through the serial port.

I am using timer1 interrupt to generate 100ms period, that is 10*100ms =1second. Then after every 1 sec pin_a5 changes its state.

Here is the problem :
The parts of my codes are working except the part that is related to timer1. The output LED (connected to pin_a5) sometimes work properly but mostly it is not.

A strange thing: if I disconnect the supply voltage for a while then connect it sometimes cause to run properly.
(note the code works on simulation program properly)

Thanks...
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Thu Feb 19, 2009 2:58 am     Reply with quote

Without more information it is impossible to say what causes your problem.

Try starting with a simple as possible program, for example blinking a led. If this works you know your hardware is correct.
Then add a module and test again. Continue adding functionality until it stops working, then you know the last added code is (part) of the problem.

Just a wild guess is that your program contains not-initialised variables. At power up the RAM memory contains random data and this may be the reason you see the program sometimes work and other times fail.
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