CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

MAX517 and PIC16F877

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rblue
Guest







MAX517 and PIC16F877
PostPosted: Sun Apr 08, 2007 5:34 pm     Reply with quote

hi guys i am using pic 16f877 and max 517 ... i have written a programme and it is giving an error can any body check what i did wrong:


Code:

#include <16F877.h>

#device ICD=TRUE
#device ADC=10 // Use 10bits ADC
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000) // 16Mhz Crystal is Used

#include <MAX517.c>  //Call for MAX517.c function

#define TRIGGER = PIN_E0
#define SAMPLE1 = PIN_C4
#define SAMPLE2 = PIN_D2
#define SAMPLE3 = PIN_C5

int1 data_end = 0;


void main(void)
 {
   set_tris_d( 0xff );
   set_tris_c( 0xbf );
   set_tris_e( 0xff );

Begin:

if (TRIGGER)//<-- A numeric expression must appear here what i did wrong cant find out
         {
      data_end = 0 ;
      }
   else
      goto  Begin ;

  while(1)
   {
   if (!TRIGGER && !data_end)
         {
      if (!SAMPLE1)

         {
               output_high(PIN_A0); //LED ON
               write_dac(0xFF);     //DAC output 5V
            delay_ms(5000);    //Delay

            output_low(PIN_A0); //LED OFF
            write_dac(0x00);   //DAC output 0V
            delay_ms(5000);    //Delay
         data_end = 1 ;
         }
      else
            if (!SAMPLE3)

         {
               output_high(PIN_A0); //LED ON
               write_dac(0xFF);     //DAC output 5V
            delay_ms(5000);    //Delay

            output_low(PIN_A0); //LED OFF
            write_dac(0x00);   //DAC output 0V
            delay_ms(5000);    //Delay
         data_end = 1 ;
         }
         }

      else
      goto Begin ;
   }

}


Looking forward for help

Rblue
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Sun Apr 08, 2007 5:42 pm     Reply with quote

Code:
#define TRIGGER = PIN_E0
change to
Code:
#define TRIGGER  PIN_E0
rblue
Guest







PostPosted: Sun Apr 08, 2007 10:13 pm     Reply with quote

thanx.............. its now working fine


Laughing
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group