Requst of easy Mickro C tutorial

Microcontroller Topics
Post Reply
GihanAsanka
Sergeant Major
Sergeant Major
Posts: 28
Joined: Mon Aug 15, 2011 4:09 pm

Requst of easy Mickro C tutorial

Post by GihanAsanka » Tue Oct 11, 2011 10:05 am

Hi good morning

Hi i’am biginner of Mickro C. Therefore Can i get Mickro C Tutorial if any one have.
That will big help for me
Thank you.,B-)

[ Post made via Mobile Device ] Image
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Requst of easy Mickro C tutorial

Post by Neo » Tue Oct 11, 2011 12:16 pm

Have a look at PIC Microcontrollers - Programming in C. This is available as a book but you can read the full text online for free.

Another very good C compiler for PIC is HI-TECH C. Lots of people are using that for professional use. Unlike MicroC, HI-TECH C (also MPLAB C) integrates to MPLAB IDE. You might give a try to HI_TECH C as well.

This Microchip link has information on the recommended compilers for PIC.
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Re: Requst of easy Mickro C tutorial

Post by SemiconductorCat » Tue Oct 11, 2011 7:53 pm

and neo , on linux sounds promising using SDCC (small device 'C' compiler).However that's something I
heard but not somewhat already experienced with. One of my friend told me he is working with this instead he
have to pay for the HI_TEC.You're free to remove my post if not appropriate.

http://www.micahcarrick.com/pic-c-progr ... linux.html
User avatar
Neo
Site Admin
Site Admin
Posts: 2642
Joined: Wed Jul 15, 2009 2:07 am
Location: Colombo

Re: Requst of easy Mickro C tutorial

Post by Neo » Wed Oct 12, 2011 1:07 pm

Sandun, I guess you mean running Micro Linux type OS on microcontrollers. Micro Linux (there are some other embedded OSs such as RTOS) might good on powerful chips such as ARM, DSPs, etc... But on a uC with a small flash memory (ex: 4K), it would be impossible to run even the Kernel. Direct machine language execution, threading through interrupts/timers are the common practices with such small devices. Almost all good programming practices must be applied when you work on them. Dev time code optimisation is one of the most important things. If one need to become a good quality C/C++/ASM programmer, I would recommend to work on such little uCs (There is less room for mistakes with them).

SDCC only works on Intel 8051, Maxim 80DS390, Zilog Z80 and the Motorola 68HC08 based MCUs at the moment. They are still working on Microchip PIC16 and PIC18 series. There are more PICs such as 12 series and dsPIC that are widely used nowadays which they need to plan. Also, Atmel which known as the most reliable uC for professional applications, need to be addressed. However, I guess they will address them in future.

HI-TECH has a free version that comes with MPLab (for PICs). It might not be good for professional projects since the optimisations is not good. But for a beginner HI-TECH free version is more than enough.

I would also like to ask beginners to learn assembly language (ASM) on PIC in parallel to C/C++. It is nice to write codes with a few ASM instructions (due to RISC architecture of most uCs). When I say C++, don't misunderstand with OOP side of it. In the embedded world OOP is a white elephant. On small chips with less memory, dynamic memory allocation (which is essential in OOP environment), garbage collection are just a few nightmare to achieve.

Gihan, If you already have Mikro C (that comes with its own IDE), then it is okay to work with that.
Post Reply

Return to “Microcontrollers”