C programming for PIC30F3011

Discussion in 'Embedded Systems and Microcontrollers' started by mpnvineeth, Sep 3, 2012.

  1. mpnvineeth

    Thread Starter New Member

    Sep 3, 2012
    Dear all,
    I am a fresher in the world of microcontrollers. I have started working with dsPIC30F3011, and I am using MPLAB IDE along with MikroC. My doubt is, how do we program the input output ports in my C code? The answers 'TRISB' and the like, I am not expecting, as my C code is supposed to have only high level language instructions, not any name of registers. (I am doing a project where i am supposed to work with floating point numbers and hence i was suggested dsPIC30F3011 as a good choice.)

    Thank You.
    Last edited: Sep 3, 2012
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    The answer you are not expecting is the exactly correct one. C may not know about those registers, but the include files certainly do. You don't see them in the Mikro compiler as it hides them inside a dot-C file it automatically includes into your project without telling you.

    Had you chosen a Microchip compiler you would need to explicitly #include the proper header file to do the same.

    Sounds like you should spend some time looking over whatever examples your compiler provided you with.
    mpnvineeth likes this.
  3. mpnvineeth

    Thread Starter New Member

    Sep 3, 2012
    I Thank you dear ErnieM for that reply.
    I ahve later gone through some code examples and I found what you sad is true. Hope your help in future too...
  4. blind2_man

    Active Member

    May 12, 2008
    The integer calculation it is usualy mush faster then floting point. I would sugest to swith from floting point to fix point calculation. Search for example Q format to represent numbers in fixed point.
    The major disadvantage is that you have set up resolution for each signal.