Electronic Components Datasheet Search |
|
AD7707 Datasheet(PDF) 43 Page - Analog Devices |
|
|
AD7707 Datasheet(HTML) 43 Page - Analog Devices |
43 / 53 page AD7707 Rev. B | Page 42 of 52 Writetoreg (int byteword); { int q; SPCR = 0x3f; SPCR = 0X7f; /* this sets the WiredOR mode (DWOM=1), Master mode (MSTR=1), SCK idles high (CPOL=1), /SS can be low always (CPHA=1), lowest clock speed (slowest speed which is master clock /32) */ DDRD = 0x18; /* SCK, MOSI outputs */ q = SPSR; q = SPDR; /* the read of the status register and of the data register is needed to clear the interrupt which tells the user that the data transfer is complete */ PORTC &= 0xfb; /* /CS is low */ SPDR = byteword; /* put the byte into data register */ while (! (SPSR & 0x80)); /* wait for /DRDY to go low */ PORTC |= 0x4; /* /CS high */ } Read (int amount, int reglength) { int q; SPCR = 0x3f; SPCR = 0x7f; /* clear the interrupt */ DDRD = 0x10; /* MOSI output, MISO input, SCK output */ while (PORTC & 0x10); /* wait for /DRDY to go low */ PORTC & 0xfb ; /* /CS is low */ for (b=0;b<reglength;b++) { SPDR = 0; while (! (SPSR & 0x80)); /* wait until port is ready before reading */ *datapointer++=SPDR; /* read SPDR into store array via datapointer */ } PORTC|=4; /* /CS is high */ } |
Similar Part No. - AD7707_17 |
|
Similar Description - AD7707_17 |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.COM |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Datasheet Upload | Contact us | Privacy Policy | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
Family Site : ic2ic.com |
icmetro.com |