Author Topic: PIC24F peripheral library manual?!  (Read 3510 times)

0 Members and 1 Guest are viewing this topic.

Offline jon6123Topic starter

  • Contributor
  • Posts: 10
  • Country: gb
PIC24F peripheral library manual?!
« on: February 28, 2017, 06:36:14 pm »
Hi all,

Im new to programming PICs but not new to working on embedded platforms..

I'm trying to find documentation on the PIC24F peripheral libraries using XC16 compiler.

So far I have stumbled my way through the MPLAB X code configurator and generated some files etc however I'm struggling to find any documentation on how to actually use the generated API's?

up to now i have just been looking at the generated .c files and trying to guess how it works...

i looked in the help menu but found nothing regarding peripheral libs

looked in the XC16 compiler doc folder and read the manual and found this:



however the contents of the folder doesnt contain it:



so far its almost felt like it would be easier to write my own drivers... however with the timescale of this project that really isnt an option

I have been googling for the past hour and cant find anything, it looks like microchip have made some big changes recently because everything I find generally refers to older compilers/libraries

any pointers?
« Last Edit: February 28, 2017, 06:49:53 pm by jon6123 »
 

Offline andersm

  • Super Contributor
  • ***
  • Posts: 1198
  • Country: fi
Re: PIC24F peripheral library manual?!
« Reply #1 on: February 28, 2017, 07:50:48 pm »
The legacy peripheral libraries have been moved into a separate package, found on the same site as the compiler download.

Offline jon6123Topic starter

  • Contributor
  • Posts: 10
  • Country: gb
Re: PIC24F peripheral library manual?!
« Reply #2 on: February 28, 2017, 08:12:54 pm »
yeah I noticed that for the older legacy drivers,

however this is a fresh install of MPLAB X (and separate MPLAB code configurator..?) and the code configurator produces source files with peripheral API's inside but I cannot find any documentation on how to use them other than rough comments in the generated library source files

from what I can see the legacy libraries are well used and available but I am new to the microchip platform, I would assume the new libraries would be easier to use than the legacy ones?
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: it
Re: PIC24F peripheral library manual?!
« Reply #3 on: March 01, 2017, 06:45:00 am »
it's still better/faster if you write your own (including can), aside from the software stacks (usb and the like)
 

Offline jon6123Topic starter

  • Contributor
  • Posts: 10
  • Country: gb
Re: PIC24F peripheral library manual?!
« Reply #4 on: March 02, 2017, 06:27:20 pm »
Hi JPortici,

Yeah it might seem that way however the size and timescale of this project I dont have time to write and check/test drivers for PWM, SPI, UART, USB, ADC

I've been muddling through the comments and examples found in the generated files however they are unclear/produce depreciation errors on compilation and is eating up way too much of my time on project

I've been googling like crazy trying to find the peripheral library manual/help  :'(

does anyone else have any experience using microchip code configurator generated drivers? and where to find clearer instructions??
 

Offline JPortici

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: it
Re: PIC24F peripheral library manual?!
« Reply #5 on: March 02, 2017, 06:44:31 pm »
in the same time you would have written your own.

want to write a register? use the register's name.
Code: [Select]
LATB |= 0x0010;if you want to access the single bit use the register name followed by bits
Code: [Select]
LATBbits.LATB4 = 1
i find that ARM software libraries tend to use much more convoluted conventions for registers.
Besides USB (for which i suggest you use their stack) everything else could be written and tested in one morning
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf