Using peripherals:Hardware resource implications,Reliability and safety implications.

Hardware resource implications

I2C requires the use of two port pins. This is considerably fewer than would be required to create a parallel interface to most peripheral devices.

There is, however, a significant CPU load: see ‘Solution’ for details.

Reliability and safety implications

The I2C protocol incorporates only minimal error-checking mechanisms: detection of data corruption (for example) during the transfer of information to or from a peripheral device must be carried out in software, if required. However, in most cases, damage to cabling will be quickly detected.

Portability

I2C is a simple protocol and may be easily generated in software. This allows the tech- niques presented here to be used with all 8051 devices.

Overall strengths and weaknesses

I2C is supported by a wide range of peripheral devices.

I2C requires only two port pins to connect to (typically) up to 20 peripherals.

I2C is a simple protocol and may be easily generated in software. This allows

all 8051 devices to communicate with a wide range of peripheral devices. A common set of software code may be used with all I2C peripherals.

Although I2C is fast enough (even when generated in software) to be compatible with time-triggered architectures, typical data transfer rates will be comparatively slow (up to 1000 bytes / second with a 1 ms scheduler tick).

Related patterns and alternative solutions

See SPI PERIPHERAL [page 521].

Remember also that, if possible, the best approach is to avoid peripherals altogether and use a microcontroller with on-chip facilities if possible. For example, rather than using a basic 8051 plus serial EEPROM, consider using the Atmel AT89LS8252, which has two kbytes of EEPROM on the chip.

Leave a comment

Your email address will not be published. Required fields are marked *