# PIC C Compiler CCS

<figure><img src="/files/GagkfVbilaKhrW8EbfjC" alt="" width="191"><figcaption></figcaption></figure>

## Configuración de bootloader

{% hint style="warning" %}
Esta configuración solo es compatible para los **PIC18F4550** y **PIC18F45K50**.
{% endhint %}

Para utilizar un **PIC18F4550/45K50** precargado con **Bootloader Microside** es <mark style="background-color:red;">**indispensable**</mark> colocar las siguientes líneas de código en el encabezado del programa:

{% code fullWidth="true" %}

```c

#build( reset = 0x02000, interrupt = 0x02008 ) // Asignación de los vectores de reset e interrupción
#org 0x0000, 0x1FFF {}                         // Reserva espacio en la memoria para la versión con bootloader

```

{% endcode %}

{% hint style="info" %}
Realiza dicha configuración **antes** de intentar cargar el programa, de lo contrario el Software X-TRAINER Suite podría presentar errores.
{% endhint %}

{% hint style="success" %}
Todas nuestras prácticas para **PIC18F4550/45K50** en **PIC C Compiler CCS** ya están configuradas para su uso con **Bootloader Microside**.
{% endhint %}

### Ejemplo:

{% code overflow="wrap" lineNumbers="true" %}

```c
#include <18F4550.h>                           
#use delay( clock = 48Mhz, crystal )  

//Configuración de bootloader  --------------
       
#build( reset = 0x02000, interrupt = 0x02008 ) // Asignación de los vectores de reset e interrupción
#org 0x0000, 0x1FFF {}   // Reserva espacio en la memoria para la versión con bootloader

//Configuración de bootloader  --------------

#define LED PIN_A4                             

void main( void ) {
   set_tris_a( 0b11101111 );                   

   while ( 1 ) {
      output_HIGH( LED );                      
      delay_ms( 500 );                         
      output_LOW( LED );                       
      delay_ms( 500 );                     
   }
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.microside.com/tarjetas-de-desarrollo-pics/software-x-trainer-suite/configuracion-de-bootloader/pic-c-compiler-ccs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
