# PIC Programs

## Manipulation

When you create a FlowCode or a Text document, you'll notice a drop down menu in the toolbar with a rocket icon. From here, you can manipulate your PIC program; changing it to different forms.

- Convert to &microbe; - This is used only in &flowcode; documents. This is explained further in .

- Convert to Assembly - This can be used in four contexts. When a &flowcode; document is open, it will output the &flowcode; as assembly instructions. When a &microbe; document is open, it will invoke the `microbe` program distributed with &ktechlab; to compile the program. Similarly, if a C program is open, it will attempt to compile it via SDCC. When a text document containing PIC hex is open, it will invoke `gpdasm` to disassemble the hex.

- Convert to Hex - This can also be used in four contexts. As with Convert to Assembly, this can be used with &flowcode;, &microbe; and C documents. It will also be enabled when an assembly document is open to assemble it via `gpasm`.

- Upload to PIC - This assembles the PIC program currently being edited, and uploads it using the programmer that the user has selected.

None of these actions require the current document to be saved - very useful for when a quick program is required. For non-PIC targets, the Output dialog invoked on clicking on one of these actions can either output the result (always text in the above three cases) to a fresh document, or to a file. If the output is saved to file, it also provides options to load the file after creation, and adding the newly created file to the open project (if one is open).

Note that you can make &ktechlab; always use the same view for displaying the outputted content by selecting the option under General settings.

## Uploading

&ktechlab; uses third-party programmers to upload programs to PICs. A variety of common programmers come predefined. Others can be added via the Settings dialog.

The list of ports is obtained from scanning for serial and parallel ports that are readable and writable. Serial ports are looked for in:

- /dev/ttyS[0..7]

- /dev/tts/[0..7]

- /dev/ttyUSB[0..7]

- /dev/usb/tts/[0..7]

Parallel ports are looked for in:

- /dev/usb/parport[0..7]

- /dev/usb/parports/[0..7]