CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Visual Studio Code and the CCS compiler
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

Published
PostPosted: Fri Nov 15, 2024 4:25 pm     Reply with quote

https://marketplace.visualstudio.com/items?itemName=pgvt.picc-ccs-support

Reminder:
It is a non-official and non-affiliated with CCS thing!
The work was done 85% by AI on a quick manner rather for my personal use.
Use it on your risks.

The official PCW IDE has a lot of specific features like new project wizards with huge time-saving startup benefits, and help integrations, that this extension cannot substitute.

Features:
-VSCode IntelliSense features (code completion, parameter info, quick info, member lists)
-Compile / Clean as Tasks
-See and navigate to lines with Errors / Warnings / Information at PROBLEMS window
-Contextual Help (ccsc.chm) by right-click over a word in code

For further ideas, development etc. please comment here.
pet007



Joined: 25 Jan 2023
Posts: 22

View user's profile Send private message

PostPosted: Sat Mar 01, 2025 1:18 am     Reply with quote

Yes, the CCS plugin mentioned above works well. For me, "IntelliSense-based" shortcuts and features are a "must-have" nowadays.
For example, ALT + left/right arrows, proper member access when passing a pointer to a function, and all the other features common in CubeIDE/Eclipse are essential if you're writing code seriously.
I'm sorry, but the CCS IDE feels heavily outdated. :(
temtronic



Joined: 01 Jul 2010
Posts: 9597
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Mar 01, 2025 6:25 am     Reply with quote

After you've used it for 2+ decades, it won't feel 'outdated' rather an extension of your body and soul and you'll appreciate it more !
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

Thanks
PostPosted: Sat Mar 01, 2025 2:01 pm     Reply with quote

After >400 installs finally a word here. Smile
I'm glad I am helping you to enjoy more this great compiler.
henrry_std3



Joined: 06 Mar 2025
Posts: 4

View user's profile Send private message

PostPosted: Sat Mar 08, 2025 1:51 am     Reply with quote

It looks amazing man! Now I will work much better with CCS in VS Code. Thanks for this outstanding extension!!
JeromePeters



Joined: 21 Mar 2025
Posts: 1

View user's profile Send private message

Re: Here you go:
PostPosted: Fri Mar 21, 2025 6:21 am     Reply with quote

pgvt wrote:
1. Create a sub-folder ./vscode and place inside:
2. A new file named tasks.json with contents:
Code:

{
  "version": "2.0.0",
  "inputs": [
    {
      "id": "picFlavor",
      "type": "pickString",
      "description": "Select: +FH(PIC18), +FB(PIC12), +FM(PIC16) or +FD(PIC24)",
      "options": ["+FH", "+FB", "+FM", "+FD"],
      "default": "+FH"
    }
  ],
  "tasks": [
    {
      "label": "Build Project by PICC",
      "type": "shell",
      "command": "C:\\Program Files (x86)\\PICC\\ccscon.exe",
      "args": [
        "-M", "-T", "-A", "-Z",
        "${input:picFlavor}",
        "+EA", "+P02", "+J", "+STDOUT", "+O8hex",
        "${file}"
      ],
      "presentation": {
        "echo": true,
        "revealProblems": "onProblem",
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false,
        "clear": true
      },
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": {
        "owner": "custom",
        "fileLocation": ["absolute"],
        "pattern": {
          "regexp": "^(.*):(\\d+):(\\d+):\\s+(Info|Error|Warning)#(\\d+)\\s+(.*)$",
          "file": 1,
          "line": 2,
          "column": 3,
          "severity": 4,
          "code": 5,
          "message": 6
        }
      }
    }
  ]
}

3. Also a new file named settings.json with contents:
Code:
{
    "C_Cpp.errorSquiggles": "disabled",
    "C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
        "clang-diagnostic-error"
    ]
}

4. Also a new file named c_cpp_properties.json with contents:
Code:

{
    "configurations": [
        {
            "name": "PICC",
            "includePath": [
                "${workspaceFolder}/**",
                "C:\\Program Files (x86)\\PICC\\Devices",
                "C:\\Program Files (x86)\\PICC\\Drivers"
            ],
            "defines": [
               
            ]
        }
    ],
    "version": 4
}
//https://code.visualstudio.com/docs/editor/variables-reference


5. Download latest vscode and ... patience to load everything ...

6. Optional: For fast access you can create a shortcut to vscode with modifying the Target: field this way:
Code:
"C:\Users\<yourusername>\AppData\Local\Programs\Microsoft VS Code\Code.exe" "C:\your project absolute path"

link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link
link



Thanks you!
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

Re: Here you go:
PostPosted: Fri Mar 21, 2025 6:51 am     Reply with quote

JeromePeters wrote:
pgvt wrote:
...

Hi JeromePeters, you can simply and better, install the latest version from here and see the other functions like help on F1. Same as visiting this:
https://marketplace.visualstudio.com/items?itemName=pgvt.picc-ccs-support
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

PostPosted: Wed May 28, 2025 4:40 pm     Reply with quote

I don't know how to alert moderators to ban (an user that posts) scam links ...

Last edited by pgvt on Thu May 29, 2025 5:39 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19989

View user's profile Send private message

PostPosted: Thu May 29, 2025 12:58 am     Reply with quote

I have deleted the post that pgvt is referring to.
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

PostPosted: Thu May 29, 2025 5:40 am     Reply with quote

Ttelmah wrote:
I have deleted the post that pgvt is referring to.


Thank you for cleaning up!
Marttyn



Joined: 06 Mar 2015
Posts: 32
Location: Spain

View user's profile Send private message Visit poster's website

PostPosted: Mon Sep 22, 2025 10:01 am     Reply with quote

Im testing and its not easy to move from MPLAB to VS code :(
Could you make a video explaining how to port an existing or start a new project in VS code from MPLAB?
Do we need MPLAB extensions for VSc?
Thanks!
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

PostPosted: Mon Sep 22, 2025 11:40 am     Reply with quote

Marttyn wrote:
Im testing and its not easy to move from MPLAB to VS code :(
Could you make a video explaining how to port an existing or start a new project in VS code from MPLAB?
Do we need MPLAB extensions for VSc?
Thanks!


@Marttyn I've never used MPLAB + CCS compiler add-on, so I couldn't advise on maximized porting of such type of projects.

The idea here is different than Microchip's MPLAB IDE (chip debugging, etc. features) , and also different than PCW "IDE" - (library helps, wizards).
vsCode gives a generic help of easier C code writing, plus few contextual references and shortcuts.
Basically, you need only your C file (and headers, other includes if you have) in a folder, then open with vsCode, and activate the extension.
Very similar to open your main C file with the PCW IDE and compile if you have purchased the CCS IDE. Even with CCS command-line only compiler, if it is installed by default, you should be able to build (compile) it by vsCode and the extension.
Marttyn



Joined: 06 Mar 2015
Posts: 32
Location: Spain

View user's profile Send private message Visit poster's website

PostPosted: Mon Nov 17, 2025 5:38 am     Reply with quote

Well, it was not that difficult. You just need to understand that you have to configure a build task (calling compiler) and a program task (calling programmer).
The compiling task made by your plugin is good, but I didnt like that I had to choose PIC type every time, so I ve changed that and created my own task.

Once you made the tasks, vscode with AI is amazing. Autocomplete, chat, edit... everything is much faster!

As I was used to MPLAB IDE y wanted buttons for programming and compiling, so I added "Task buttons" plugin, and now I can just click a button instead of shortcuts Smile

This is how my task ended:
Code:

{
  "version": "2.0.0",
   
  "tasks": [
    {
      "label": "- PICC Build -",
      "type": "shell",
      "command": "${config:ccs_path}",  // ruta al compilador CCS desde settings.json
      "args": [
        "${config:optimization_level}", // nivel de optimización desde settings.json
        "+M",       // crear archivo .sym
        "+T",       // árbol de llamadas .tre
        "+A",       // estadísticas .sta
        "+LY",      // listado simbólico
        "-J",       // no crear .pjt
        "-Z",       // no conservar temporales
        "${config:ccs_target}",  // tipo de PIC desde settings.json
        "+EA",      // mostrar todos los errores/warnings
        "+P02",     // mostrar ventana durante 2 segundos
        "+STDOUT",  // errores por stdout para VSCode
        "+O8hex",   // salida en hex
        "out=${workspaceFolder}\\${config:build_folder}\\",          //directorio de archivos de compilacion
        "${workspaceFolder}\\${config:source_file}.c" //archivo a compilar
      ],
      "presentation": {
        "echo": true,
        "revealProblems": "onProblem",
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false,
        "clear": true
      },
      "group": {
        "kind": "build",
        "isDefault": true
      },
      "problemMatcher": [
        {
          "owner": "custom",
          "fileLocation": [
            "absolute"
          ],
          "pattern": {
            "regexp": "^(.*):(\\d+):(\\d+):\\s+(Info|Error|Warning)#(\\d+)\\s+(.*)$",
            "file": 1,
            "line": 2,
            "column": 3,
            "severity": 4,
            "code": 5,
            "message": 6
          }
        },
        {
          "owner": "build-summary",
          "fileLocation": [
            "absolute"
          ],
          "severity": "info",
          "pattern": {
            "regexp": "^(Build.*|Memory usage:.*|.*Errors,.*Warnings.*)$",
            "line": 1,
            "column": 1,
            "message": 0
          }
        }
      ]
    },
    {
      "label": "PICC Clean",
      "type": "shell",
      "command": "powershell",
      "args": [
        "-NoProfile",
        "-Command",
        "Remove-Item",
        "-Path",
        "${workspaceFolder}\\${config:build_folder}\\*",
        "-Include",
        "${fileBasenameNoExtension}.sym,${fileBasenameNoExtension}.cod,${fileBasenameNoExtension}.cof,${fileBasenameNoExtension}.err,${fileBasenameNoExtension}.esym,${fileBasenameNoExtension}.xsym,${fileBasenameNoExtension}.STA,${fileBasenameNoExtension}.tre",
        "-Force",
        "-ErrorAction",
        "Continue"
      ],
      "presentation": {
        "echo": true,
        "revealProblems": "onProblem",
        "reveal": "always",
        "focus": false,
        "panel": "shared",
        "showReuseMessage": false
      },
      "group": {
        "kind": "build",
        "isDefault": false
      },
      "problemMatcher": []
    },
    {
      "label": "PICC SIOW Terminal",
      "type": "shell",
      "command": "${config:siow_path}",  // ruta al programa SIOW desde settings.json
      "args": [""],
      "problemMatcher": []
    },
    {
      "label": "Programar con PICkit",
      "type": "shell",
      "command": "${config:pk2cmd_path}",         // ruta al programador PICkit2
      "args": [
        "-B${config:pk2cmd_devices_path}",        // ruta a la carpeta de dispositivos
        "-PPIC${config:pic_model}",               // especifica el modelo de PIC a programar
        "-F${workspaceFolder}\\${config:build_folder}\\${config:source_file}.hex",  // archivo hex a programar
        "${config:pk2cmd_vdd_voltage}",           // voltaje VDD
        "${config:pk2cmd_preserve_eeprom}",       // opción de preservar EEPROM
        "-M",                                     // programar memoria
        "-J",                                     // modo de programación rápida
        "-R",                                     // resetear después de programar
        "-T"                                      // encender el PIC después de programar
      ],
      "group": "build"
    },
    {
      "label": "Programar con IPE",
      "type": "shell",
      "command": "${config:ipe_path}",            // ruta al programador IPE
      "args": [
        "${config:ipe_programmer}",               // tipo de programador
        "-P${config:pic_model}",                  // modelo de PIC
        "-F${workspaceFolder}\\${config:build_folder}\\${config:source_file}.hex",  // archivo hex a programar
        "${config:ipe_erase_flash}",              // opción de borrado
        "${config:ipe_vdd_voltage}",              // voltaje VDD
        "${config:ipe_preserve_eeprom}",          // opción de preservar EEPROM
        "-M",                                     // programar memoria
        "-OAS2",                                  // velocidad de programación?
        "-OL"                                     // mostrar log de operación?
      ],
      "group": "build"
    },
    {
      "label": "Compilar y Programar",
      "dependsOrder": "sequence",
      "dependsOn": [
        "- PICC Build -",
        "Programar con PICkit"
      ],
      "group": {
        "kind": "build",
        "isDefault": false
      },
      "problemMatcher": []
    }
  ]
}


And you configure your settings per project in the settings.json:
Code:

{
    "C_Cpp.errorSquiggles": "disabled",
    "C_Cpp.intelliSenseEngine": "default",
    "C_Cpp.codeAnalysis.clangTidy.checks.disabled": [
        "clang-diagnostic-error"
    ],

    //configuracion general
    "pic_model": "16F1455",     //chosen PIC model for CCS compiler and IPE programmer
    "source_file": "main",      //main source file without extension
    "build_folder": "build",    //build output folder

    //configuration for CCS compiler
    "ccs_path": "C:\\Program Files (x86)\\PICC\\ccscon.exe",    //path to comamand line CCS compiler
    "siow_path": "C:\\Program Files (x86)\\PICC\\siow.exe",     //path to SIOW terminal program
    "ccs_target": "+FM",            //CCS compiler target type (+FB: 12 bits, +FM: 14 bits, +FD: 16 bits, +FH: 18 bits)
    "optimization_level": "+Y=2",   //optimization level (+Y=0: none, +Y=9: maximum)

    //configuration for IPE programmer
    "ipe_path": "C:\\Program Files\\Microchip\\MPLABX\\v6.20\\mplab_platform\\mplab_ipe\\ipecmd.exe", //path to IPE command line programmer
    "ipe_programmer": "-TPPK4",     //chosen programmer type (-TPPK3: PICkit3, -TPPK4: PICkit4, -TPPK5: PICkit5, etc.)
    "ipe_erase_flash": "-E",        //erase flash before programming ("-E" to enable, "" to disable)
    "ipe_vdd_voltage": "-W5.0",     //VDD voltage level ("x.x" to set voltage, "" for vdd off)
    "ipe_preserve_eeprom": "-Z0-FF", //preserve EEPROM memory during programming ("-Z" [change "0-FF" for desired range], "" to disable)

    //configuration for Pickit2 programmer
    "pk2cmd_path": "C:\\Program Files (x86)\\PICkitminus\\pk2cmd\\pk2cmd.exe", //path to PICkit2 command line programmer
    "pk2cmd_devices_path": "C:\\Program Files (x86)\\PICkitminus\\pk2cmd", //path to PICkit2 devices folder
    "pk2cmd_vdd_voltage": "-A5.0",   //VDD voltage level ("A"x.x to set voltage, "" for vdd off)
    "pk2cmd_preserve_eeprom": "-Z" //preserve EEPROM memory during programming ("-Z" to enable, "" to disable)
}
pgvt



Joined: 17 Aug 2024
Posts: 14

View user's profile Send private message

PostPosted: Mon Nov 17, 2025 11:32 am     Reply with quote

@Marttyn
Glad yo figured out.
When I have time I may add some of your menus, no promise Smile
Marttyn



Joined: 06 Mar 2015
Posts: 32
Location: Spain

View user's profile Send private message Visit poster's website

PostPosted: Wed Nov 19, 2025 9:39 am     Reply with quote

Hope you do! Now I dont use your task as it is as I dont want to choose the PIC type every time. With this is very easy and you can set up per project.
Also having options to modify the compilation behavior is great!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group