View previous topic :: View next topic |
Author |
Message |
rovtech
Joined: 24 Sep 2006 Posts: 262
|
setup_port_a (); and other stuff not in the manual |
Posted: Sun Feb 23, 2014 11:24 am |
|
|
I sometimes find functions in examples or people's code that are not in the manual or under F11 search.
An example is setup_port_a (ALL_ANALOG); that compiles OK and is only shown in the manual under Program Syntax in the example "Here is a sample program with explanation using CCS C to read adc samples over rs232:"
Where do I find such things defined? Can I make up things like setup_port_c (sAN8|sAN9); I notice that in the 16F1509 .h it says SETUP_ADC_PORTS( ) (aka SETUP_PORT_A), is this just an old function that has been dropped?
I also notice that constants do not seem to be consistent such as NO_ANALOGS and ALL_ANALOG in the .h file for the 16F1509. Is the compiler flexible to changes of spelling or is there a reason for the single and plural words? |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19381
|
|
Posted: Sun Feb 23, 2014 12:19 pm |
|
|
SETUP_PORT_A, was dropped about ten years ago, but the compiler will still accept it for reverse compatibility with old code. Only applied to the earliest chips that only supported analog operation on port A. It appeared in very early manuals.
No (individual pins) have the analog property, while all the pins (as an entity), are analog.
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
rovtech
Joined: 24 Sep 2006 Posts: 262
|
|
Posted: Sun Feb 23, 2014 2:17 pm |
|
|
Thanks Ttelmah,
yes SETUP_PORT_C will not work.
Regarding my second question, the spelling has to match the .h spelling. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19381
|
|
Posted: Sun Feb 23, 2014 2:25 pm |
|
|
The point is that syntactically that is the way the English language expresses it....
There is an apostrophe missing, but this is now commonly omitted in general use. |
|
![](templates/subSilver/images/spacer.gif) |
|