View previous topic :: View next topic |
Author |
Message |
akshaymathur39
Joined: 05 Aug 2008 Posts: 11
|
Interfacing AD7680 with PIC |
Posted: Tue Mar 30, 2010 11:41 am |
|
|
Dear Friends,
I am new to A/D converter and wondering if someone has written a driver for interfacing AD7680 with PIC.
Please let me know if somebody has done this. Looking forward to some positive replies.
Best regards,
Akshay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Mar 30, 2010 1:53 pm |
|
|
The AD7680 is similar to the AD7799, which has a driver in this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=41059
But with the AD7680, you can't write to the chip, so the line for
ad7799_write_config(0x0010) should not be called in the
ad7799_init() routine. Just comment that line out.
Also, the 24-bit output data word has 4 trailing zero bits, so it must be
shifted 4-bits to the right, to right-justify it. Just do this to the retval
value, just before it's returned from the ad7799_read_data() routine:
Quote: |
retval >>= 4; // Right-justify the result
return(retval);
}
|
|
|
|
|