attiny85-i2c-pwm

所属分类:单片机开发
开发工具:C
文件大小:9KB
下载次数:0
上传日期:2020-07-17 12:58:24
上 传 者sh-1993
说明:  基于ATTiny85的I2C控制场PWM发生器
(I2C controleld PWM generator based on ATTiny85)

文件列表:
Makefile (1135, 2018-03-20)
bits.h (411, 2018-03-20)
board (0, 2018-03-20)
board\attiny85-i2c-pwm.bak (6258, 2018-03-20)
board\attiny85-i2c-pwm.pro (1252, 2018-03-20)
board\attiny85-i2c-pwm.sch (6552, 2018-03-20)
config.h (158, 2018-03-20)
main.c (1064, 2018-03-20)
twi.c (8689, 2018-03-20)
twi.h (580, 2018-03-20)

# ATTiny85 - I2C - PWM This is a firmware for ATTiny85 microcontrollers providing a PWM signal controlled via I2C. The microcontroller acts as a I2C slave and allows a single byte write operation which is used unmodified as PWM output value. ## Pins and Wiring Beside the usual `VCC` and`GND` pins, the following pins are used: * 5 (`PB0`) - I2C SDA * 6 (`PB1`) - PWM output * 7 (`PB2`) - I2C SCL The I2C pins utilize the internal pull-ups but external pull-up resistors should be added according to the specifications. ## Configuration The configuration can be done by mondifying `config.h` accordin to the needs. Right now, there are only two options to set: * `TWI_ADDRESS` - Contains the address of the slave on the I2C bus. This must only contain the leading 7 bit of the address without the R/W flag. * `PWM_PRESCALER` - The prescaler to use for the PWM output. See Table 12-5 in the ATTiny85 datasheed vor valid values. All settings are relative to 8MHz CPU frequence.

近期下载者

相关文件


收藏者