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

24LC16B problem
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 28, 2007 11:36 am     Reply with quote

Try using a completely different PIC which is known to be reliable,
such as a 16F877. See if it works.
ralph79



Joined: 29 Aug 2007
Posts: 90

View user's profile Send private message

PostPosted: Sun Oct 28, 2007 12:34 pm     Reply with quote

Humm... I never thought on that...
I will try to use an 16F877 for an test.

Taking your post I've a simple question:
In my PCB board I've only space for an PIC with the same pin out of the 16F648A family (16F628A or 16F627A) and for the 16F688.
So the question is: Does PIC16F688 known as an reliable PIC? Or neither of them (16F648A and 16F688) are reliable?

Thanks,
Regards.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Oct 28, 2007 12:55 pm     Reply with quote

Try any PIC other than the 16F628A or 16F648A. Those chips
have a history of erratas. The current errata sheet is at rev. "M".
That means they have already published 12 earlier errata sheets
for those chips.

I think the best one to try is a 16F88. (not 688).
ralph79



Joined: 29 Aug 2007
Posts: 90

View user's profile Send private message

solution...
PostPosted: Mon Nov 05, 2007 7:15 am     Reply with quote

After digging, digging and digging for several days I've finally encountered the problem.
In the function where I read/write to the external EEPROM I have to made a disable to the timer1 interrupt function. The method of "enable_interrupts" or "disable_interrupts" simple didn't work. I have to enable/disable the timer interrupt using this:
Global:
Code:
int1 disable_timer = OFF;

Function of read/write EEPROM
Code:
void myfunction(void)
{
disable_timer = ON;
....
....
....
disable_timer = OFF;
}

Timer1 interrupt function
Code:

#int_TIMER1
void TIMER1_isr(void)
{
   if (disable_timer == OFF)
   {
          .......
          ......
        }
}


And with this it is all working fine... with the 16F648A.
Hope this could help.

Best regards
SET



Joined: 15 Nov 2005
Posts: 161
Location: Glasgow, UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Nov 08, 2007 2:03 pm     Reply with quote

Quote:
What is killing my head is if I change:
Code:

write_ext_eeprom(pos_eeprom++, (value + j));


to
Code:

write_eeprom(pos_eeprom++, (value + j));


and
Code:

read_ext_eeprom(pos_eeprom_aux++);


to
Code:

read_eeprom(pos_eeprom_aux++);


Because CCS disable interrupts as part of read_eeprom and write_eeprom library code.
Code:
disable_interrupts(GLOBAL)
should have worked for you external EEPROM code...
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 Previous  1, 2
Page 2 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