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

Guide request about my code(timers and other errors)

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



Joined: 08 Aug 2006
Posts: 9

View user's profile Send private message Yahoo Messenger

Guide request about my code(timers and other errors)
PostPosted: Tue Sep 05, 2006 2:36 am     Reply with quote

Hi
I want to send Data from a transmitter board to a receiver.
kindly attend to following explanations :
1- my PIC is 16f877a
2- my crystal is 7.68MHz
3- a binary '1' is represented by a 1ms burst of 120kHz at the zero crossing point of the AC line and a binary '0' by the absence of 120kHz.


my transmitter code is:


#include <trans1.h>
///////////////////////////My_LCD2\\\\\\\\\\\\\\\\\\\\\\\\
struct lcd_pin_map { // This structure is overlayed
BOOLEAN enable; // on to an I/O port to gain
BOOLEAN rw; // access to the LCD pins.
BOOLEAN rs; // The bits are allocated from
BOOLEAN unused; // low order up. ENABLE will
int data : 4; // be pin B0.
} lcd;

#if defined(__PCH__)
#if defined use_portb_lcd
#byte lcd = 0xF81 // This puts the entire structure
#else
#byte lcd = 0xF83 // This puts the entire structure
#endif
#else
#if defined use_portb_lcd
#byte lcd = 6 // on to port B (at address 6)
#else
#byte lcd = 8 // on to port D (at address 8)
#endif
#endif

#if defined use_portb_lcd
#define set_tris_lcd(x) set_tris_b(x)
#else
#define set_tris_lcd(x) set_tris_d(x)
#endif


#define lcd_type 2 // 0=5x7, 1=5x10, 2=2 lines
#define lcd_line_two 0x40 // LCD RAM address for the second line


BYTE const LCD_INIT_STRING[4] = {0x20 | (lcd_type << 2), 0xc, 1, 6};
// These bytes need to be sent to the LCD
// to start it up.


// The following are used for setting
// the I/O port direction register.

struct lcd_pin_map const LCD_WRITE = {0,0,0,0,0}; // For write mode all pins are out
struct lcd_pin_map const LCD_READ = {0,0,0,0,15}; // For read mode data pins are in


/*
BYTE lcd_read_byte() {
////////// lcd_read_byte() \\\\\\\\\\\
BYTE low,high;
set_tris_lcd(LCD_READ);
lcd.rw = 1;
delay_cycles(1);
lcd.enable = 1;
delay_cycles(1);
high = lcd.data;
lcd.enable = 0;
delay_cycles(1);
lcd.enable = 1;
delay_us(1);
low = lcd.data;
lcd.enable = 0;
set_tris_lcd(LCD_WRITE);
return( (high<<4) | low);
/////////////////////\\\\\\\\\\\\\\\\\\\\\\
}


void lcd_send_nibble( BYTE n ) {
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = n;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\\
}
*/

void lcd_send_byte( BYTE address, BYTE n )
{
int8 x;
BYTE low,high;
lcd.rs = 0;
do
{
////////// lcd_read_byte() \\\\\\\\\\\
set_tris_lcd(LCD_READ);
lcd.rw = 1;
delay_cycles(1);
lcd.enable = 1;
delay_cycles(1);
high = lcd.data;
lcd.enable = 0;
delay_cycles(1);
lcd.enable = 1;
delay_us(1);
low = lcd.data;
lcd.enable = 0;
set_tris_lcd(LCD_WRITE);
x = (high<<4>> 4); \\
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = n>>4;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\
// lcd_send_nibble(n & 0xf); \\
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = n & 0xf;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\\

}


void lcd_init() {
BYTE i;
set_tris_lcd(LCD_WRITE);
lcd.rs = 0;
lcd.rw = 0;
lcd.enable = 0;
delay_ms(15);
for(i=1;i<=3;++i) {
// lcd_send_nibble(3);
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = 3;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\
delay_ms(5);
}
// lcd_send_nibble(2);
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = 2;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\

for(i=0;i<=3;++i)
lcd_send_byte(0,LCD_INIT_STRING[i]);
}


void lcd_gotoxy( BYTE x, BYTE y) {
BYTE address;
int8 t;
BYTE low,high;


if(y!=1)
address=lcd_line_two;
else
address=0;
address+=x-1;
// lcd_send_byte(0,0x80|address);
/////// lcd_send_byte(address,n)\\\\\\
lcd.rs = 0;
do
{
////////// lcd_read_byte() \\\\\\\\\\\
set_tris_lcd(LCD_READ);
lcd.rw = 1;
delay_cycles(1);
lcd.enable = 1;
delay_cycles(1);
high = lcd.data;
lcd.enable = 0;
delay_cycles(1);
lcd.enable = 1;
delay_us(1);
low = lcd.data;
lcd.enable = 0;
set_tris_lcd(LCD_WRITE);
t = (high<<4>> 4); \\
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = (0x80|address)>>4;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\
// lcd_send_nibble(n & 0xf); \\
////////// lcd_send_nibble(n) \\\\\\\\\\\\
lcd.data = (0x80|address)& 0xf;
delay_cycles(1);
lcd.enable = 1;
delay_us(2);
lcd.enable = 0;
/////////////////////\\\\\\\\\\\\\\\\\\\\\\

}

void lcd_putc( char c) {
switch (c) {
case '\f' : lcd_send_byte(0,1);
delay_ms(2);
break;
case '\n' : lcd_gotoxy(1,2); break;
case '\b' : lcd_send_byte(0,0x10); break;
default : lcd_send_byte(1,c); break;
}
}
/*
char lcd_getc( BYTE x, BYTE y) {
char value;

lcd_gotoxy(x,y);
while ( bit_test(lcd_read_byte(),7) ); // wait until busy flag is low
lcd.rs=1;
value = lcd_read_byte();
lcd.rs=0;
return(value);
}
*/
void lcd_putnum(int8 i)
{
// lcd_putc((i/10)+0x30);
lcd_send_byte(1,(i/10)+0x30);
i %= 10;
// lcd_putc(i+0x30);
lcd_send_byte(1,i+0x30);
}

void lcd_putday(int8 day)
{
switch (day)
{
case 0: lcd_send_byte(1,'S');
lcd_send_byte(1,'A');
lcd_send_byte(1,'T');
// lcd_putc("SUN");
break;
case 1: lcd_send_byte(1,'S');
lcd_send_byte(1,'U');
lcd_send_byte(1,'N');
// lcd_putc("SUN");
break;
case 2: lcd_send_byte(1,'M');
lcd_send_byte(1,'O');
lcd_send_byte(1,'N');
// lcd_putc("MON");
break;
case 3: lcd_send_byte(1,'T');
lcd_send_byte(1,'U');
lcd_send_byte(1,'E');
// lcd_putc("TUE");
break;
case 4: lcd_send_byte(1,'W');
lcd_send_byte(1,'E');
lcd_send_byte(1,'D');
// lcd_putc("WED");
break;
case 5: lcd_send_byte(1,'T');
lcd_send_byte(1,'H');
lcd_send_byte(1,'U');
// lcd_putc("THU");
break;
case 6: lcd_send_byte(1,'F');
lcd_send_byte(1,'R');
lcd_send_byte(1,'I');
// lcd_putc("FRI");
break;
}
}

////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

#define PIN_Xin PIN_C3
#define Falling 1
#define Rising 0

//////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\
//Global Variables
/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\

int1 X10TxFlag, X10RxFlag;
int1 RxBit,TxBit;
int1 TxCommandFlag=1,RxCommandFlag,SecondTxFlag;
int TXData3=0,TxData2=0,TxData1=0,TxData0=0;
int RxData3=0, RxData2=0, RxData1=0, RxData0=0;
int checkstart1=0,checkstart2=0;
int RxFunction=0,RxUnit=0,Rxkey1=0,Rxkey2=0,RxHouse2=0,RxHouse1=0;
int NumTxBit,count;
int w,w1,w2,w3,w4,w5;
int1 ext_edge=Falling,ZX;
int8 i=10,ZxCount,seconds;
int keys;
int1 j=0,k=0,X10AddressSent=0;
int RxHouse,xor,TxHouse,TxUnit,TxFunction;
int16 ADC_Average=0;
int8 ADC_Counter=0;

////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\

int8 KBH();
void TransmitX10Bit();
void RotateTxData(int w);
void ZeroCrossing();
void InitX10Tx();
void InitZerocrossingDetect();
void ShowCodeTx();
void ToggleInterruptEdge();
void ControlX10Units();

/////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\

#byte trisc=0x87
#bit Xout=trisc.2
#bit t0if=0xb.2
#bit intf=0xb.1
#byte status=0x3
#bit carry=status.0
#bit zerro=status.2


/////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\


#int_EXT
EXT_isr()
{

TransmitX10Bit();

//********************* ReceiveX10Bit*************************
//called at every ZC .
//if 120khz is present (Xin=1), set the RxBit otherwise,clear the RxBit.
//***********************************************************

if(X10TxFlag==0) //if transmit is done RxBit=0.
{RxBit=0;}
RxBit=input(PIN_Xin); //else RxBit=Xin.
if(X10TxFlag==1) //If X10TxFlag is set,transmit is begin. then,performe X10Tx.
{

//***************** X10Tx() ******************
//Transmit 22 bits of data out of TXData registers
//Rotate by 10 to reposition TXData
//Transmit 28 bits of data out of TXData registers
//*******************************************


TxBit=bit_test(TxData3,7);
carry=TxBit;
#asm
rlf TxData0,f
rlf TxData1,f
rlf TxData2,f
rlf TxData3,f
#endasm
NumTxBit--;
if(NumTxBit ==0) //Have all the bits been sent?
{
if(SecondTxFlag==0)//Yes, was this the second transmission?
{
SecondTxFlag=1;//No, set up for second transmission and
//Set the flag to indicate second transmission.
w=10;
RotateTxData(w);//Reposition data at left end of buffer.
NumTxBit=28; //Send 22 bits again.
}
else
{
X10TxFlag=0; //If X10TxFlag is clear, then last transmit is done.

}

}
}

///////// X10Rx() \\\\\\\\\\\

carry=RxBit;
#asm
rlf RxData0,f //Rotate the received data into the RxData registers.
rlf RxData1,f
rlf RxData2,f
rlf RxData3,f
#endasm
checkstart1=RxData3 & 0b00001111; //Check for the Start Code '1110'
checkstart2=checkstart1 ^ 0b00001110;
if(checkstart2==0) //Is the start code present?
{
//********************************************************
// When Start Code is detected in RxData3 [xxxx1110]
//perform the below operations:
//********************************************************
RxHouse2=RxHouse1;
Rxkey2=Rxkey1;
RxHouse1=RxData2;
Rxkey1=RxData1;
w1=RxHouse1^RxHouse2; //Do last two received house codes match?
if(w1==0)
{
w2=Rxkey2^Rxkey1; //Do last two received key codes match?
if(w2==0)
{
w3=RxData0 & 0b11000000; //Check for the Unit address suffix '01'
w4=w3 ^ 0b01000000;
if(w4==0) //Is the Unit address suffix present?
{
RxUnit=Rxkey2;
RxCommandFlag=0; // Yes, then address has been received.
X10RxFlag=1; //If X10RxFlag is set, then data has been received.

}
else
{
w5=w3 ^ 0b10000000; //check for Function suffix.
if(w5==0) //Is the Function suffix present?
{
RxFunction=Rxkey2;
RxCommandFlag=1; //yes,Set command received flag.
X10RxFlag=1; //If X10RxFlag is set, then data has been received.

}
}
}
}
}

ToggleInterruptEdge();

}


#int_TIMER0
TIMER0_isr()
{
EndX10Envelope:
Xout=1; // disable 120khz output
disable_interrupts(INT_timer0);
}
/////////////////////\\\\\\\\\\\\\\\\\\\\\\\\

void main()

{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_1,15,1);
setup_ccp1(CCP_PWM);
set_pwm1_duty(32L);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_EXT);
enable_interrupts(INT_TIMER0);
enable_interrupts(GLOBAL);
//***************
lcd_init();
InitZerocrossingDetect();
lcd_gotoxy(1,1);
lcd_putc("X10 THERMOSTAT");

//**************************************

while(1)
{
keys=0;
while (keys==0) keys=KBH();
switch(keys)
{
case 2:

lcd_gotoxy(1,2);
lcd_putc("setpoint:");
i++;
if (i==35){ i=10;}
lcd_gotoxy(11,2);
lcd_putnum(i);
break;

case 4:

lcd_gotoxy(1,2);
lcd_putc("setpoint:");
if (i==10) {i=35;}
i--;
lcd_gotoxy(11,2);
lcd_putnum(i);
break;

case 8:
w=4;
RotateTxData(w);
ShowCodeTx();
break;

case 16 :

lcd_putc('\f');
lcd_gotoxy(1,1);
lcd_putc("ControlX10Units");
ControlX10Units();
break;

case 32 :

while (1)
if (X10TxFlag==0) InitX10Tx();
}
}
}




///////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\


VOID InitX10Tx()

{
TxData3=0b00001110; //load TxData3 with start code.
TxData2=TxHouse; // house code
if(TxCommandFlag==1) //is the transmit command flag set?

{
TxData1=TxFunction; //yes,then prepare to transmit command.
TxData0=0b10000000;
}

else
{
TxData1=TxUnit; //no,then prepare to transmit an address.
TxData0=0b01000000;
}
w=4;
RotateTxData(w); //rotate the TxData registers 4 times to
// the left to prepare for transmission.
NumTxBit=22; //set number of bites to transmit.
SecondTxFlag=0;
X10TxFlag=1; // Set the X10TxFlag to begin transmission.
}

///////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\

void ShowCodeTx()
{
int i;
lcd_putc('\f');
lcd_gotoxy(1,1);
lcd_putc("TxData: ");

for (i=0;i<8;i++)
lcd_putc(0x30 + bit_test(TxData3,7-i));
lcd_gotoxy(1,2);
for (i=0;i<8;i++)
lcd_putc(0x30 + bit_test(TxData2,7-i));
for (i=0;i<8;i++)
lcd_putc(0x30 + bit_test(TxData1,7-i));
for (i=0;i<8;i++)
lcd_putc(0x30 + bit_test(TxData0,7-i));

}


//********************TransmitX10Bit************************
//called at every ZeroCrossing.
//if TxBit=1,enable 120khz output for 1ms otherwise, do nothing.
//********************************************************

VOID TransmitX10Bit()
{
if(TxBit ==0)
RxBit=0;
else
{
Xout=0; //enable 120khz output.
set_timer0(0xe2);//??
enable_interruptS(INT_timer0);
RxBit=1;
}

TxBit=0;
}


///////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

void ControlX10Units()

{
if(X10AddressSent==0) //has address been sent?
{
TxHouse=0b01101001; //no, then send address.
TxUnit=0b01101001;
TxCommandFlag=0; //clear the TxCommandFlag for sending address.
InitX10Tx();
X10AddressSent=1;
X10TxFlag=1; //Set the X10TxFlag to begin transmission.
}
else
{
TxHouse=0b01101001; //yes, then send command.
TxUnit=0b01010110;
InitX10Tx();
X10AddressSent=0;
X10TxFlag=1; //Set the X10TxFlag to begin transmission.
}
}



int8 KBH()
{

int8 keys=0;
if(!input(PIN_B1)) keys+=2;
if(!input(PIN_B2)) keys+=4;
if(!input(PIN_B5)) keys+=8;
if(!input(PIN_B4)) keys+=16;
if(!input(PIN_B3)) keys+=32;
if(keys!=0)
{
delay_ms(500);
return(keys);
}
return 0 ;
}

////////////////////\\\\\\\\\\\\\\

void InitZeroCrossingDetect()

{
ext_int_edge(H_TO_L);
enable_interrupts(INT_ext);
}

//*******************ToggleInterruptEdge***********************
//Toggles interrupt edge so that interrupt are generated
// on both rising and falling zero-crossings on RB0/INT pin.
//***********************************************************

void ToggleInterruptEdge()

{
if (ext_edge == Falling)
ext_int_edge(L_TO_H);
else
ext_int_edge(H_TO_L);
ext_edge++;
}

///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\

void RotateTxData(int w)
{
count=w;
for (i=0;i<w;i++)
{
carry=bit_test(Txdata3,7);
#asm
rlf TxData0,f
rlf TxData1,f
rlf TxData2,f
rlf TxData3,f
#endasm
}
}

///////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

my receiver code is:
#include <receiver1.h>

//***************************************

#define PIN_Xin PIN_C3
#define Falling 1
#define Rising 0

//****************************************
//Global Variables
//****************************************

int1 X10TxFlag, X10RxFlag;
int1 RxBit,TxBit;
int1 TxCommandFlag=1,RxCommandFlag,SecondTxFlag;
int TXData3=0,TxData2=0,TxData1=0,TxData0=0;
int RxData3=0, RxData2=0, RxData1=0, RxData0=0;
int checkstart1=0,checkstart2=0;
int RxFunction=0,RxUnit=0,Rxkey1=0,Rxkey2=0,RxHouse2=0,RxHouse1=0;
int NumTxBit,count;
int w,w1,w2,w3,w4,w5;
int1 ext_edge=Falling,ZX;
int8 i=10,ZxCount,seconds;
int keys;
int1 j=0,k=0,X10AddressSent=0;
int RxHouse,xor,TxHouse,TxUnit,TxFunction;
int16 ADC_Average=0;
int8 ADC_Counter=0;

//****************************************

void InitX10Tx();
void RotateTxData(int w);
void ZeroCrossing();
void EndX10Envelope();
void InitZerocrossingDetect();
void ControlX10Units();
void ControlDevice();
void ToggleInterruptEdge();

//****************************************

#byte trisc=0x87
#bit Xout=trisc.2
#bit t0if=0xb.2
#bit intf=0xb.1
#byte status=0x3
#bit carry=status.0
#bit zerro=status.2

//***************************************
#int_EXT
EXT_isr()
{
/////// ReceiveX10Bit\\\\\\\\\
if(X10TxFlag==0){RxBit=0;}
RxBit=input(PIN_Xin);
if (RxBit==1)
{
output_low(PIN_A1);//turn on LED.
}


///////// X10Rx() \\\\\\\\\\

carry=RxBit;
#asm
rlf RxData0,f
rlf RxData1,f
rlf RxData2,f
rlf RxData3,f
#endasm
checkstart1=RxData3 & 0b00001111;
checkstart2=checkstart1 ^ 0b00001110;
if(checkstart2==0)
{
RxHouse2=RxHouse1;
Rxkey2=Rxkey1;
RxHouse1=RxData2;
Rxkey1=RxData1;
w1=RxHouse1^RxData2;
if(w1==0)
{
w2=Rxkey2^Rxkey1;
if(w2==0)
{
w3=RxData0 & 0b11000000;
w4=w3 ^ 0b01000000;
if(w4==0)
{
RxUnit=Rxkey2;
RxCommandFlag=0;
X10RxFlag=1;

}
else
{
w5=w3 ^ 0b10000000;
if(w5==0)
{
RxFunction=Rxkey2;
RxCommandFlag=1;
X10RxFlag=1;

}
}
}
}
}
/////////////\\\\\\\\\\\\\\\

ToggleInterruptEdge();
}


#int_TIMER0
TIMER0_isr()
{
EndX10Envelope();
}

//*************************

void main()

{ setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_1,15,1);
setup_ccp1(CCP_PWM);
set_pwm1_duty(32L);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
enable_interrupts(INT_EXT);//?????????????
enable_interrupts(INT_TIMER1);
enable_interrupts(INT_TIMER0);
enable_interrupts(GLOBAL);
InitX10Tx();
InitZerocrossingDetect();//ext_int_edge(H_TO_L);


//***************************

while(1)
{
if(X10RxFlag==1)
{ControlDevice();}

}

}

//***************************

void ControlDevice()
{
RxHouse= RxHouse2;
if(RxCommandFlag==1)
{
RxFunction=Rxkey2;
X10RxFlag=0;
xor=RxFunction ^ 0b01010110;
if(xor==0)
{output_low(PIN_A2);}
}
else
{
RxUnit=Rxkey2;
X10RxFlag=0;
}
}

//****************************

void ControlX10Units()
{
if(X10AddressSent==0) //has address been sent?
{
TxHouse=0b01101001; //no, then send address.
TxUnit=0b01101001;
TxCommandFlag=0; //clear the TxCommandFlag for sending address.
InitX10Tx();
X10AddressSent=1;
X10TxFlag=1; //Set the X10TxFlag to begin transmission.
}
else
{
TxHouse=0b01101001; //yes, then send command.
TxUnit=0b01010110;
InitX10Tx();
X10AddressSent=0;
X10TxFlag=1; //Set the X10TxFlag to begin transmission.
}
}

//*****************************

VOID InitX10Tx()

{
TxData3=0b00001110;
TxData2=TxHouse;
if(TxCommandFlag==1)

{
TxData1=TxFunction;
TxData0=0b10000000;
}

else
{
TxData1=TxUnit;
TxData0=0b01000000;
}
w=4;
RotateTxData(w);
NumTxBit=22;
SecondTxFlag=0;
X10TxFlag = 1;
}

//******************************

void InitZeroCrossingDetect()

{
ext_int_edge(H_TO_L);
enable_interrupts(INT_ext);//???????????????????????????
}

//******************************

void ToggleInterruptEdge()

{
if (ext_edge == Falling)
ext_int_edge(L_TO_H);
else
ext_int_edge(H_TO_L);
ext_edge++;
}

//*****************************

void RotateTxData(int w)
{
count=w;
for (i=0;i<w;i++)
{
carry=bit_test(Txdata3,7);
#asm
rlf TxData0,f
rlf TxData1,f
rlf TxData2,f
rlf TxData3,f
#endasm
}
}

//*****************************

void EndX10Envelope()

{
Xout=1; // disable 120khz output
disable_interrupts(INT_timer0);
}


////////////////////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

please guide me about the above mentioned early and point out me errors of this.
Best Regards.
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