Why this is not working ?

Status
Not open for further replies.

sahu

Member
Why this is not working with 16f676 ? this code work 16f684 , that's i check on Proteus
Code:
/*
* Programmer: Shivendra Kr. Sahu
  * Target PIC: PIC16F676 or PIC16F684
* use like this FOR 70 VM
  --www-- -----ADC
*  5*4.7k  |
  >
  >1.8k
  |
*/
#include <htc.h>
//#include<pic16f676.h>
//__CONFIG (FOSC_INTRCIO & MCLRE_ON & BOREN_ON & CP_ON & CPD_OFF & WDTE_OFF & PWRTE_OFF );// For 16F676 - comment for 16F684
#include<pic16f684.h>
__CONFIG (FOSC_INTOSCIO & MCLRE_ON & BOREN_ON & CP_ON & CPD_OFF & WDTE_OFF & PWRTE_OFF );// For 16F684 - comment for 16F676
#define _XTAL_FREQ 4000000

void main(void) {
  char samplecounter;
  initialize();
  while (1){
  voltage = getVoltage();
  for (samplecounter = 0; samplecounter < 80; samplecounter++){
  displayVoltage();
  }
  }
}
for 16f676 as
#include<pic16f676.h>
__CONFIG (FOSC_INTRCIO & MCLRE_ON & BOREN_ON & CP_ON & CPD_OFF & WDTE_OFF & PWRTE_OFF );// For 16F676 - comment for 16F684
CMCON = 7; // For 16F676 - comment for 16F684
Memory Summary for 16f676
for 16f684
#include<pic16f684.h>
__CONFIG (FOSC_INTOSCIO & MCLRE_ON & BOREN_ON & CP_ON & CPD_OFF & WDTE_OFF & PWRTE_OFF );// For 16F684 - comment for 16F676
CMCON0 = 7; // For 16F684 - comment for 16F676
Memory Summary 16f684
 
Last edited:
Self explanitory....

Data Space used.... 40bytes.... pic16f767 no more.... However in PRO mode it does compile and run on both!!
 
its means when Data space reached up to 100.0% ,then mcu can't run .
No!.... I have compiled it and it runs just fine.... BUT!!! I use XC8 pro not lite.... It won't compile in lite mode...
 
show the circuit in Proteus.... Have you pulled MCLR High???
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…