hi everyone, i've reached send bit bit chip problem is:
the output of chip not working well, following steps @ pages 13 , 14 of ad9761's datasheet, if select high when rising edge of clock , write should phase output, , i've obtained phase , quadrature.
maybe mistake while changing states of signals (clock, select, write , reset).
if me thankful.
in summary:
clock , write(rising edge) + select (high) + reset (low) -> phase output current
clock , write(rising edge) + select (low) + reset (low)-> quadrature output current
here code, i'm sending 1's , 0's. result is: high voltage @ qouta , ioutb (1.2v) , low voltage @ iouta , qoutb (0.4v).
int sel=13; //select signal
int wrt=12; //write signal
int clk=11; //clock signal
int db0=10; //lsb
int db1=9;
int db2=8;
int db3=7;
int db4=6;
int db5=5;
int db6=4;
int db7=3;
int db8=2;
int db9=1; //msb
int rst=0;
int data=0; //value transmit
int i;
void setup() {
pinmode(db0,output);
pinmode(db1,output);
pinmode(db2,output);
pinmode(db3,output);
pinmode(db4,output);
pinmode(db5,output);
pinmode(db6,output);
pinmode(db7,output);
pinmode(db8,output);
pinmode(db9,output);
pinmode(clk,output);
pinmode(wrt,output);
pinmode(sel,output);
pinmode(rst,output);
//while rising first clock , reset high, state machine reset
digitalwrite(clk,low);
digitalwrite(rst,high);
digitalwrite(clk,high);
digitalwrite(rst,low);
}
void loop()
{
digitalwrite(rst,low);
digitalwrite(clk,low);
digitalwrite(wrt,low);
digitalwrite(sel,low);
digitalwrite(sel,high);
data=1023;
(i=0; <= 9; i++)
{
digitalwrite(10-i,bitread(data,i)); // send 1
delay(1);
}
digitalwrite(clk,low);
digitalwrite(wrt,low);
delay(1000);
digitalwrite(clk,high);
digitalwrite(wrt,high);
delay(100);
digitalwrite(sel,high);
data=0;
(i=0; <= 9; i++)
{
digitalwrite(10-i,bitread(data,i)); // send 0
delay(1);
}
digitalwrite(clk,low);
digitalwrite(wrt,low);
delay(1000);
digitalwrite(clk,high);
digitalwrite(wrt,high);
delay(100);
}
the output of chip not working well, following steps @ pages 13 , 14 of ad9761's datasheet, if select high when rising edge of clock , write should phase output, , i've obtained phase , quadrature.
maybe mistake while changing states of signals (clock, select, write , reset).
if me thankful.
in summary:
clock , write(rising edge) + select (high) + reset (low) -> phase output current
clock , write(rising edge) + select (low) + reset (low)-> quadrature output current
here code, i'm sending 1's , 0's. result is: high voltage @ qouta , ioutb (1.2v) , low voltage @ iouta , qoutb (0.4v).
int sel=13; //select signal
int wrt=12; //write signal
int clk=11; //clock signal
int db0=10; //lsb
int db1=9;
int db2=8;
int db3=7;
int db4=6;
int db5=5;
int db6=4;
int db7=3;
int db8=2;
int db9=1; //msb
int rst=0;
int data=0; //value transmit
int i;
void setup() {
pinmode(db0,output);
pinmode(db1,output);
pinmode(db2,output);
pinmode(db3,output);
pinmode(db4,output);
pinmode(db5,output);
pinmode(db6,output);
pinmode(db7,output);
pinmode(db8,output);
pinmode(db9,output);
pinmode(clk,output);
pinmode(wrt,output);
pinmode(sel,output);
pinmode(rst,output);
//while rising first clock , reset high, state machine reset
digitalwrite(clk,low);
digitalwrite(rst,high);
digitalwrite(clk,high);
digitalwrite(rst,low);
}
void loop()
{
digitalwrite(rst,low);
digitalwrite(clk,low);
digitalwrite(wrt,low);
digitalwrite(sel,low);
digitalwrite(sel,high);
data=1023;
(i=0; <= 9; i++)
{
digitalwrite(10-i,bitread(data,i)); // send 1
delay(1);
}
digitalwrite(clk,low);
digitalwrite(wrt,low);
delay(1000);
digitalwrite(clk,high);
digitalwrite(wrt,high);
delay(100);
digitalwrite(sel,high);
data=0;
(i=0; <= 9; i++)
{
digitalwrite(10-i,bitread(data,i)); // send 0
delay(1);
}
digitalwrite(clk,low);
digitalwrite(wrt,low);
delay(1000);
digitalwrite(clk,high);
digitalwrite(wrt,high);
delay(100);
}
i think code has had drink. wanders on place drunken sailor. use tools + auto format before posting code. post code properly, using </> icon.
what code do?
what code do?
Arduino Forum > Using Arduino > Programming Questions > AD9761 programming
arduino
Comments
Post a Comment