| Electronic Components Datasheet Search |
|
SAFC161PI Datasheet(PDF) 309 Page - Infineon Technologies AG |
|
|
|||||||||||||||||||||||||||||
SAFC161PI Datasheet(HTML) 309 Page - Infineon Technologies AG |
|
309 / 400 page ![]() &3, 7KH ,& %XV 0RGXOH User’s Manual 17-15 1999-08 /*---------------------------------------------------------------*\ | Programming example to read 2 bytes from an NVRAM | | via the I2C bus. | \*---------------------------------------------------------------*/ void main() { // X-peripheral enable: SYSCON |= 0x0004; // set XPEN, before EINIT-instr.!!! // I2C control register configuration: ICCON = 0x0008; // master mode ICST = 0x0000; // reset status register ICCFG = 0x2711; // 100kHz @ 16MHz, SDA0, SCL0 XP0IC = 0x0000; // disable interrupt IRQD, use polling XP1IC = 0x0000; // disable interrupt IRQP, use polling // Port configuration (provide external pullups on I2C-lines!): // (The actual physical port depends on the respective device! // The I2C interface e.g. uses P3 on the C161RI, P9 on the C161SI/CI) _bfld_ ( P*, 0x0003, 0x0003); // enable alternate function on P*.0-1 _bfld_ (DP*, 0x0003, 0x0003); // switch i2c pins to output // slave address ICRTB = 0x0000 | 0xA0; // write transmit buffer ICCON |= BUM; // BUM=1: start cond. + send slave addr. while((ICST & IRQD) == 0x0000); // waiting for end of transmission if (ICST & LRB) // ACK? { ICST &= ~AL; // Clear bit AL ICST &= ~IRQP; // Clear bit IRQP } // sub address ICRTB = 0x0000|0x0000; // send sub-address while((ICST & IRQD)== 0x0000); // waiting for end of transmission if (ICST & LRB) // ACK? { ICST &= ~AL; // Clear bit AL ICST &= ~IRQP; // Clear bit IRQP } |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | 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 |