TROUBLESHOOTING GUIDE

————————————-

 

In this post we shall discuss the following common problems faced by newbies & their solutions.

1. My   .c  file is not showing under Source files.

2. After selecting HITECH UNIVERSAL TOOLSUITE from under Toolsuite Contents , there is an X mark seen near the Location.

3. I do not see the .HEX file generated.

4. My Build is successful. Fusing of HEX file is ok , but my project is not working.

5. PICKIT2 complains that there is no Configuration bits ,while importing HEX file.

 

1. When you try to add your C code file .c by right clicking Source files , it lands up under Other Files.The reason is , you’ve not selected the Tool suite for HITECH C compiler & it is in Microchip ASM tool suite for Assembly language.Unless you select the Hitech C you can’t add a .c file to Source files.

 

Image 1

Open your Project & select from

Project –> Select Language ToolSuite

Under Active Toolsuite select the HITECH UNIVERSAL TOOLSUITE

Image 3

 

Now your .c file will appear under Source Files.

 

2. You see an X mark near the Location while selecting Hitech Universal Toolsuite.

The reason is that while installing the HITECH  C Compiler you’ve selected a different location other than C:  or you might not have checked the “Set environment path “ while installing Hitech C compiler.

Click on browse next to Location bar &  go to the location where you’ve installed  the C compiler & select it.

By default it is under location

Image 3

Under /bin folder the executable C compiler file is picc.exe

 

Image 1

 

3.  Your BUILD is successful , but you do not see the HEX file.

 

Image 4

 

The HEX file generated along with other files inside the Project folder. But you do not see the extension .hex

Go to Tools –>  Folder Options  of the Windows Explorer .

 

Image 5

 

Under VIEW tab Un tick  “Hide extensions for known file types “ & click OK.

 

Image 6

 

Now you can see the .hex file.

 

Image 7

 

4 & 5 .  Setting the  Configuration bits & including it in the C code is important.

 

Under Configure select Configuration Bits.

A new window opens. Uncheck the box “Configuration Bits set in code “ to enable editing the bits.

 

Image 8

 

By default the Oscillator is set to RC Oscillator.But in your project you use an external crystal of 8 or 20MHz.From the drop down menu select HS Oscillator which stands for usage of High Frequency oscillator.

Disable Watch Dog timer,Power up timer & Brown out Reset.

 

Image9

Generally LVP (Low Voltage Programming) is not used .So select  “RB3 is Digital I/O,HV on MCLR must be used for programming “  .

The final hex value is generated & shown under Value .(3F3A)

 

Image10

This Hex value should be added in your CONFIG statement of C code.Note the usage of two underscores __ before CONFIG.

 

Image11

 

Now build your project to generate HEX code with Configuration bits.

 

Watch this support video :

 

Solution to common problems while programming PIC

cooltext1137713216