** This Gist is about how to setup a build+upload system to use with MikroC and PICKit 2 v2.55 **
-
Create a project over MikroC with all of your preferences
-
Go to the project's base folder and open the %ProjectName%.log
-
You should see as first line something like this:
0 1 mikroCPIC1618.exe -MSF -DBG -pP18F452 -DL -O11111114 -fo20 -N"F:\development\Trabalhofinal\mikroc\MyProject.mcppi" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\defs" -SP"C:\Users\Public\Documents\Mikroelektronika\mikroC PRO for PIC\uses\P18" -SP"F:\development\Trabalhofinal\mikroc" -SP"C:\Users\mplab\Documents\Trabalhofinal\mikroc" -IP"C:\Users\mplab\Documents\Trabalhofinal\mikroc" -IP"F:\development\Trabalhofinal\mikroc" "start.c" "processor.c" "main.c" "keyboard.c" "__Lib_Math.mcl" "__Lib_MathDouble.mcl" "__Lib_System.mcl" "__Lib_Delays.mcl" "__Lib_CType.mcl" "__Lib_CString.mcl" "__Lib_CStdlib.mcl" "__Lib_CMath.mcl" "__Lib_MemManager.mcl" "__Lib_Conversions.mcl" "__Lib_Sprintf.mcl" "__Lib_PrintOut.mcl" "__Lib_Sprinti.mcl" "__Lib_Sprintl.mcl" "__Lib_Time.mcl" "__Lib_Trigonometry.mcl" "__Lib_Button.mcl" "__Lib_Keypad4x4.mcl" "__Lib_Manchester.mcl" "__Lib_OneWire.mcl" "__Lib_PS2.mcl" "__Lib_Sound.mcl" "__Lib_SoftI2C.mcl" "__Lib_SoftSPI.mcl" "__Lib_SoftUART.mcl" "__Lib_ADC_A_C.mcl" "__Lib_EEPROM_256.mcl" "__Lib_FLASH_w8_e64.mcl" "__Lib_I2C_c34.mcl" "__Lib_PWM_c21.mcl" "__Lib_SPI_c345.mcl" "__Lib_UART_c67.mcl" "__Lib_PortExpander.mcl" "__Lib_CANSPI.mcl" "__Lib_CF.mcl" "__Lib_CFFat16.mcl" "__Lib_GlcdFonts.mcl" "__Lib_Glcd.mcl" "__Lib_LcdConsts.mcl" "__Lib_Lcd.mcl" "__Lib_Mmc.mcl" "__Lib_MmcFat16.mcl" "__Lib_MmcFat16Constants.mcl" "__Lib_RS485.mcl" "__Lib_S1D13700.mcl" "__Lib_T6963C.mcl" "__Lib_SPIGlcd.mcl" "__Lib_SPILcd.mcl" "__Lib_SPILcd8.mcl" "__Lib_SPIT6963C.mcl" "__Lib_EthEnc28j60.mcl" "__Lib_TFT.mcl" "__Lib_TFT_Defs.mcl" "__Lib_TFT_16bit.mcl" "__Lib_TFT_16bit_Defs.mcl" "__Lib_TouchPanel_TFT.mcl" "__Lib_EthEnc24j600.mcl" "__Lib_TouchPanel.mcl"
-
From "mikroCPIC1618.exe" on, copy the whole line
-
Find the full path for "mikroCPIC1618.exe" on your installation and complete the former copy.
-
Escape all quotes ' " ' and all slashes ' \ '
-
Go to sublime, setup a sublime project on MikroC's base (optional), "Tools" -> "Build System" -> "New Build system"
paste this template:
{ "cmd": %Step 4 copy% "shell": "true" }
fill the cmd section and save it %NAME%.sublime-build
- You should be able to use "Build with"
PRO TIP: Sublime wasn't displaying the console output for me, so I added to the command " > %fullpath%\build.log"
- The autoupload is done by PICKit, you just need to use the "Auto import Hex + Write Device" option