Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

confirmation help with picc digital pots driver simple c++ ?

Status
Not open for further replies.

VSMVDD

Banned
Joined
Jun 12, 2005
Messages
643
Helped
92
Reputation
184
Reaction score
34
Trophy points
1,308
Location
scotland uk
Activity points
0
with the ds1868 picc drivers


after some testing to confirm that the bit b0 never gets set in the picc driver

for the sout b0 stake select bit

i am right
when i run a simple clocked loading b0.. test design
the status window in isis updates with the bo bit setting

notice below the
cmd[0]=pots[0];
cmd[1]=pots[1];
cmd[2]=0; this shurly should reflect the state of pot_num
being 0 or 1 in value
so would read

cmd[2]=pot_num;

can someone advise me if i am correct in this assumption or maybe i need also to shift its value to the msb of that byte with a shift<<7 or something similar


if i am right i have fixed the last issue
{not a problem with the the designs or the dll it runs fine purly in picc}



void set_pot (int pot_num, int new_value) {
BYTE i;
BYTE cmd[3];
BYTE pots[2];
if (pot_num >= NUM_POTS)
return;

pots[pot_num] = new_value;

cmd[0]=pots[0];
cmd[1]=pots[1];
cmd[2]=0; //<<<here

for(i=1;i<=7;i++)
shift_left(cmd,3,0);

output_high(RST1);
delay_us(2);
for(i=1;i<=17;i++) {
output_bit(DI, shift_left(cmd,3,0));
delay_us(2);
output_high(CLK);
delay_us(2);
if(i==17)
output_low(RST1);
output_low(CLK);
delay_us(2);
}
}
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top