Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 24, 2020, 01:05:43 01:05


Login with username, password and session length


Pages: 1 ... 3 4 5 6 7 8 9 [10] 11
Print
Author Topic: XC8 Compilers - Discussion  (Read 166118 times)
0 Members and 2 Guests are viewing this topic.
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2338

Thank You
-Given: 765
-Receive: 615


Top Topic Starter


« Reply #225 on: May 30, 2020, 09:54:42 21:54 »

I don't remember much details since 2014, but you are expert enough not to tell you that I had to change pins to match the MCU for which I am compiling at least, and make sure other MCU specific registers/interrupts are correctly configured as well.
Logged
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 726

Thank You
-Given: 165
-Receive: 1212



« Reply #226 on: May 30, 2020, 10:24:27 22:24 »

I don't remember much details since 2014, but you are expert enough not to tell you that I had to change pins to match the MCU for which I am compiling at least, and make sure other MCU specific registers/interrupts are correctly configured as well.

Yes of course. As i said i tried a demo from MLA for PICDEM USB board without touching the code (the mouse sample). i didn't change the MCU just in case i missed with some configuration. Everything is correct. That's why i'm confused and that's why i need to know where is the problem. is it the USB stack or proteus.

i hope i can try my code on real hardware when i come back to my lab after 4 days
Logged
ron
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 10
-Receive: 2


« Reply #227 on: June 10, 2020, 04:31:36 16:31 »

I have been creating my own patcher for Catalina, it has been tested against XC32 v2.40, XC8 v2.20 and works. I will package and do a release in the next few days. 'pickit2' where or how do I get this live?

Looking forward to your release. On Win7 X64 installed with free pro licence 60 days. Does it matter what option you pick at the end of the install ?.
Also most of the links on the original medicine link do not work.
http://www.sonsivri.to/forum/index.php?topic=44014.25
I got one exe file but when I try to run it says not a valid win32 app.
« Last Edit: June 10, 2020, 04:48:55 16:48 by ron » Logged
Sideshow Bob
Cracking Team
Hero Member
****
Offline Offline

Posts: 729

Thank You
-Given: 207
-Receive: 715



« Reply #228 on: June 10, 2020, 05:21:36 17:21 »

I have pointed you to the newest post regarding this matter in a post today. Read the readme.txt and do as you have been told. It should work. The links work I have checked
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
ron
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 10
-Receive: 2


« Reply #229 on: June 11, 2020, 09:02:13 09:02 »

UPDATE:
I got it working. Just followed the instructions posted by pickit2. Ver 2.20 Win 7(64).
Just run it from C:\Program Files\Microchip\xc8\v2.20> as admin. And copy it to all the locations mentioned i.e. avr/pic etc.

You guys rock.
Now to see if this does a better job than my old High Tech C 9.83

================Stuff ===========================
C:\Program Files\Microchip\xc8\v2.20\bin>xc8 --chip=16f1516 --opt=s
C:\Program Files\Microchip\xc8\v2.20\pic\bin\picc --chip=16f1516 --opt=s
(2057) The XC8 compiler installation appears to be corrupted. Please reinstall
nd try again
(908) exit status = 1

Will keep trying will keep reading. But got this far.

C:\Program Files\Microchip\xc8\v2.20\bin>dir
 Volume in drive C is Windows7_OS
 Volume Serial Number is 7AFD-80CE

 Directory of C:\Program Files\Microchip\xc8\v2.20\bin

06/11/2020  01:44 PM    <DIR>          .
06/11/2020  01:44 PM    <DIR>          ..
04/09/2020  06:58 AM           722,832 avr-objcopy.exe
04/09/2020  06:38 AM            48,376 deviceSupport.xml
04/09/2020  06:46 AM               259 roam.lic
04/09/2020  06:58 AM         1,080,984 xc-ccov.exe
04/09/2020  06:58 AM           313,744 xc8-ar.exe
04/09/2020  06:58 AM           375,696 xc8-cc.exe
04/09/2020  06:58 AM           311,184 xc8.exe
06/20/2014  02:28 AM            26,624 xclm.exe
04/09/2020  06:46 AM         2,592,320 xclm.old
               9 File(s)      5,472,019 bytes
               2 Dir(s)   5,852,426,240 bytes free

C:\Program Files\Microchip\xc8\v2.20\bin>xclm -scan
Unknown option

C:\Program Files\Microchip\xc8\v2.20\bin>
« Last Edit: June 11, 2020, 10:11:51 10:11 by ron » Logged
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2338

Thank You
-Given: 765
-Receive: 615


Top Topic Starter


« Reply #230 on: August 25, 2020, 10:56:14 10:56 »

When using mmc, where am I supposed to write the routine for ADC interrupt, for example?

I am looking at the generated code, in the interrupt_manager.c:

Code:
void __interrupt() INTERRUPT_InterruptManager (void)
{
    // interrupt handler
    if(INTCONbits.PEIE == 1)
    {
        if(PIE1bits.ADIE == 1 && PIR1bits.ADIF == 1)
        {
            ADC_ISR();
        }
        else
        {
            //Unhandled Interrupt
        }
    }     
    else
    {
        //Unhandled Interrupt
    }
}

Now it calls ADC_ISR() which in turn calls ADC_interruptHandler(), the declaration for this function is void (*ADC_InterruptHandler)(void)

Where am I supposed to write the definition of this function? I need a quick example to get me started.



Posted on: August 25, 2020, 12:18:11 12:18 - Automerged

seems I found the answer: https://microchipdeveloper.com/mcc:interrupts
Logged
Manuel
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 303
-Receive: 107


« Reply #231 on: August 25, 2020, 03:02:49 15:02 »

void (*ADC_InterruptHandler)(void)

ADC_InterruptHandler is a pointer to a function which returns void and takes a void as an argument.

can help:

#include <stdio.h>
// A normal function with an int parameter
// and void return type
void fun(int a)
{
    printf("Value of a is %d\n", a);
}
 
int main()
{
    // fun_ptr is a pointer to function fun() 
    void (*fun_ptr)(int) = &fun;
 
    /* The above line is equivalent of following two
       void (*fun_ptr)(int);
       fun_ptr = &fun; 
    */
 
    // Invoking fun() using fun_ptr
    (*fun_ptr)(10);
 
    return 0;
}


take care
X!
Logged

-> An Apple a Day does not Let U become a Macintosh!
odessa
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 92
-Receive: 15


« Reply #232 on: September 01, 2020, 10:03:00 22:03 »

Hi,

Easiest way for me is:

In your code create the function you want to use for interrupt, say:

void myAdcInt(void){

}

Then in your main add your function to the void pointer

ADC_SetInterruptHandler(myAdcInt);

The interrupt will now be directed to your routine
Logged
Catcatcat
Active Member
***
Offline Offline

Posts: 242

Thank You
-Given: 145
-Receive: 713



WWW
« Reply #233 on: September 05, 2020, 01:16:52 13:16 »

When using mmc, where am I supposed to write the routine for ADC interrupt, for example?

I am looking at the generated code, in the interrupt_manager.c:

Code:
void __interrupt() INTERRUPT_InterruptManager (void)
{
    // interrupt handler
    if(INTCONbits.PEIE == 1)
    {
        if(PIE1bits.ADIE == 1 && PIR1bits.ADIF == 1)
        {
            ADC_ISR();
        }
        else
        {
            //Unhandled Interrupt
        }
    }     
    else
    {
        //Unhandled Interrupt
    }
}

Now it calls ADC_ISR() which in turn calls ADC_interruptHandler(), the declaration for this function is void (*ADC_InterruptHandler)(void)

Where am I supposed to write the definition of this function? I need a quick example to get me started.



Posted on: August 25, 2020, 12:18:11 12:18 - Automerged

seems I found the answer: https://microchipdeveloper.com/mcc:interrupts


These are called callback functions.
1. You need to create your own function, which should perform data processing at your request, for example:
Code:
void ADSirc (void)// ADC processing
{
    int16_t audio_data; // audio data
    /* Return the result
    audio_data = ADCC_GetConversionResult();*/
//*************************
    // Start the conversion
    // ADCC_StartConversion(Audio);
    ADCON0bits.ADGO = 1;
}//-----------------------------------------------------------------------------

2. Then you need to tell the compiler how to use it when the ADC is interrupting.

Code:
void main (void)
{
    // Initialize the device
    SYSTEM_Initialize ();
     ClrWdt (); // reset watchdog timer
     //--------------------------------------------------------------------------
     // connection options ADSirc
     ADCC_SetADIInterruptHandler (ADSirc); //
     //    ADCC_SetADIInterruptHandler (&ADSirc); //
     //--------------------------------------------------------------------------
    //******************

    //--------------------------------------------------------------------------
    ADCC_StartConversion (AudioL);//to trigger an ADC interrupt
    //--------------------------------------------------------------------------

    while (1)
    {

        ClrWdt (); // reset watchdog timer
        //***************************

    }
}
//==============================================================================

Logged
Catcatcat
Active Member
***
Offline Offline

Posts: 242

Thank You
-Given: 145
-Receive: 713



WWW
« Reply #234 on: September 06, 2020, 08:50:11 20:50 »

MPLAB® XC8 Compiler v2.30
Updated today, works  Cheesy
Logged
Jagi
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 14
-Receive: 8


« Reply #235 on: October 01, 2020, 08:33:20 08:33 »

Finally, I managed to get the latest version of XC8 2.30 up and running after an hour of trial and error.

To help all those who have been struggling with the process of patching, I have herewith made a document with the detailed steps that I followed to make the patching successfully.  Hope this document is helpful. Should you find any mistakes please let me know, I'll make the corrections and repost the update.

P.S: For those asking for the XCLM patcher, please search this forum the links to download it are available on this forum.
Logged
Catcatcat
Active Member
***
Offline Offline

Posts: 242

Thank You
-Given: 145
-Receive: 713



WWW
« Reply #236 on: October 01, 2020, 03:09:14 15:09 »

I already described my steps:
There are three xc8v2xx folders:
C:\Program Files\Microchip\xc8\v2.30\bin
C:\Program Files\Microchip\xc8\v2.30\avr\bin
C:\Program Files\Microchip\xc8\v2.30\pic\bin
In these packs you need to place our two cherished files and execute a magic command. Then comes general prosperity. Shocked Cheesy
Logged
karmi
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 5
-Receive: 3


« Reply #237 on: October 05, 2020, 05:14:28 05:14 »

Where is the link to download xclm.exe, please ?
Logged
Unhappy
Active Member
***
Offline Offline

Posts: 245

Thank You
-Given: 762
-Receive: 82


« Reply #238 on: October 05, 2020, 08:53:46 08:53 »

Where is the link to download xclm.exe, please ?

You need to check and use search the forum Dear

http://www.sonsivri.to/forum/index.php?topic=44014.0
Logged
karmi
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 5
-Receive: 3


« Reply #239 on: October 05, 2020, 03:13:07 15:13 »

Thanks, of course I did. I could not find it!. the link you provided for the old version. I need the one that supports xc8 ver 2.20. The guys say in their comments it worked for them, but they do not provide the link for download.
Logged
Manuel
Active Member
***
Offline Offline

Posts: 198

Thank You
-Given: 303
-Receive: 107


« Reply #240 on: October 05, 2020, 03:27:24 15:27 »

Please, the given link is correct !

Check TOP post and get the "txt" .....

take care,

X!
Logged

-> An Apple a Day does not Let U become a Macintosh!
metal
Global Moderator
Hero Member
*****
Offline Offline

Posts: 2338

Thank You
-Given: 765
-Receive: 615


Top Topic Starter


« Reply #241 on: October 05, 2020, 03:29:38 15:29 »

read this http://www.sonsivri.to/forum/index.php?topic=44014.msg197545#msg197545
Logged
karmi
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 5
-Receive: 3


« Reply #242 on: October 05, 2020, 03:47:43 15:47 »

The top post dl.txt leads to file not found, the next one for graywolf does not have the windows version. I do not see any link to download the xclm.exe for windows that supports the new versions of xc8 2.20 and 2.30, the post in the link says it worked for him, but where to get it downloads ?

thanks again for your efforts guys
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4400

Thank You
-Given: 758
-Receive: 3254


There is no evidence that I muted SoNsIvRi


« Reply #243 on: October 05, 2020, 07:26:51 19:26 »

The top post dl.txt leads to file not found, the next one for graywolf does not have the windows version. I do not see any link to download the xclm.exe for windows that supports the new versions of xc8 2.20 and 2.30, the post in the link says it worked for him, but where to get it downloads ?

thanks again for your efforts guys

I already reposted the file in this post from 2017:
http://www.sonsivri.to/forum/index.php?topic=44014.msg186926#msg186926
It's still up and working with the latest compilers.
this Link still working
Logged

Note: So you have Not made a Post in the Forum. Without Posts we have No Forum, That's ok Can I Mute you now sir
karmi
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 5
-Receive: 3


« Reply #244 on: October 06, 2020, 02:32:31 02:32 »

this Link still working
This message is not there! 186926.
Could you  please post the link here again.
Logged
wild
Active Member
***
Online Online

Posts: 156

Thank You
-Given: 499
-Receive: 425



« Reply #245 on: October 06, 2020, 03:35:23 03:35 »

@karmi:
please do not complain if it is a fault of yours!
The link posted by pickit2 is sound and still valid !!!

Posted on: October 06, 2020, 03:23:35 03:23 - Automerged

otherwise, if you still are not able to find the working link, please take a look at:
https://github.com/cv007/XC3216

P.S.: I have not tested if it is working
Logged
karmi
Newbie
*
 Muted
Offline Offline

Posts: 16

Thank You
-Given: 5
-Receive: 3


« Reply #246 on: October 07, 2020, 02:18:14 14:18 »

this Link still working
This is for 32bit, I am looking for 64bit one
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 4400

Thank You
-Given: 758
-Receive: 3254


There is no evidence that I muted SoNsIvRi


« Reply #247 on: October 07, 2020, 03:05:06 15:05 »

This is for 32bit, I am looking for 64bit one
The link is for all versions... or are you looking for what is not there?

Logged

Note: So you have Not made a Post in the Forum. Without Posts we have No Forum, That's ok Can I Mute you now sir
tumbleweed
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 39
-Receive: 14


« Reply #248 on: October 31, 2020, 11:55:28 11:55 »

xc8 v2.31 is available

patching method tested...still works
Logged
mitsos
Hero Member
*****
Offline Offline

Posts: 696

Thank You
-Given: 2379
-Receive: 2681


« Reply #249 on: November 01, 2020, 09:00:33 09:00 »

hi

I think the patch on winavr is unnecessary.
The test in the Application note AVR182 project in the proteus software gave the following:
Optimisation level            Size of program
-O0                                 323 bytes in flash memory
-Os                                 149 bytes in flash memory

either with the original files or with the patched ones

regards
mitsos
« Last Edit: November 01, 2020, 03:25:12 15:25 by mitsos » Logged
Pages: 1 ... 3 4 5 6 7 8 9 [10] 11
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC