PIC24F peripheral library manual?! - Page 1
Forum section: electronics / general

author: jon6123
author_rank: Contributor
timestamp: February 28, 2017, 06:36:14 pm
content: 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 libslooked 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 optionI 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/librariesany pointers?

author: andersm
author_rank: Super Contributor
timestamp: February 28, 2017, 07:50:48 pm
content: The legacy peripheral libraries have been moved into a separate package, found on the same site as the compiler download.

author: jon6123
author_rank: Contributor
timestamp: February 28, 2017, 08:12:54 pm
content: 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 filesfrom 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?

author: JPortici
author_rank: Super Contributor
timestamp: March 01, 2017, 06:45:00 am
content: it's still better/faster if you write your own (including can), aside from the software stacks (usb and the like)

author: jon6123
author_rank: Contributor
timestamp: March 02, 2017, 06:27:20 pm
content: 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, ADCI'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 projectI've been googling like crazy trying to find the peripheral library manual/helpdoes anyone else have any experience using microchip code configurator generated drivers? and where to find clearer instructions??

author: JPortici
author_rank: Super Contributor
timestamp: March 02, 2017, 06:44:31 pm
content: in the same time you would have written your own.want to write a register? use the register's name.Code:LATB |= 0x0010;if you want to access the single bit use the register name followed by bitsCode:LATBbits.LATB4 = 1i 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