Ich versuche momentan zwei LTC1257 unabhängig voneinander anzusteuern. Für einen Chip habe ich es anhand des C-Beispiels aus der Codesammlung schon hinbekommen, aber ich weiss nicht, wie ich einen weiteren Chip ansteuern kann? Gibt es zufällig noch einen Schnipsel C hier, der das skiziert? Vielen Dank & Schöne Grüße! Hans
…es klappt: unfassbar!
ich habe die write-funktion umgebaut und ein bisschen trial & error
habens gemacht:
inline void ltc1257_ll_write(unsigned int data, unsigned int data2)
{
volatile unsigned char bitctr = 0;
for(bitctr = 0; bitctr < 0x0C; bitctr++)
{
DACDATA(data & 0x800); /* output MSB (bits [11..0]!) */
data <<= 1; /* shift next bit to MSB */
DACCLK(LEV_HIGH); /* rising edge -> load bit */
DACCLK(LEV_LOW); /* -> await rising edge */
}
for(bitctr = 0; bitctr < 0x0C; bitctr++)
{
DACDATA(data2 & 0x800); /* output MSB (bits [11..0]!) */
data2 <<= 1; /* shift next bit to MSB */
DACCLK(LEV_HIGH); /* rising edge -> load bit */
DACCLK(LEV_LOW); /* -> await rising edge */
}
DACLOAD(LEV_LOW); /* load pulled low -> output */
for (bitctr = 0; bitctr < LATCHTIMING; bitctr++)
;
DACLOAD(LEV_HIGH); /* load pulled high -> idle */
}
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.