Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while compiling using pinguino with pic18f27j53 with analog input
24-06-2015, 09:40 PM, (This post was last modified: 24-06-2015, 10:19 PM by elmagopy.)
#1
Exclamation  Error while compiling using pinguino with pic18f27j53 with analog input
this is the error, i am using AnalogInput.pde example file, i hope someone can guide me to solve the error, PD: it will compile for pic 18f26j50


/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:701 setting interrupt vector addresses 0xc00
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:92: error 20: Undefined identifier 'ADCON2'
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:254: error 20: Undefined identifier 'CCP4'
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:254: error 62: 'case' expression not constant. Statement ignored
Caught signal 11: SIGSEGV
Processor: 18f27j53
sdcc: Calling preprocessor...
sdcc: Generating code...

Tank you, and best reggards for everyone.-
Reply
24-06-2015, 10:29 PM,
#2
RE: Error while compiling using pinguino with pic18f27j53
(24-06-2015, 09:40 PM)elmagopy Wrote: this is the error, i hope someone can guide me to solve the error, PD: it will compile for pic 18f26j50


/dvpt/pinguino/git-copy/pinguino-compilers/sources/sdcc/src/pic16/main.c:701 setting interrupt vector addresses 0xc00
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:92: error 20: Undefined identifier 'ADCON2'
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:254: error 20: Undefined identifier 'CCP4'
/usr/share/pinguino-11/p8/include/pinguino/core/analog.c:254: error 62: 'case' expression not constant. Statement ignored
Caught signal 11: SIGSEGV
Processor: 18f27j53
sdcc: Calling preprocessor...
sdcc: Generating code...

Tank you, and best reggards for everyone.-

You want to compile for a 18f26j50 but according your above listing I read  Processor: 18f27j53.
You should select the good one 18f26j50 in the processor list ( see the setting menu ) ?
Bye
Reply
25-06-2015, 03:13 PM, (This post was last modified: 26-06-2015, 03:42 PM by elmagopy.)
#3
RE: Error while compiling using pinguino with pic18f27j53 with analog input
i have both chips,using the correct setting in both. but, it work when i use the 26j50 selecting the right setting, but whe i try to make it work with the 27j53 selecting the corresponding chip in the menu, it won´t compile.

anyway, i manage to make it work, modifing the analog.c file from pinguino and voila. the cons, i broke the analog write feature.-

Tank you very much, and best reggards.-
Reply
26-06-2015, 11:40 PM,
#4
RE: Error while compiling using pinguino with pic18f27j53 with analog input
Please share your modification or do you want to keep it only for you ?
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
23-11-2015, 02:16 PM,
#5
RE: Error while compiling using pinguino with pic18f27j53 with analog input
Sorry for the long time away, the code i modified, let me compile, but in further testing, i realize that it did not work. So, i will keep trying to solve it, i will let you know, if it works, and publish the modifications.
Thank you, and good will.
Reply
22-12-2015, 02:22 AM,
#6
RE: Error while compiling using pinguino with pic18f27j53 with analog input
(26-06-2015, 11:40 PM)regis Wrote: Please share your modification or do you want to keep it only for you ?

First, thank you for the great product.

I recently have a chance to use PIC18F27J53 and encountered this issue and fixed it in the following way.

1) according to spec sheets,  27J53 has CCP4 to CCP10 (same as 47J53), but not in 26J50 (so the following wouldn't be an ideal fix).

pinguino-libraries/p8/include/pinguino/core/pin.h

/**********************************************************************/
    #elif defined(PINGUINO26J50) || defined(PINGUINO27J53)

/**********************************************************************/

        #define RTCC        1
        #define CCP1        10  // cf. io.c
        #define CCP2        11
        #define LED1        12
        #define USERLED     12
        
        #define CCP4        4  // RB4
        #define CCP5        5  // RB5
        #define CCP6        6  // RB6
        #define CCP7        7  // RB7
        #define CCP8        17 // RC1
        #define CCP9        22 // RC6
        #define CCP10       23 // RC7
        
    #endif

2a) since 27J53 doesn't have ADCON2 (same as 47J53), rerouting to 47J53 configuration would work.

pinguino-libraries/p8/include/pinguino/core/analog.c

Line 58: #elif defined(PINGUINO27J53) || defined(PINGUINO47J53)
Line 59: // RB 09/09/2013: Analog Conversion Mode is set to 12-bit in Bootloader Config file
Line 60: // #pragma config ADCSEL = BIT12 // 12-bit conversion mode is enabled

2b) 27J53 doesn't have TRISE (or PORTE), in analogread(), I copied 47J53 codes except TRISE setting.

pinguino-libraries/p8/include/pinguino/core/analog.c

inserted at Line 170:

    #elif defined(PINGUINO27J53)


        if (channel > 15)
            return 0;

        if (channel >= 8 && channel <= 15)
            channel = channel - 8;      // A0=8 to A7=15

        if (channel < 5)
            TRISA |= 1 << channel;      // channel as INPUT

//        if (channel >= 5 && channel <= 7)
//            TRISE |= 1 << (channel - 5);// channel as INPUT

        ANCON0 |= 1 << channel;         // channel enabled

        ADCON0 = channel << 2;          // A0=0 to A7=7


I think these were all modification I made for 27J53 analog input. I only tested wit 27J53, and it seems working fine.

-- yoc
Reply
22-12-2015, 09:56 AM,
#7
RE: Error while compiling using pinguino with pic18f27j53 with analog input
Thank you very much. I will fix it in the next release.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)