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 support@ccsinfo.com

RAM/ROM 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: Mon Oct 10, 2005 9:20 pm     Reply with quote

Quote:
it will only run for a small part and then restart the PIC

Here are some tips:

Don't do anything weird.

1. Don't make large functions. Break them up into smaller ones.
2. Don't use "goto".
3. Don't use #asm code.
4. Don't use malloc.
5. Don't use #separate.
6. Don't use #org.
7. Don't use the Watchdog timer.
8. Don't use any special CCS function such as "goto_address()".
9. Don't try to exit from interrupt routines prematurely by
putting in some weird code.
10. Don't accidently write past the end of an array.
11. Don't try to use nested interrupts. i.e., Don't enable global
interrupts while still inside an interrupt routine.
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

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

PostPosted: Tue Oct 11, 2005 12:36 am     Reply with quote

@PCM programmer: Thanks for your tips, here are my reaction to them:
PCM programmer wrote:
1. Don't make large functions. Break them up into smaller ones.
I'm splitting p as much as possible, but if I insert a lot of small functions I still get the same problem.

PCM programmer wrote:
2. Don't use "goto".
3. Don't use #asm code.
4. Don't use malloc.
5. Don't use #separate.
6. Don't use #org.
7. Don't use the Watchdog timer.
8. Don't use any special CCS function such as "goto_address()".
9. Don't try to exit from interrupt routines prematurely by putting in some weird code.
10. Don't accidently write past the end of an array.
I don't.

PCM programmer wrote:
11. Don't try to use nested interrupts. i.e., Don't enable global interrupts while still inside an interrupt routine.
I only use 1 interrupt.

@Akira: which hardware/programmer do you use? I more and more get the feeling that it is a hardware problem.
I use the ClearView Mathias from TechTools
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 11, 2005 7:28 pm     Reply with quote

Quote:
I more and more get the feeling that it is a hardware problem.

It has been noted many times on here that the 16F877 "A" seems
flakier than the 16F877. Do you have 0.1 uF capacitors between
each Vdd pin and GND ? (and placed very close to the pins).

One test would be to replace the "A" chip with a "non A" chip.
See if it gets better.


Quote:
I use the ClearView Mathias from TechTools

Have you actually ever run this program on a PIC chip, or has
all your development and testing been entirely on the ICE ?
If so, maybe you've got ICE problems. I would test it on
a real PIC.
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

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

PostPosted: Wed Oct 12, 2005 12:58 am     Reply with quote

PCM programmer wrote:
It has been noted many times on here that the 16F877 "A" seems flakier than the 16F877. Do you have 0.1 uF capacitors between each Vdd pin and GND? (and placed very close to the pins).
They are in place.

PCM programmer wrote:
One test would be to replace the "A" chip with a "non A" chip. See if it gets better.
I'll do that asap!


PCM programmer wrote:
Quote:
I use the ClearView Mathias from TechTools
Have you actually ever run this program on a PIC chip, or has all your development and testing been entirely on the ICE? If so, maybe you've got ICE problems. I would test it on a real PIC.
I am waiting for a new hardware revision (coming end of this week) And then can switch to another programmer (ICD) to try and solve the problem. And if that doesn't work I'll program right on the PIC.
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

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

PostPosted: Wed Oct 12, 2005 1:13 am     Reply with quote

PCM programmer wrote:
One test would be to replace the "A" chip with a "non A" chip. See if it gets better.
No change, still it doesn't work...
Foppie



Joined: 16 Sep 2005
Posts: 138
Location: The Netherlands

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

PostPosted: Wed Oct 12, 2005 6:43 am     Reply with quote

Quote:
PCM programmer wrote:
Have you actually ever run this program on a PIC chip, or has all your development and testing been entirely on the ICE? If so, maybe you've got ICE problems. I would test it on a real PIC.
I am waiting for a new hardware revision (coming end of this week) And then can switch to another programmer (ICD) to try and solve the problem. And if that doesn't work I'll program right on the PIC.
It works!
Programming with a ICD-U solved all my problems. I got an unfinished prototype and if I compile all my code into it, it runs as it should do!

Many thanks!
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