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 CCS Technical Support

what caused programming, ID, eeprom error
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

what caused programming, ID, eeprom error
PostPosted: Thu Jul 15, 2004 7:40 am     Reply with quote

I used 16f877a chip before, and right now I am using 12f675 on my Picflash programmer, I wrote a program adopted from Moritz http://www.ccsinfo.com/forum/viewtopic.php?t=19801&highlight=12f675
Code:

#include <12F675.h>
#device ADC=10
#fuses INTRC_IO,NOWDT,NOBROWNOUT,NOPROTECT,PUT,MCLR

#byte ADCON0 = 0x1F
#byte ANSEL = 0x9F
#byte CMCON = 0x19
#use delay(clock=4000000)

void main()
{
int16 Value=300; 

ADCON0 = 0; // ADC off
ANSEL = 0; // GPIO pins 0,1,2 and 4 set to all digital
CMCON = 7; // Comparators off   

//set_tris_a(0b00000111);//RA0, RA1, RA2 as Inputs RA3, RA4, RA5 as Outputs 

setup_adc_ports( AN0_ANALOG );
setup_adc(ADC_CLOCK_INTERNAL );
set_adc_channel(0); 
delay_ms(150);                     // Allow the channel to be aquired
 
output_high(pin_a5);
delay_ms (250);
output_low(pin_a5);
delay_ms(10);

while(1)
   {
Value=read_adc();
delay_ms(10);

   if (Value > 512)//If more than 50% Flash fast
      {
      output_high(pin_a4);
      delay_ms (250);
      output_low(pin_a4);
      delay_ms(250);
      }
   else //if (Value < 513) Flash slow
      {
      output_high(pin_a4);
      delay_ms (1500);
      output_low(pin_a4);
      delay_ms(1500);
      }
   }
}



I compiled successfully in ccs, but when I download the hex file to 12f675, program failed error occured, the following is the error msg.


program:1021 errors
eeprom: 128 errors
IDs: 4 errors

what happened, is there any configuration I need to setup?
Guest








PostPosted: Thu Jul 15, 2004 8:19 am     Reply with quote

when I configured all IDs as 0000, ID errors dispeared. how about others?
Guest








PostPosted: Thu Jul 15, 2004 8:24 am     Reply with quote

On the left bottom side of the PIC flash, there is a option configuration button, when I not check these items, certainly the program will pass, but the program is not work, nothing shown on my led, so, there should be some other problem, and I thnk I should check all these items, but how to solve the problem!
Guest








PostPosted: Thu Jul 15, 2004 8:29 am     Reply with quote

I even modified jusy as simple as
Code:

void main()
{
while(1)
   {
//Value=read_adc();
//delay_ms(10);

//   if (Value > 512)//If more than 50% Flash fast
//      {
      output_high(pin_a1);
      delay_ms (250);
      output_low(pin_a1);
      delay_ms(250);
      }
}
}
it is still not working!!

any suggestions?
Guest








PostPosted: Thu Jul 15, 2004 9:13 am     Reply with quote

when I download the hex file to my 16f877a, there is no error, and program is running well! help me please, what is the problem with 12f675? what is all these error about?
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

PostPosted: Thu Jul 15, 2004 9:34 am     Reply with quote

Anonymous wrote:
when I download the hex file to my 16f877a, there is no error, and program is running well! help me please, what is the problem with 12f675? what is all these error about?


once again, a reminder to READ THE DATABOOK.

the 16f877a and 12f675 are not the same architecture,
and can not use the same hex file.

jds-pic
Guest








PostPosted: Thu Jul 15, 2004 10:02 am     Reply with quote

Thank you:
I am not using the same hex file, when I program the 12f675, I changed setting and compiled them acordingly. can you tell me exactly which part might affect it, or more directly, which part should I pay more attention to read on the datasheet?
Guest








PostPosted: Thu Jul 15, 2004 2:26 pm     Reply with quote

Is 12f675 a 12 bit or 14 bit chip?
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

PostPosted: Thu Jul 15, 2004 2:31 pm     Reply with quote

Anonymous wrote:
which part should I pay more attention to read on the datasheet?
<and then>
Is 12f675 a 12 bit or 14 bit chip?


i think you answered your own question.

jds-pic
Guest








PostPosted: Thu Jul 15, 2004 2:39 pm     Reply with quote

I thought it is 12 bits, but some guys in this group said it is 14bits? I got confused. It is 12 bits right?
Ttelmah
Guest







PostPosted: Thu Jul 15, 2004 2:52 pm     Reply with quote

Anonymous wrote:
I thought it is 12 bits, but some guys in this group said it is 14bits? I got confused. It is 12 bits right?

It is an 'oddity'. Normally, the '12' chips use a 12bit core, however there ae a couple of chips (the 12F675, and 629), which use 14bit code, despite having a '12' number. hence they use the 'PCM' compiler.
Why Microchip elected to put it into their '12' range, is strange, given this difference...

Best Wishes
Guest








PostPosted: Thu Jul 15, 2004 2:58 pm     Reply with quote

Thank you:
So what is OSSCAL, and how to set up them, also the ID locations.
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

PostPosted: Fri Jul 16, 2004 7:39 am     Reply with quote

are there anyone can help me out of these error problem? I kind of got frustrate about it, but Still looking for start light shining somewhere?
[code]
#if defined(__PCM__)
#include <12F675.h>
#device ADC=10
#fuses INTRC_IO,NOWDT,NOPROTECT


#byte ADCON0 = 0x1F
#byte ANSEL = 0x9F
#byte CMCON = 0x19
#use delay(clock=20000000)

void main()
{
int16 Value=300;

ADCON0 = 0; // ADC off
ANSEL = 0; // GPIO pins 0,1,2 and 4 set to all digital
CMCON = 7; // Comparators off

//set_tris_a(0b00000111);//RA0, RA1, RA2 as Inputs RA3, RA4, RA5 as Outputs

setup_adc_ports(AN0_ANALOG );
setup_adc(ADC_CLOCK_INTERNAL );
set_adc_channel(0);
delay_ms(150); // Allow the channel to be aquired

output_high(pin_a5);
delay_ms (250);
output_low(pin_a5);
delay_ms(10);

while(1)
{
int32 i;
Value=read_adc();
delay_ms(10);

if (Value > 512)//If more than 50% Flash fast
{
output_high(pin_a1);
delay_ms(250);

output_low(pin_a1);

delay_ms(250);
}
else //if (Value < 513) Flash slow
{
output_high(pin_a4);
delay_ms (1500);
output_low(pin_a4);
delay_ms(1500);
}
}
}

[\code]

Thank you?
young



Joined: 24 Jun 2004
Posts: 285

View user's profile Send private message

PostPosted: Fri Jul 16, 2004 8:14 am     Reply with quote

anyone use the PICflash to write hex to PICeasy2 board? I have no problem with the 16f877a big board, but have these errors write to 12f675 small board, are there any setting change required? I connected the board using usb port.
Guest








PostPosted: Fri Jul 16, 2004 10:30 am     Reply with quote

[img]
This is the error image, would any one help me please

Please!

[/img]

[/url]
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
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