It was not that difficult, but a nice feeling when you finish something
The problem was that this was the first time that I work with 18LF13K50. There are some specific things about this PIC
Now I'm trying to reduce run time on pic...
For testing I'm using 220uF/6.3V low esr capacitor in parallel with batery, close to pic power pins, and 100nF/50V ceramic capacitor on Vusb pin.
Thank you very much for your help