| View previous topic :: View next topic |
| Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Oct 28, 2007 11:36 am |
|
|
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
|
|
Posted: Sun Oct 28, 2007 12:34 pm |
|
|
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
|
|
Posted: Sun Oct 28, 2007 12:55 pm |
|
|
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
|
| solution... |
Posted: Mon Nov 05, 2007 7:15 am |
|
|
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
|
|
Posted: Thu Nov 08, 2007 2:03 pm |
|
|
| 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... |
|
 |
|