PIC16F/LF1454, 1455 and 1459

… visits
Parent Previous Next

These small PIC16 targets need particular care with memory, chip revision and include order. Begin with HID data in polling mode, then add the features your project needs.

Special steps for PIC16F/LF145x

These six enhanced PIC16 devices use the same public HID, CDC and MSC commands described in this guide. Select the exact part in the tool and use its Integration listing. The PIC16 code is selected automatically inside the same USB_Device.inc; no additional backend include is needed.

For these six PIC16 devices: use HID, CDC or MSC. Browser/RNDIS is unavailable, and ping-pong must stay off. Microchip erratum DS80000546F, item 5.1, reports RAM corruption with USB ping-pong on every silicon revision listed there. The library uses single buffering on these targets.

Their clock choices are:

Source

PLL multiplication

USB clock

MCU Fosc choices

12 MHz external crystal

×4

48 MHz

48, 24, 16 or 8 MHz

16 MHz external crystal

×3

48 MHz

48, 24, 16 or 8 MHz

Internal 16 MHz with Clock Recovery

×3

48 MHz

48, 24, 16 or 8 MHz

There is no PLL input prescaler in these devices. A 4 MHz crystal cannot produce the required 48 MHz through their ×3/×4 PLL, so it is not offered. The external-crystal default is 12 MHz.


Keep the generated startup sequence: it selects the source and multiplier, enables the PLL in software and waits for PLL readiness. The fuse PLLEN = DISABLED does not mean startup leaves the PLL off. Likewise, the generated Positron token USBLSCLK = 24MHz represents the required full-speed bit setting; its wording refers to the low-speed divider choice, not a 24 MHz full-speed USB clock. Do not change these tokens based only on their names.


Clock Recovery on these targets tunes the internal oscillator using USB frames from the host. Keep the generated startup and USB servicing active; selecting Clock Recovery does not replace USB_Init() or the polling/ISR service.


For an ISR application, check the chip's silicon revision. DS80000546F, item 4.1, lists an interrupt interaction with BRA/BRW on revisions A2 and A5; A6 is not marked affected. This applies to instructions anywhere in the compiled application. A USB source change cannot repair every compiler-generated branch. For affected silicon, inspect the generated assembly and apply Microchip's branch workaround, or begin with polling and leave all interrupts disabled. Polling USB with some other interrupt enabled does not avoid this silicon issue.


These devices have 8192 program words and 1024 RAM bytes. Start with a small HID Data polling example, check the compiler's actual allocation, and then test ISR and the other required classes. Selecting a class does not guarantee that every packet size, file count and application will fit.

See also

Created with the Personal Edition of HelpNDoc: Make Documentation a Breeze with a Help Authoring Tool