60 likes | 211 Vues
CS423 Dick Steflik. Universal Serial Interface USI. What is it for?. Basic hardware needed for serial comm: SPI (4-wire bus) MMC/SD Ethernet, UARTs, USARTs, JTAG (IEEE 1149.1) I2C/TWI (Inter-Integrated Circuit) (2/3-wire bus)
E N D
CS423 Dick Steflik Universal Serial InterfaceUSI
What is it for? • Basic hardware needed for serial comm: • SPI (4-wire bus) • MMC/SD • Ethernet, UARTs, USARTs, • JTAG (IEEE 1149.1) • I2C/TWI (Inter-Integrated Circuit) (2/3-wire bus) • appropriate for peripherals where simplicity and low manufacturing cost are more important than speed • Accessing DACs and ADCs • Interfacing OLEDs/LCDs • Computer diagnistic sensors (fans, overtemp)
USI Data Register • 8-bit, parallel load/read shift register • SFR I/O8 (0x0F) • Port B • PB5 - DI/SDA • PB6 - DO • PB7 – UCSK/SCL • Must set DDR for Port B appropriately • Data must be read from USIDR immediately as the register is not buffered
USI Status register • 7 – USISIF – Start Cond. Interrupt Flag • 6 – USIOIF – Counter Overflow Interrupt Flag • 5 – USIPF – Stop Cond. Interrupt Flag • 4 – USIDC – Data Output Collision • 3 – USICNT3 – 4-bit Counter MSB • 2 - USICNT2 • 1 - USICNT1 • 0 – USICNT0 – 4-bit Counter LSB
USI Control Register • 7 – USISIE – Start Cond. Interrupt Enable • 6 – USIOIE – Counter Overflow Interrupt Enable • 5 & 4 - USWWM1..0 – Wire Mode • 3 & 2 - USICS1..0 – Clock Select • 1 – USICLK - • 0 – USITC – USI Timer/Counter Strobe bit