View Full Version : ShiftIN to read DAC7611
RFsolution
- 9th February 2011, 21:54
Hi all,
I have an excisting hardware which is using a DAC7611 digital to analog converter
I would like to read the LD,SDI,CS/,CLK with a 16F876 and get the DAC 12bit value in a variable.
Looking to the datasheet it is not clear to me how to use the shift-in command
on the original hardware the following pin's of the DAC7611 are wired:
Pin1: VDD
Pin2: CS/
Pin3: CLK
Pin4: SDI
Pin5: LD
Pin6: CLR/ wired to VDD
Pin7: Gnd
Pin8: Vout
The datasheet can be found here: http://www.datasheetcatalog.org/datasheet/BurrBrown/mXrrtqx.pdf
Anyone who can point me in a good direction ?
Ioannis
- 10th February 2011, 12:53
Since the DAC will get data from the controller, you have to use the SHIFTOUT command not SHIFTIN.
Then you have to control before the command, the LD,CS lines to prepare the DAC for communication.
Then use the SHIFTOUT command to send the data to the DAC.
The command needs to have the DataPin (SDI), ClockPin (CLK) and Mode defined. So choose your PIC pins and Mode as MSBFIRST (mode No 1) according to the DAC specs.
e.g. for Data on port A pin 0, and Clock on Port A, pin1 you have to use:
SHIFTOUT PORTA.0, PORTA.1,1,WORD_VAR\12
\12 indicates that you will sen only the left most 12 bits of WORD_VAR.
Ioannis
RFsolution
- 10th February 2011, 19:25
Since the DAC will get data from the controller, you have to use the SHIFTOUT command not SHIFTIN.
Then you have to control before the command, the LD,CS lines to prepare the DAC for communication.
Then use the SHIFTOUT command to send the data to the DAC.
The command needs to have the DataPin (SDI), ClockPin (CLK) and Mode defined. So choose your PIC pins and Mode as MSBFIRST (mode No 1) according to the DAC specs.
e.g. for Data on port A pin 0, and Clock on Port A, pin1 you have to use:
SHIFTOUT PORTA.0, PORTA.1,1,WORD_VAR\12
\12 indicates that you will sen only the left most 12 bits of WORD_VAR.
Ioannis
Hi Ioannis,
Thanks for your reply, maybe I expressed myself bad.
The excisting circuit is talking to the DAC7611, and i would like to get the information/value send to the DAC, with a small MCU
So should be Shift-in but timing etc is not clear to me
Thanks
inadvance
Ioannis
- 11th February 2011, 08:32
Oh,I see.
Well, you still have to monitor the LD, CS lines when they become active and then start the SHIFTIN command to collect the data.
Ioannis
Powered by vBulletin® Version 4.1.7 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.