Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Sat Apr 10, 2010 6:57 am
When posting code use the 'code' button. This helps to preserve the layout of your program and makes for easier reading.
When you are having problems with your program always try to narrow down as much as possible. By removing as many parts as possible you will finally have a small (not working) program. This helps you to focus on where the real program is, instead of where you _think_ the program is.
What oscillator are you using? Crystal, clock generator, R-C?
Assuming you are using an external crystal change the start of your program to:
A second problem is with variable 'j'. This is now declared as int but in the CCS compiler this equals to int8. An int8 has a maximum value of 255. You'll have to change it to an int16.
... and last:
Code:
for(j>250;j<500;j++)
This compiles but I'm not sure what code it will generate. Change to
Code:
for(j=250;j<500;j++)
ahmeddragonbleu
Joined: 10 Apr 2010 Posts: 5
Posted: Sat Apr 10, 2010 9:29 am
Thanks a lot for your help.
Now my program is running very well.
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