Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pic microcontroller using c language

Status
Not open for further replies.

sangu

New Member
can anyone guide me

i want start to pic microcontroller using c language.

i have mplab development software.

i need a help to how to write the program using c language from the basics .

give some reference book name or url of the website

Thanks for response
 
I use Hi-Tech PICC myself. Being a standard programming language, they are supposed to be compiler independent, but there are differences. Most common is the syntax of reading/assigning an output pin, also how the config bits are assigned.

Do you know C or C++? HiTech PICC is an easy tool to get ahold of. You don't need strictly need mplab after that, it compiles to hex files that any programming software can handle.
 
In what way? I only did a brief bit of tinkering with CCS. HiTech has a nice graphical IDE which is fairly reliable and well-planned as IDEs go.

Could you let me in on the specifics of what you found to be better?
 
I havent us HiTech before.
I think, CCS is easy-to-use to beginner.
It has built in function like setting timer, rs232, delay,i2c etc..
That you dont need to bother about the tedious job of configuring registers.
However, this convenience is a trade-off with code optimization.
I think that RAM usage can be easily exceed 256 bytes.
 
I saw that auto-setup stuff... it's not at all appropriate for me. Just reading the spec tells me what to put it in the registers. If you can't read the spec or understand how it works, god help your code.

Sorry to pull the arrogant prima donna act, I remember seeing the setup functions and laughed. Stuff to handle i2c should be structured in a library, not a tool, although HiTech sort of blew that too with less-than-useful examples rather than well structured and reusable library of code.

Code optimization is quite important. I ran 25k of code on my last project and got close to filling a PIC18F452. I blew the 1.5k of RAM space too, but I found I wasn't writing it to make good use of the banking and it got better when I fixed that.
 
sangu said:
can anyone guide me

i want start to pic microcontroller using c language.

i have mplab development software.

i need a help to how to write the program using c language from the basics .

give some reference book name or url of the website

Thanks for response
I know C and C++
But where to start with CCS or HI TECH?
 
I know C and C++
But where to start with CCS or HI TECH?

thats great!!!!!!!

now all u need to do is download the compilers and start programming. but both CCS and HiTech come at a price. altho there is a free version from Hitech (PICC-Lite) but it only programs a limited number of devices.

have a look at the articles at https://www.microchipc.com

for HiTech go to https://www.htsoft.com

and as u can see that there are two versions of the PICC software from HiTech. one is the PICC which covers the 12/14/16/17 series of PIC microcontrollers. go to https://www.htsoft.com/products/picccompiler.php

and then there is the PICC-18 which as u might have guessed it, covers the 18 series of PIC microcontrollers. go to https://www.htsoft.com/products/pic18ccompiler.php

and then there is the free PICC-Lite which only programs the 16F877, 16F877A, 12F675, 12F629, 16F627, 16F627A, 16F684, 16C84, 16F84, and the 16F84A devices. go to https://www.htsoft.com/products/PICClite.php

the PICC-Lite is the only free compiler for the PIC series of microcontrollers and as u can see that it covers only a limited range of the microcontrollers. so u r only left with having to buy the PICC and the PICC-18 which might cost u about $1500 in total :shock:

anyway i suggest that u download PICC-Lite and then play with it a little bit.

but i also want to tell u that the microcontrollers that PICC-Lite supports dont have a C-Optimized instruction set. only the 18 series of PICs have a C optimized instructions set. therefore u must have a little bit knowledge of assembly so that u can design a perfect and efficient system.

i hope that helps
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top