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.

[SOLVED] SPI Implementation for PIC16F818 Master Help needed

Status
Not open for further replies.

maciuka

Newbie level 4
Joined
Apr 9, 2012
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,336
Hello,

I need some assistance regarding an implementation of a SPI function on a PIC16F818 device i have.I'm finding it very confusing to figure out since each post or tutorial i read presents new C commands and i can't find out which can work with my controller.
What i want to do is connect it via SPI to a A/D converter ( no other pins are available besides these ones ).

Please help me find a basic,easy initialization procedure for a SPI communication protocol with the PIC as master for my device.
I need to have the following configuration :
- controller needs to be master
- clock frequency - whatever,can be adjusted
- clock output pin - RB4/SCL
- data input - RB1/SDA

All advice is welcomed.
Thanks in advance!
 

Hiiiiii...............Actually the IC PIC16F818 has internal ADC so why did u like to have external ADC ? with SPI.....did u have capture ADC requirment is very fast....
 

Will you please tell me which A/D Convertor are u using ?

I'm using an Texas Instruments converter model ADS7867.

I am not using the ADC converter that the PIC has since it is part of a bigger board and those pins are already linked to other functions and i can't alter that link physically.

Thanks!

---------- Post added at 13:33 ---------- Previous post was at 13:28 ----------

Hiiiiii...............Actually the IC PIC16F818 has internal ADC so why did u like to have external ADC ? with SPI.....did u have capture ADC requirment is very fast....

Hello and thanks for the suggestion but i have alot of physical limitations to my project since the PIC is already placed on a board and i have to extend it's functions...therefore the ADC converter the PIC has is already used by another function which i can't remove due to the layout of the board.
 

ok if you are looking for C code check the code on the web-

https://www.microchipc.com/

good luck

---------- Post added at 16:23 ---------- Previous post was at 16:20 ----------

Sorry I send you the wrong link..... here is link where some C codes for SPI is already done

https://www.microchipc.com/sourcecode/

look for this "Example A/D code for 12-bit Texas Instruments TLC2543"

may help you

Good luck
 

ok if you are looking for C code check the code on the web-

https://www.microchipc.com/

good luck

---------- Post added at 16:23 ---------- Previous post was at 16:20 ----------

Sorry I send you the wrong link..... here is link where some C codes for SPI is already done

https://www.microchipc.com/sourcecode/

look for this "Example A/D code for 12-bit Texas Instruments TLC2543"

may help you

Good luck

Thank you very much for the help,i know this website actually but didn't see the example you suggested.It is indeed good.

All the best!
 

Please check the attachment
 

Attachments

  • PIC_Hi-Tech_C_TLC2543_a2d_routines.zip
    1.3 KB · Views: 62

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top