sahu
Member
Why this is not working with 16f676 ? this code work 16f684 , that's i check on Proteus
for 16f676 as
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();
}
}
}
Memory Summary for 16f676#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
for 16f684Program space used 359h ( 857) of 400h words ( 83.7%)
Data space used 40h ( 64) of 40h bytes (100.0%)
EEPROM space used 0h ( 0) of 80h bytes ( 0.0%)
Configuration bits used 1h ( 1) of 1h word (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Memory Summary 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
Program space used 355h ( 853) of 800h words ( 41.7%)
Data space used 40h ( 64) of 80h bytes ( 50.0%)
EEPROM space used 0h ( 0) of 100h bytes ( 0.0%)
Configuration bits used 1h ( 1) of 1h word (100.0%)
ID Location space used 0h ( 0) of 4h bytes ( 0.0%)
Last edited: