Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] cgpic.exe has stopped working

Status
Not open for further replies.

h.sharma

Junior Member level 3
Joined
Jun 16, 2012
Messages
30
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,455
I am working on interfacing of tsop 1738 remote control receiver with pic16f877a
here is code using interrupts, problem is that when i compile in MPLAb ide this it shows cgpic.exe has stopped working

Code:
#include<htc.h>
#define _XTAL_FREQ 4000000
unsigned char buf,flag;




main()
{
__delay_ms(100);
PORTB=0;
TRISB=1;        //set RB0 as i/p and all other portb bits as o/p
GIE=1;            //global interrupt enable
INTE=1;         //external interrupt enable
INTEDG=0;   //interrupt edge selection
while(1)
    {
    flag=0;
    if(buf==1){RB1=~RB1;__delay_ms(100);}
    else if(buf==3){RB2=~RB2;__delay_ms(100);}
    else if(buf==13){RB3=~RB3;__delay_ms(100);}
    else if(buf==12){RB4=~RB4;__delay_ms(100);}
    else if(buf==32){RB5=~RB5;__delay_ms(100);}
    else if(buf==33){RB6=~RB6;__delay_ms(100);}
    else if(buf==4){RB7=~RB7;__delay_ms(100);}
    else if(buf==7){RA0=~RA0;__delay_ms(100);}
    else if(buf==6){RA1=~RA1;__delay_ms(100);}
    else if(buf==9){RA2=~RA2;__delay_ms(100);}
    flag=0;
    while(flag==0);
    }
}

void interrupt external(void) //ISR
{
INTF=0;
if(RB0==0)
{
__delay_us(100) ;
if(RB0==0)
    {
    __delay_us(100);
    if(RB0==0)
        {
        __delay_us(889);
        if(RB0==1)
            {
            __delay_us(889);
            if(RB0==0)
                {
                __delay_ms(10.632);
                buf=0;
                for(int a=0;a<6;a++)
                    {
                    buf<<=1;
                    if(RB0==1)
                        {
                        buf++;
                        }
                    __delay_ms(1.778);
                    }
               
                buf&=0b00111111; //filtering the 6 command bits
                flag=1;
RA3=1;__delay_ms(30);RA3=0; //indicator LED
                }
            }
        }
    }
}

}


please tell me what problem is exactly, it is a prob. with code or software?
 

What version of the Hi-Tech C Compiler are you currently using?

More than likely it is a software revision issue.

It may require a patch.

Otherwise, you may want to consider upgrading to the latest version which is the route I recommend.

BigDog
 
Last edited:

What version of the Hi-Tech C Compiler are you currently using?

More than likely it is a software revision issue.

It may require a patch, for example v9.70:

HCPIC-pro-9.70PL1.5971.exe

Otherwise, you may want to consider upgrading to the latest version.

BigDog

the link is not working
plz provide other link
 

Hi-Tech has obviously withdrawn the patch.

Why not update to the latest version, v9.83?

**broken link removed**



BigDog
 

thanx bigdogguru for ur help
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top