i am really a beginner at programming a mcu. i have already wrote the c code to program my PIC16F877A microcontroller, but i can't figure out how to convert this c code to its hex counterpart.
i have downloaded a demo version of the ccs c compiler which needed an internet connection to operate. i compiles the program and it stated no error.
now what is the next step. Please help me!!!!!
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
Posted: Mon Jan 29, 2007 7:05 am
Look in the project directory and you will find the hex file if it did indeed compile without errors.
tom5467 Guest
Posted: Tue Jan 30, 2007 8:15 am
the ccs c compiler did reply that it had no errors, but i doubt that it had none. see my project is to create a fire protection system which consists of a main and remote unit, both with PIC16F877A. The main unit has four analog inputs to sense presence of fire hazard and three led outputs for warning purposes. one o/p activates a solenoid while still another o/p is sent to other PIC.
this is what the code looks like for the main unit_:
----------------------------------------------------------------
#include <16F877A.h>
Set_Tris_A(MY_TRISA); // Port A's I/O
Set_Tris_B(MY_TRISB); // Port B's I/O
Set_Tris_C(MY_TRISC); // Port C's I/O
Set_Tris_D(MY_TRISD); // Port D's I/O
initADC();
while(FOREVER)
{
// beginning of testing of the lights
delay_us(50);
set_adc_channel( 3 );
delay_us(10);
ADC_3 = read_adc(); // Read in the value of the ADC
delay_us(50000);
//beginning of temperature sensing
delay_us(50);
set_adc_channel( 0 );
delay_us(10);
ADC_0 = read_adc(); // Read in the value of the ADC
delay_us(50000);
if (ADC_0 > temp)
{
set_adc_channel( 1 );
delay_us(10);
ADC_1 = read_adc(); // Read in the value of the ADC
delay_us(50000);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum