---
# System prepended metadata

title: Interface

---

# Interface
This is a library (Right now has a proof of concept) that will allow a more direct and easy approach to use USB Devices, 
and more specifically, the link between java and a PIC.

## 1) What is this repository for?

### 1.1) Quick summary
Version: `0.1-SNAPSHOT`

<!-- TODO: Add detailed description of your app. -->

### 1.2) Disclosure
This is a private repository, you will require written authorization to use this library.

## 2) How do I get set up? ###

### 2.1) Summary of set up
The technologies the project is using.

#### 2.1.1) Development environment
- DataBase: *No Database is used at the moment*
- Maven: [*Last Version*](https://maven.apache.org/)


##### 2.1.1.1) Java
- version: 	`1.8`


##### 2.1.1.2) CCS Compiler
- Version `5.076`

#### 2.1.2) Project Dependencies
This library uses:
- **lombok** to log errors and general logs.
    - **Slf4j**
- **White_Validations** to validate parameters.
- **Spring boot**
- [**usb4java-javax**](https://github.com/usb4java/usb4java-javax). an extension to [usb4java](http://usb4java.org/).
    - [**javax-usb**](https://github.com/KeyBridge/lib-javax-usb3). *These are the core libraries that makes this communication possible.*
        - [libusb](https://libusb.info/) is a C library that provides generic access to USB devices.

##### 2.1.2.2) CCS Compiler
- **18F4550** PIC18F4550
- **HCSR04** Ultrasonic distance sensor
- **usb_cdc** USB CDC communication

##### 2.1.2.3) Hardware
- PIC18F4550
- HCSR04

### 2.2) Configuration Steps

1) Configuration
    1) CCS Compiler
        1) Clone the proyect
        2) Install [CCS Compiler](https://www.ccsinfo.com/compilers.php)
        3) Install [PICkit 3 Programmer](https://microchipdeveloper.com/pickit3:scripttool) (***preferred***) or a similar
        4) Replicate the coniguration shown on the Diagram with your **PIC18F4550** 
    2) Java
        1) Install **Maven**
2) Deploy Project
    1) Compile CCS Compiler the proyect
        1) Open [the CCS project](https://github.com/WhiteOrganization/interface-cpu-pic/tree/main/ccscompiler-src) [.ccspjt file](https://github.com/WhiteOrganization/interface-cpu-pic/blob/main/ccscompiler-src/USB_CDC.ccspjt) using **CCS Compiler**
        2) Go to *Compile* tab
        3) Press *Build* button
    2) This will generate a compiled `.hex` file in the [CCS project folder](https://github.com/WhiteOrganization/interface-cpu-pic/tree/main/ccscompiler-src).
    3) Load the programming configuration into the PIC with **PICkit 3 Programmer**
        1) Plug the **PICkit 3 Device** to the **PIC18F4550 preconfigured MicroProcessor**, and to the computer.
        2) While plugged-in, open the **Programmer** 
            - if **PIC18F4550** is not detected (*Device* label will be empty). Go to the *Tools* menu, and press *Check Communication* to retry.
        3) Press *Erase* button to clean any previous programmed configuration in the PIC
        4) Press *Blank Check* button for confirmation (it will show a small green screen with a message).
        5) loading `.hex` file: *File* > *Import Hex*, and load the `.hex` file (generated in a previous step).
        6) Press *Write* button
        7) Press *Verify* button, to confirm that the proggram is loaded (it will show a small green screen with "*Verification Successful*" message). 
        8) Confirm that *VDD PICkit 3*>*On* checkbox is unchecked, before proceeding or it might burn your PIC when pluggin the USB
        9) Disconnecting the *PICkit 3*.
3) Extra Steps 
    1) Plug *PIC18F4550* directly to the computer running the app.
4) Compile, Deploy, and execute the project with [maven](https://spring.io/guides/gs/maven/) to compile and run the project.

## 3) How to Deploy?
The Configuration steps show how to deploy both projects.

## 4) What are the Contribution guidelines?

#### 4.1) Writing tests.

_Please do. No UT defined at the moment._

#### 4.2) Code review.

_Request if needed._

#### 4.3) Other guidelines.

_Please ask for the code standard to use as guideline and reflect it in the project._

## 5) Who do I talk to?

<table>
<thead><tr><th><b>Role</b></th> <th><b>Contact</b></th></tr></thead>
<tr><td>admin</td><td>current main developer: <a href='mailto:obed.vazquez@gmail.com'>obed.vazquez@gmail.com</a></td></tr>
<tr><td>admin</td><td>current main developer: <a href='mailto:jhonatan.isai.v.l@gmail.com'>jhonatan.isai.v.l@gmail.com</a></td></tr>
<tr><td>Supporters</td><td>Currently there is no other supporters with knowledge of the project</td></tr>
<tr><td>Community</td><td> send us a message in <a href='http://discord.whiteweb.tech'> our Discord Server</a></td></tr>
</table>

>Please contact us if you want to help, We are developing and maintaining and supporting in general this project 
on our own with no help or support of anyone and any tip, comment, change or help in general is well-received.

