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

timer basics
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Wed Sep 14, 2016 4:16 am     Reply with quote

I think you need to understand they are not 'illegal statements'. CCS would highlight them if they were.

The strings like 'T0_DIV_1' are just convenience 'defines' for numbers. The function accepts any number, it is up to you to ensure that the values you select are right.
You can put any define into a setting, just as you can enter any number into a calculator. However they will only make sense if they are the numbers for the sum you want.

In this case, you are mixing a define from the T0 set, with others from the RTCC set. If you look at the RTCC set, they say:

"The following are provided for compatibility with older compiler versions".

You are mixing old with new.

It's like having a tape measure in inches, and another in cm, and then taking one set of values using the former, and mixing them with ones from the latter. Not surprising if you get a wrong result....

CCS can't check these values, since just as with the calculator, and value could be the one you actually want.

The big difference though is that in the second statement you are running the timer in 16bit mode. The default. The first statement would give exactly the same, if you removed the 8_bit part.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Wed Sep 14, 2016 2:30 pm     Reply with quote

Thnx, I agree. It is copy/paste from old program I have overlooked. So I agree but compiler could check device file and then indicate that current entries do not match the device file. This would help.
_________________
Help "d" others and then you shell receive some help from "d" others.
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, 3
Page 3 of 3

 
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