Hot!void initPIC(void); I need study reference material for c code Solved

Author
t1d
Junior Member
  • Total Posts : 98
  • Reward points : 0
  • Joined: 2015/01/26 15:49:24
  • Location: 0
  • Status: offline
2018/04/16 18:06:51 (permalink)
0

void initPIC(void); I need study reference material for c code Solved

What I want to know about is the initPIC function. I could find incidences, in users' code, when asking questions, on forums. However, I could find absolutely no tuts, as to its use, syntax, applications, placement, etc. I looked on the net, in the XC8 guide, the MPLab X guide, the PIC12F683 data sheet, xc.h library, etc. So, if you can point me to some study material, please...

 
Update
I take it, from inferences, that I have now seen, that it is a special function that turns on various stuff, that I might think was typically placed in the void main (void) loop, in order to keep the vmv loop clutter free. In the neighborhood of correct?

Hmm, found a smidgen more, maybe... It initiates code that will be processed just once, which keeps it from cluttering vmv with dead code. Still, I need reference text.

 
Thanks for the pointer. Pointer, c code... get it? <g>
post edited by t1d - 2018/04/16 18:31:48
#1

6 Replies Related Threads

    jtemples
    Super Member
    • Total Posts : 10895
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:11:06 (permalink)
    0
    There is no such thing as initPIC in XC8.  Sure, you could have a function called that, but it wouldn't be anything special.  You can initialize the PIC in main() or any other function.
    #2
    t1d
    Junior Member
    • Total Posts : 98
    • Reward points : 0
    • Joined: 2015/01/26 15:49:24
    • Location: 0
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:16:06 (permalink)
    0
    Thank you. I may not have the syntax correctly... What about init(), or __init... I am a noob and these syntaxes may be from other code types... assembly, etc... Maybe you can infer from the operations, that I noted, what function I may be thinking of.
    #3
    t1d
    Junior Member
    • Total Posts : 98
    • Reward points : 0
    • Joined: 2015/01/26 15:49:24
    • Location: 0
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:17:50 (permalink)
    0
    Ahh... can initialize in any other function... This may be the clue...
    #4
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:21:08 (permalink)
    +1 (1)
    As jtemples said, there is no such special function, by any name.
    If you are working from a particular web page or tutorial, give us a link to that page so we can comment more precisely.
     
    n.b. If there WAS such a function, then the XC8 User Guide would be the correct place to look for it.
     
    post edited by qɥb - 2018/04/16 18:22:49

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #5
    t1d
    Junior Member
    • Total Posts : 98
    • Reward points : 0
    • Joined: 2015/01/26 15:49:24
    • Location: 0
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:30:33 (permalink)
    0
    I did not bookmark any web stuff, because it did not provide any tutorial information. So, I will go with:
    - You can initialize the program from main, or any other function
    - Doing so, outside of main, may keep main uncluttered and reduce dead code in main.
    Thank you so much, for your help.
    #6
    qɥb
    Monolothic Member
    • Total Posts : 3329
    • Reward points : 0
    • Joined: 2017/09/09 05:07:30
    • Location: Jupiter
    • Status: offline
    Re: void initPIC(void); I need study reference material for c code 2018/04/16 18:36:52 (permalink)
    0
    t1dunn
    - You can initialize the program from main, or any other function

    I would re-word that to "or any other function called from main"
     

    - Doing so, outside of main, may keep main uncluttered

    Agree. I usually put my init code into a separate function and call it at the start of main for just that reason.
     

    and reduce dead code in main.

    I'm not sure what your point is here. I guess it depends upon your definition of "dead code".
    To me, that means code that is never called. XC8 throws away any code that's never called anyway.
    Otherwise this just falls under the "keep main uncluttered" point.
     

    This forum is mis-configured so it only works correctly if you access it via https protocol.
    The Microchip website links to it using http protocol. Will they ever catch on?
    PicForum "it just works"
    #7
    Jump to:
    © 2018 APG vNext Commercial Version 4.5