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] PIC 16F628A suddenly stopped working

Status
Not open for further replies.

Mrunal Ahirrao

Full Member level 2
Joined
Nov 26, 2012
Messages
133
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
India
Activity points
2,213
hi,
I have programmed PIC16f628A and was working well according to code,but when was testing I/O conditions suddenly Chip stopped working and the LED on Power Supply got DIM! that chip is now of no use.So how to find a perfect solution on this? I have lost nearly 3 chips in this! Is problem in Hardware? or software? If new chip inserted in that hardware and if we want to change the program again, then that chip becomes unknown when entered in programmer8-O! any help would be appreciated. Thank you.
 

I think your problem is in h/w. If software problem it may high light by compiler. If logical problem then IC never damage. I think some issue in 16f628 I also face similar type program so I never use after that. U may check h/w then use any other controller if possible.
 

Can you post the schematic and specify the programmer you used? I agree with Golden , it's a hardware problem.
 

It might be an electrostatic discharge , tie the ground first , I use PIC16F628A and never had such problems except bad hardware design and electrostatic discharges
 

@mdorian: so if it electrostatic discharge so how to take care of it? I have given ground to it. And programmer I am using is JDM programmer with winpic 800. But I tried to use once again and it worked and also working but after that it was never detected on programmer
 

Something is wrong in you program I think. Did you mange to protect you IO by activating Pull up resistors ?
 

I was thinking you use an ICSP programmer. To avoid electrostatic discharge first touch the programmer ground with one hand and then insert the chip. JDM programmer has no common ground for circuit and PC so better don't use-it as ICSP!
 

@advares: yes I have used pullup resistors.

- - - Updated - - -

@mdorian: Thanks. I will post PCB design of system them please guide me if any Hardware fault.
 

It could also be a software failure. If for example a division by zero your pic 'hangs'
 

It could also be a software failure. If for example a division by zero your pic 'hangs'

Maybe. but there is no such code which would fail PIC. I 'll post code also now...

- - - Updated - - -

Code:
/*

Processor-PIC16f628A   Clock-4MHz

 Motors=5

*/
sbit ILED at RA1_bit;
sbit IW at RA2_bit;  
sbit OverB at RA3_bit;
sbit OverS at RA4_bit;
sbit ILowS at RA5_bit;
sbit ILowB at RB0_bit;
sbit OLow  at RB1_bit;
sbit OHigh at RB2_bit;
sbit IMB1 at RB3_bit;
sbit IMB2 at RB4_bit;
sbit IMS  at RB5_bit;
sbit BM  at RB6_bit;
sbit SM  at RB7_bit;



unsigned short counter;



void interrupt()
{
if(INTCON.T0IF){

counter++;

if(counter==18)
{
if(IW==1)
{
ILED=1;
IMB1=1;
IMB2=1;
IMS=1;
}
else if(IW==0)
{
ILED=0;
IMB1=0;
IMB2=0;
IMS=0;
}
counter=0;
}
}
INTCON.T0IF=0;
}

void main()
{
   CMCON = 0x07;   // To turn off comparators
   TRISA = 0b00111100;
   TRISB = 0b00000111;
   OPTION_REG=0x87;
   INTCON=0b10100000;
do{
if(OverB==1)
{
IMB1=0;
IMB2=0;
}
if(OverS==1)
{
IMS=0;
}
if(ILowS==0)SM=0;
if(ILowB==0)BM=0;
  if(OLow==1)
  {
  if(ILowS==1)
  {
  SM=1;
  }

 if(ILowB==1)
 {
 BM=1;
 }
 }

  if(OHigh==1)
  {
  BM=0;
  SM=0;
  }
}while(1);
}

Compiler used is MikroC pro for PIC

I am uploading Schematic and PCB design


- - - Updated - - -

pic kit 2 & 3

No I have completed complex projects using JDM!
 

Attachments

  • mainPCB.zip
    13.1 KB · Views: 74
  • mainSchematic.zip
    10.2 KB · Views: 77
Last edited:

The only thing wrong I see in your schematic is the 9 pin of uln2003a must be left unconnected or better tied to relays power supply to suppress transient voltages not to ground. Check the sensors outputs , maybe one of them has a higher output voltage than VDD, check all the voltages on all pins (without inserting PIC ) a damaged ULN2003 might do that. The programmer works well in other PIC16F628A project? You cannot use PICkit 2/3 for PIC16F628A debugging , a JDM programmer is enough.
 
Last edited:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top