Hi,
    I'm an old SDCC fan and now I'm working on a project that uses the 
pic18f66f15. I followed the steps to include support for it, and it 
seems that everything worked fine but the pic18f66j15.h file doesn't 
include the __CONFIG directives, so I chequed the p18f66j15.inc and it 
says :


;==========================================================================
;
;   IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
;              superseded by the CONFIG directive.  The following settings
;              are available for this device.
;
;   Background Debugger Enable bit:
;     DEBUG = ON           Background debugger enabled; RB6 and RB7 are 
dedicated to In-Circuit Debug
;     DEBUG = OFF          Background debugger disabled; RB6 and RB7 
configured as general purpose I/O pins
;
;   Extended Instruction Set Enable bit:
;     XINST = OFF          Instruction set extension and Indexed 
Addressing mode disabled (Legacy mode)
...
...


I've tried to use the CONFIG directive without success because I think 
it's an ASM directive.  I've tried to manually set the config words but 
they don't appear in the hex file, an example program is:

#include <pic18f66j15.h>
#include <delay.h>
#include "gato.h"        // pin name macros


#pragma stack 0x200 0x100


// Set the __CONFIG words:


__code char __at 0x300000 _conf1 = 0xA7;    //    101000001 01011 1110 
wtdg -  debug off - xinstr off
__code char __at 0x300001 _conf2 = 0x00;    // no code protection
__code char __at 0x300002 _conf3 = 0x06;    // EC - IESO = off - FCMEM = 
off
__code char __at 0x300003 _conf4 = 0x0D;    // wtdg 1:8192
__code char __at 0x300004 _conf5 = 0x30;    // microcontroller mode
__code char __at 0x300005 _conf6 = 0x00;    // microcontroller mode


void main() {
     setup_ports();

     LED_ANT1=1;
     LED_ANT2=1;
     LED_ANT3=1;
     LED_ANT4=1;

     LED_SIM_OK=1;
     LED_RING=1;
     LED_ACCION=1;

     CTRL_RELE1=1;
     CTRL_RELE2=1;

     delay100ktcy(150);


     LED_ANT1=0;
     LED_ANT2=0;
     LED_ANT3=0;
     LED_ANT4=0;

     LED_SIM_OK=0;
     LED_RING=0;
     LED_ACCION=0;

     CTRL_RELE1=0;
     CTRL_RELE2=0;



     while(1){

         LED_ACCION=1;
         delay100ktcy(50);

         LED_ACCION=0;
         delay100ktcy(50);

     }
}


void setup_ports(){

     TRISA=0x0C;
     TRISB=0x0F;
     TRISC=0x90;
     TRISD=0x00;
     TRISE=0x00;
     TRISF=0x40;
     TRISG=0x04;

     // Setup puertas analogas
     ADCON0bits.ADON=0;
     // todas las puertas como analogas
     ADCON1bits.PCFG0=1;
     ADCON1bits.PCFG1=1;
     ADCON1bits.PCFG2=1;
     ADCON1bits.PCFG3=1;




     PORTA=0;
     PORTB=0x00;
     PORTC=0;
     PORTD=0;
     PORTE=0;
     PORTF=0;
     PORTG=0;

     INTCON2bits.RBPU=1;        // deshabilito los weak pullups del 
puerto b
     PORTGbits.RDPU=0;
     PORTGbits.REPU=0;



}

The hex generaded

:020000040000FA
:10000000E806E56E630E19EC00F0630E2CEC00F0D0
:10001000E4500EE000D0E56E630E19EC00F0630EC4
:100020002CEC00F000D000D00000E450E82EF3D714
:100030001200E806E56E630E2CEC00F0E4500BE0D5
:1000400000D0E56E630E2CEC00F000D000D0000074
:10005000E450E82EF6D71200E8060000E85007E06A
:1000600000D000D000D000D00000E82EFAD7120057
:1000700059EC00F083808382838483868388838A1B
:10008000838C82808282960E00EC00F083908392B3
:10009000839483968398839A839C82908292838CA4
:1000A000320E00EC00F0839C320E00EC00F0F7D72B
:1000B00012000C0E926E0F0E936E900E946E956A57
:1000C000966A400E976E040E986EC290C180C182EF
:1000D000C184C186806A816A826A836A846A856A09
:0A00E000866AF18E869E869C12004F
:020000040001F9
:067FF800FFFFFFFFFFFF89
:00000001FF

As you can see in the last 3 lines, config info is always 0xFF and is 
not located after 0x300000. If I overwrite the config info in the 
programmer, I can make code run.

¿ Any advice ?


Thanks in advance

Olgierd

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to