C programming for PIC30F3011

Thread Starter

mpnvineeth

Joined Sep 3, 2012
5
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:

ErnieM

Joined Apr 24, 2011
8,377
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.
 

Thread Starter

mpnvineeth

Joined Sep 3, 2012
5
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...
 

blind2_man

Joined May 12, 2008
33
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.
 
Top