Getting Started with Hi-Tech C – II

22 July, 2008 (00:07) | PIC, Tutorials | By: Joshua

Now that the program is on the computer and ready to go, we can get to the interesting parts. In this brief tutorial, we’ll get you started on making a project and figuring out where to put your code.

Creating a Project

To start out, you need a project. The project is the directory where all the files are stored and, while overkill at first, becomes helpful once the programs get more difficult and involved. We’ll only talk about what you need to actually get something done and we’ll ignore the rest until later.

Though you don’t necessarily have to do it this way, we’ll start from the workbench. You’ll start at this page (you can see the current projects I have in the left panel):

HI-TECH C Workbench

Go to File -> New -> Project It’ll pop-up a page asking which wizard you’d like to use to create the project. Select the PICC-Lite Project.

Select a Wizard for the project

You may have more choices than this, but this is the one you want to choose. On the next page, choose whatever project name you want. I’ll put in Monkey_Shorts because I’m kinda crazy that way. Continue to the next page, where you’ll want to select Hex Project Type (and for me it’s the only choice) and then Release as the build configuration. Next, choose your chip. Since a 16F690 came with the PICkit 2 Low Pin Count Demo board I bought, that is the chip I’m most familiar with. If you have a different one, pick that.

Microcontroller Selection

The next page seems somewhat pointless to me. What does the compiler care about the package of the chip? Isn’t is the same chip either way, receiving the same programming? Anyway, make sure the Create main function box is selected, and then click Finish.

Now you can see the new project in the left panel and you can also see main.c. Left clicking this file will bring up main.c for editing in the main window.

Workbench with Project

In the next and final “Getting Started with Hi-Tech C” tutorial, we’ll finish this up by writing a small “Hello World” program and figuring out how to export a .hex file for our PIC.

Write a comment