Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interface an External ADC

Status
Not open for further replies.

varuntejavarma

New Member
Hello,
I have to interface an external high resolution adc to PIC 18f4550 for a load cell measurement. I am a beginner in programming. I have read the datasheet and have tried to write a little program to interface ADC to pic. I know that i am not correct and missing some things in my program. I am learning by doing.So, i would be glad to know my mistakes and any suggestions. I have attached my program and datasheet of my adc. Please tell me what to do and how to proceed further. Any kind of help is appreciated.

So, my basic idea was to ( in writing to ADC part)
1.write a command and data byte to adc for sys config settings
2. write command and two bytes to adc for adc conf settings

I also read data during this process but send it to dummy as i dont need it

(in reading part):
1.write a command saying that i want to read data from data reg
2.send dummy data and recieve 3 bytes of data from ADC 8 bits at a time

As i said i am a newbie so, pls go easy on me

cheers,
vtv
 

Attachments

  • newmain.c
    6.7 KB · Views: 189
  • DS-HY3106_EN.pdf
    1.6 MB · Views: 576
It would help to know exactly which external ADC chip you're using. From there we can help you with how to write code for it.
 
The PDF is there Jon...

That HY-3106 is a beast... I have been looking at the register set... It seems pretty standard SPI... Some can be SPI "compatible"... but they usually aren't...

I would help but it means buying one to try, and I am not going to do that..... If you picked a more standard ADC I would gladly help...
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top