View previous topic :: View next topic |
Author |
Message |
Anna
Joined: 29 Dec 2003 Posts: 4
|
Impossible to add code |
Posted: Sun Jun 06, 2004 12:46 am |
|
|
Hello to all,
I have next problem - I work with pic16c63, CCS compiler, after copilation of the program I see next parameters of RAM, ROM,Stack in *.lst file:
MPASM
CCS PCW C Compiler, Version 2.656, 3813
Filename: C:\PROJECTS\RDA-4_~1\1RDA-4~1\RDA4MAIN.LST
ROM used: 2044 (50%)
2044 (50%) including unused fragments
RAM used: 93 (48%) at main() level
113 (59%) worst case
Stack: 5 worst case (3 in main + 2 for interrupts)
If I add 2 line of code (for example, a = 0;) then all right, but if I add 3 same lines (a = 0) then I receive error - "Stack Overflow has occured" - I don't have time to exit from interrupts (RS232) and occur again interrupt plus interrupt.. - ERROR.
Not importance if this line of code execute in while(1) all time or execute rarely (if definite conditions executed).What happens? Why I can't add code?
Please help me..
Thank you very much _________________ Anna |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Jun 06, 2004 3:53 pm |
|
|
Quote: | CCS PCW C Compiler, Version 2.656, 3813
16C63 |
The 16C63 makes me wonder if you have a very old version
of the demo. You can download a newer version here:
http://www.ccsinfo.com/demo.shtml
It still only works with 2K max program size. |
|
|
Guest
|
|
Posted: Sun Jun 06, 2004 11:32 pm |
|
|
PCM programmer wrote: | Quote: | CCS PCW C Compiler, Version 2.656, 3813
16C63 |
The 16C63 makes me wonder if you have a very old version
of the demo. You can download a newer version here:
http://www.ccsinfo.com/demo.shtml
It still only works with 2K max program size. |
Thank you about answer.
This version of CCS is not demo version, but may be version of the copiler what I use has limits? Where I will read about this? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jun 07, 2004 1:03 am |
|
|
Quote: | I don't have time to exit from interrupts (RS232) and occur again interrupt plus interrupt |
Are you re-enabling global interrupts inside your int_rda function ?
Something like this:
#int_rda
void int_rda_isr(void)
{
char c;
c = getc();
enable_interrupts(GLOBAL); // <- DON'T DO THIS !!!!
}
If you're doing that, it's very bad. The CCS PCM compiler does not
support nested interrupts. You must not re-enable Global interrupts
when inside an interrupt function. |
|
|
Anna
Joined: 29 Dec 2003 Posts: 4
|
All problem fihished |
Posted: Mon Jun 07, 2004 5:56 am |
|
|
PCM programmer wrote: | Quote: | I don't have time to exit from interrupts (RS232) and occur again interrupt plus interrupt |
Are you re-enabling global interrupts inside your int_rda function ?
Something like this:
#int_rda
void int_rda_isr(void)
{
char c;
c = getc();
enable_interrupts(GLOBAL); // <- DON'T DO THIS !!!!
}
If you're doing that, it's very bad. The CCS PCM compiler does not
support nested interrupts. You must not re-enable Global interrupts
when inside an interrupt function. |
Thank you for answer, all problem go away after I used CCS Compiler v3.173 , I think problem was in compiler - old and limit size code. _________________ Anna |
|
|
|