EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: The Magic Rabbit on September 29, 2015, 11:26:11 am

Title: PIC16F1459 and MPLAB X Code Configurator
Post by: The Magic Rabbit on September 29, 2015, 11:26:11 am
Does anyone know how to get the clock to the claimed 48MHz from the data sheet, and why there are no USB libraries for a chip advertised as targeted towards USB use!?

Sent from my XT1039 using Tapatalk

Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: Andy Watson on September 29, 2015, 11:51:10 am
What clock source are you using?

As for libraries, the 16F1459 usb port appears to have been borrowed from the PIC18F46Jxx/ 18F25xx family and bolted-on to the mid-range silicon. The libraries for the 18Fxxxxx should work - may be with a bit of fiddling. E.G.  http://www.signal11.us/oss/m-stack/ (http://www.signal11.us/oss/m-stack/)
Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: The Magic Rabbit on September 29, 2015, 11:53:54 am
INTOSC which the datasheet says should get me to 48MHz by using a 16MHz clock and PLL x3

Sent from my XT1039 using Tapatalk

Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: Andy Watson on September 29, 2015, 12:13:56 pm
I''ve only used it with an external xtal. This thread might provide some inspiration.

https://www.eevblog.com/forum/microcontrollers/pic16f1459-problem/msg732903/#msg732903 (https://www.eevblog.com/forum/microcontrollers/pic16f1459-problem/msg732903/#msg732903)

Also, be sure to check out the errata-datasheets on Microchip's website - not everything on the silicon works as datashheet claims!
Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: Maxlor on September 29, 2015, 12:16:58 pm
The clock config module for the 1459 seems to be broken in the code configurator. So... do it the oldfashioned way: OSCCON = 0xFE; Note that the INTOSC is probably not going to be accurate enough for USB by default, you need to tune it.

As for USB libs: did you see MLA (http://www.microchip.com/mla)?
Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: The Magic Rabbit on September 29, 2015, 12:23:17 pm
Broken in code... so not just me.

Do I manually change the XTALFREQ declaration to 48 from 16 too?

What's MLA?

Sent from my XT1039 using Tapatalk

Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: The Magic Rabbit on September 29, 2015, 12:36:57 pm
http://imgur.com/tlSg7AK

This is as far as I've got so far... I'm sure I need to get rid of those blue/white crosses. I'm expecting something needs ticking, changing, etc somewhere but can't find the option and there are no clues in the interface.

Sent from my XT1039 using Tapatalk

Title: Re: PIC16F1459 and MPLAB X Code Configurator
Post by: The Magic Rabbit on September 30, 2015, 11:04:32 pm
Just updating; Found the MLA. Feel a bit of a donut not knowing about it from the start. There's an absolute mountain of stuff in there to learn from. TONS of example applications.

Thanks for pointing me to them. I've got lots of reading and learning to do! :-D



Sent from my XT1039 using Tapatalk