View previous topic :: View next topic |
Author |
Message |
a.mattioli
Joined: 19 Jun 2007 Posts: 4
|
MPLAB: over 150 lines, it crashed |
Posted: Mon Jun 25, 2007 10:10 am |
|
|
I use MPLAB IDE 7.52 with PCWH 4.042. The device is PIC16F877.
My program restart itself when I add new lines of code (apparently) without a logic reason. In fact, I comment some istruction and the program work normally but if I not comment these istruction but other the program continue to work. Then, when I write 150 lines of the code the program crashed.
I would know why happened this problem.
I use for the programmer and debugger ICD2 but this is setting automatically and when I have set manually it not change.
My configuration bits and library are:
#include <16F877.h> //RAM = 368 byte
#device adc=8
#device ICD=TRUE
#FUSES WDT //Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, stream=, bits=8)
#include <stdio.h>
When I compile its: MPLAB Output -->
Memory usage: ROM=25% RAM=36% - 44%
Perhaps, I must set some options into MPLAB?
Please, help me |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Mon Jun 25, 2007 10:22 am |
|
|
1) What do you suppose we can do with the info you give us ?
2) If you believe that it is an MPLAB related problem, did you ask this in the MPLAB forum ?
Humberto |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Jun 25, 2007 11:20 am |
|
|
Which program crashes ?
Is it:
1. MPLAB crashes, during compilation with CCS.
2. CCS compiler crashes, during compilation in MPLAB.
3. MPLAB simulator crashes while simulating the compiled CCS program.
4. Your program crashes while running in an actual PIC. |
|
|
a.mattioli
Joined: 19 Jun 2007 Posts: 4
|
my program crashes while running in an actual PIC |
Posted: Tue Jun 26, 2007 2:05 am |
|
|
PCM programmer:
my program crashes while running in an actual PIC: its reboot continually |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Jun 26, 2007 2:15 am |
|
|
You have the watchdog enabled. Does the program still crash when you disable the watchdog? |
|
|
a.mattioli
Joined: 19 Jun 2007 Posts: 4
|
RTOS with serial comunication |
Posted: Tue Jun 26, 2007 9:33 am |
|
|
I have disabled Watch DogTimer, but I don't resolve the problem. Then I think that the problem is the serial comunication.
I use RTOS with:
#use rtos(timer=1,minor_cycle= 5 ms)
#task(rate= 5 ms,max= 5 ms) //first and only task
Into this task I send to RS232 many string and I control also the input and output signal:
printf("Hello World!");
I have prove to stand up the time_ticks but not change.
Where is the problem?
Thank you |
|
|
|