TODOPIC
Microcontroladores PIC => Lenguaje C para microcontroladores PIC => Mensaje iniciado por: bee en 11 de Febrero de 2014, 02:07:36
-
Buenas, estoy comenzando con MPLAB IDE y Proteus, cuando compilo un proyecto sencillo como Encender un Led, Proteus me da el siguiente error:
"Proteus Cannot find source code at address 0x00000000"
"This may be because the CPU has no source window, or because it is executing library or
runtime code for which no debug
data is present"
He examinado el .hex y no comienza en 0x00000000, comienza en 0x0200, aqui esta una parte de el:
:020000040000fa
:080000000002040000000000f2
:020000040000fa
:100400000f8020000e7f22000e01880000000000f7
:100410000c000700602a20000100200011000700e6
:10042000000020000000e000020032000000020096
:100430000000000094020200000000000040da000a
:100440000000fe004440a900000020000000e00081
:100450000300320000002000a00188004440a800f2
:100460000000060091018800800078000000eb0089....
Y aqui una parte de la informacion compilacion:
Program Memory [Origin = 0x200, Length = 0xa9fa]
section address length (PC units) length (bytes) (dec)
------- ------- ----------------- --------------------
.text 0x200 0x94 0xde (222)
.text 0x294 0x12 0x1b (27)
.dinit 0x2a6 0x2 0x3 (3)
Total program memory used (bytes): 0xfc (252) <1%
Data Memory [Origin = 0x800, Length = 0x2000]
section address alignment gaps total length (dec)
------- ------- -------------- -------------------
Total data memory used (bytes): 0 (0)
Dynamic Memory Usage
region address maximum length (dec)
------ ------- ---------------------
heap 0 0 (0)
stack 0x800 0x2000 (8192)
Maximum dynamic memory (bytes): 0x2000 (8192)
¿Alguien tiene una idea para resolver este problema?
¿Hay alguna opcion de MPLAB IDE para compilar el hex a partir de 0x00000000?
De antemano gracias por sus repuestas.
-
revisa que archivo estas cargando en el micro del proteus, si estas cargando uno diferente a .hex necesitas indicarle al proteus el archivo con el código fuente (.asm, .c etc)
-
Examine un programa que funciona en proteus y tambien inicia desde 0x0200... que PIC y que compilador estas usando?
-
Examine un programa que funciona en proteus y tambien inicia desde 0x0200... que PIC y que compilador estas usando?
Hola Juan Pablo, el PIC24FJ64GA002 y MPLABC30 C Compiler. Se me ocurre que con una instruccion ORG o ORIGIN Puedo hace que el programa comience en 0x000 y no en 0x200. De todos modos aqui esta el codigo que estoy usando:
#include <p24FJ64GA002.h>
// ************************************************************************
// Configuration Bits
// ************************************************************************/
_CONFIG1 (JTAGEN_OFF & BKBUG_ON & ICS_PGx1 & FWDTEN_OFF)
// JTAG disabled
// Background debug on
// Communication Channel: PGC1/EMUC1 and PGD1/EMUD1
// Watchdog Timer disabled
_CONFIG2 (FNOSC_FRC)
// Select FRC Oscillator
// =============================================================
// int main (void)
// =============================================================
int main (void)
{
OSCTUN = 0; // Tune FRC oscillator, if FRC is used
RCONbits.SWDTEN = 0; // Disable Watch Dog Timer
// Make AN0 (RA0) as digital others as analog
AD1PCFG = 0b00000000000001;
TRISAbits.TRISA0 = 0; // Set RA0 as an output for LED
LATAbits.LATA0 = 1; // Turn on the LED
while(1); // Stay here for now
return (0);
}