Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[PIC] PIC18F6520 ADC and EEPROM R/W XC8 Compiler Routines

Status
Not open for further replies.

nibin1992

Newbie level 1
Joined
Sep 30, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
9
Sir,
i am doing program for pic18f6520 with mplab x c8 compiler .so i want to get the control function code lists and sample programs for adc conversion, eeprom read and write(want to place a value in ram and ram address want to read from eeprom through indirect addressing mode). So i am eagerly waiting for your reply.
Thanks in advance.
Regards
nibin raj
 

Post your circuit and mention the crystal frequency.
 

Sections 7.3 and 7.4 of the data sheet have example code to read and write the EEPROM. Although they are in assembler, you can 'translate' then easily enough into C. To access the EEPROM you need to put the address into special registers anyway (which are part of the RAM for the device) so the way you want to access the EEPROM (indirectly via RAM) is the required way.
The ADC can be a bit trickier but there are lots of examples on the Internet. The ADC in the device you mention is the same or very similar to the ADCs in many other PIC18F devices so don't be put off if the example processor is slightly different.
Also, the details of how to set up the ADC can vary depending on what exactly you are trying to do. For example, are you looking for multiple channels, how often are you sampling, are you using interrupts etc..
Susan
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top