metal
Global Moderator
Hero Member
Offline
Posts: 2420
Thank You
-Given: 862
-Receive: 678
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
Posts: 762
Thank You
-Given: 173
-Receive: 1297
|
|
« 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
Posts: 26
Thank You
-Given: 12
-Receive: 17
|
|
« 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
Posts: 998
Thank You
-Given: 230
-Receive: 980
|
|
« 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
Posts: 26
Thank You
-Given: 12
-Receive: 17
|
|
« 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
Posts: 2420
Thank You
-Given: 862
-Receive: 678
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: 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
Senior Member
Offline
Posts: 329
Thank You
-Given: 674
-Receive: 191
|
|
« 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
Posts: 22
Thank You
-Given: 101
-Receive: 16
|
|
« 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
Senior Member
Offline
Posts: 429
Thank You
-Given: 284
-Receive: 1610
|
|
« 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: 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: 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. 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
Senior Member
Offline
Posts: 429
Thank You
-Given: 284
-Receive: 1610
|
|
« Reply #234 on: September 06, 2020, 08:50:11 20:50 » |
|
|
|
|
Logged
|
|
|
|
Jagi
Newbie
Offline
Posts: 27
Thank You
-Given: 29
-Receive: 12
|
|
« 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
Senior Member
Offline
Posts: 429
Thank You
-Given: 284
-Receive: 1610
|
|
« 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.
|
|
|
Logged
|
|
|
|
karmi
Newbie
Muted
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
|
|
|
|
|
karmi
Newbie
Muted
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
Senior Member
Offline
Posts: 329
Thank You
-Given: 674
-Receive: 191
|
|
« 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
Posts: 2420
Thank You
-Given: 862
-Receive: 678
Top Topic Starter
|
|
« Reply #241 on: October 05, 2020, 03:29:38 15:29 » |
|
|
|
|
Logged
|
|
|
|
karmi
Newbie
Muted
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
Posts: 4657
Thank You
-Given: 832
-Receive: 4300
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
this Link still working
|
|
|
Logged
|
Note: I stoped Muteing bad members OK I now put thier account in sleep mode
|
|
|
karmi
Newbie
Muted
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
Offline
Posts: 179
Thank You
-Given: 601
-Receive: 452
|
|
« 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/XC3216P.S.: I have not tested if it is working
|
|
|
Logged
|
|
|
|
karmi
Newbie
Muted
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
Posts: 4657
Thank You
-Given: 832
-Receive: 4300
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: I stoped Muteing bad members OK I now put thier account in sleep mode
|
|
|
tumbleweed
Newbie
Offline
Posts: 34
Thank You
-Given: 58
-Receive: 41
|
|
« Reply #248 on: October 31, 2020, 11:55:28 11:55 » |
|
xc8 v2.31 is available
patching method tested...still works
|
|
|
Logged
|
|
|
|
chicowood
Junior Member
Offline
Posts: 93
Thank You
-Given: 101
-Receive: 29
|
|
« Reply #249 on: November 16, 2020, 01:32:40 01:32 » |
|
I recently needed to revive an old project in MPLAB 8.92 that was on a virtual disk image. The project was still pointing to xc8 v1.43 and it compiled ok. (And it compiled in PRO mode thanks to xlcm medicine installed years ago...)
Then I updated xc8 to to v2.31 and applied medicine. Medicine worked. MPLABX sees the v2.31 compiler and compiles correctly.
But I can't get MPLAB 8 to see v2.31.
In MPLAB 8, under "Select Language Toolsuite" and "Set Language Tool Locations", I set the location to "C:\Program Files (x86)\Microchip\xc8\v2.31\bin\xc8.exe" (also tried "C:\Program Files (x86)\Microchip\xc8\v2.31\pic\bin\xc8.exe").
But after I press Apply and OK it doesn't stick. It still compiles with v1.43, and the locations I set above have reverted from v2.31 to v1.43.
Then I go to "Build Options -> Project: Driver". It shows "MPLAB XC8 C Compiler V1.43". V2.31 is not listed, and there's no obvious way to add it. I don't know how to get v2.31 to register with MPLAB 8.
Does anybody remember MPLAB 8 well enough to advise on how to get MPLAB 8 to see 2.31? Or perhaps MPLAB 8 is so old that xc8 v2.31 is incompatible with MPLAB 8?
|
|
|
Logged
|
|
|
|
|