A few questions on DAC's and Shiftout
i'm using dac , arduino's shift out, i'm having few issues. here's dac: http://search.digikey.com/scripts/dksearch/dksus.dll?detail&name=ltc1446cn8%23pbf-nd
as far can tell it's working because getting voltage out of it. however, can't seem delay work because voltage constant , not delaying. here script:
i know code partially working because when change value data variable changes voltage. also, loosely based on shiftout tutorial here. work better?:
i'm thinking first script didn't let latch pin go low before delay, still high throughout delay. can't test yet (hard @ work...ya know?), later. thought i'd other eyes looking @ before tested theroy.
as far can tell it's working because getting voltage out of it. however, can't seem delay work because voltage constant , not delaying. here script:
code: [select]
int clockpin = 8;
int datapin = 9;
int latchpin = 10;
int data = 250;
void setup ()
{
pinmode (clockpin, output);
pinmode (datapin, output);
pinmode (latchpin, output);
}
void loop ()
{
digitalwrite (latchpin, low);
shiftout(datapin, clockpin, msbfirst, data);
digitalwrite (latchpin, high);
delay (1000);
}i know code partially working because when change value data variable changes voltage. also, loosely based on shiftout tutorial here. work better?:
code: [select]
int clockpin = 8;
int datapin = 9;
int latchpin = 10;
int data = 250;
void setup ()
{
pinmode (clockpin, output);
pinmode (datapin, output);
pinmode (latchpin, output);
digitalwrite (latchpin, low);
}
void loop ()
{
shiftout(datapin, clockpin, msbfirst, data);
digitalwrite (latchpin, high);
digitalwrite (latchpin, low);
delay (1000);
}i'm thinking first script didn't let latch pin go low before delay, still high throughout delay. can't test yet (hard @ work...ya know?), later. thought i'd other eyes looking @ before tested theroy.

im not sure want do, im assuming there shiftregister in there somewhere? delay() dont affect in way, shiftregisters output last set to, , constant.
maybe more trying?
maybe more trying?
code: [select]
int clockpin = 8;
int datapin = 9;
int latchpin = 10;
int data = 250;
void setup ()
{
pinmode (clockpin, output);
pinmode (datapin, output);
pinmode (latchpin, output);
}
void loop ()
{
digitalwrite (latchpin, low);
shiftout(datapin, clockpin, msbfirst, data);
digitalwrite (latchpin, high);
delay (1000);
digitalwrite (latchpin, low);
shiftout(datapin, clockpin, msbfirst, 0x00);
digitalwrite (latchpin, high);
delay (1000);
}
Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > A few questions on DAC's and Shiftout
arduino
Comments
Post a Comment