attiny

ATTiny85 - Software UART with Timer1

拜拜、爱过 提交于 2020-12-06 15:47:31
问题 So recently I tried to implement Software UART (TX only) for the ATTiny85. I want to drive it with the internal Timer1. The timer shall interrupt with the frequency of the Baudrate. Every ISR one bit will be transmitted, until there is nothing left to send and the interrupt will be disabled again. (Note: F_CPU=1000000 ; Fuses are the factory default (E:FF, H:DF, L:62) ) #include <avr/io.h> #include <avr/interrupt.h> #include <util/delay.h> #include <stdint.h> #define SET(reg, pos) (reg |= 1<<

Arduino: Change defines without edit library [solved, bug in compiler, workaround available]

牧云@^-^@ 提交于 2019-12-25 07:25:42
问题 edit: See my answer below I'm fairly new to the Arduino platform and creating now an USB HID project with the attiny85 (Trinket) library of AdaFruit. See also my previous answered question about the options of this library: Change/Override Trinket (attiny85) USB identification name, device name I'm stumped on a rare C-related limitation (see also latest comment at answer in link above to previous question), the separated late binding of binaries by separated compiling. If you want to change

I2C addresses > 63 are not usable with atTiny85

时光怂恿深爱的人放手 提交于 2019-12-25 04:37:52
问题 Hi I have a big problem with addressing multiple attiny85-chips with I2C: For what I know the attiny uses 7-bit addresses for communication. I am using the TinyWireS lib, which works perfectly fine for me, untill I am reaching address: '64' which is '1000000' in binary. The highest usable address should be '1111111'. This is what happens: Slave: Attiny85: switches led on or off when msg is received over I2C. Slaveaddress: 64 #include <TinyWireS.h> #include <usiTwiSlave.h> #define output (4)

tinyAVR: best known multiplication routines for 8-bit and 16-bit factors? [closed]

蓝咒 提交于 2019-12-18 05:12:41
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago . "Faster than avr200b.asm"? The mpy8u -routine from avr200b.asm for those processors of Atmel's AVR family that do not implement any of the MUL instructions seems pretty generic, but mpy16u looks sloppy for rotating both lower result bytes 16 times instead of 8. Antonio presented a

Change/Override Trinket (attiny85) USB identification name, device name

萝らか妹 提交于 2019-12-11 04:59:23
问题 The AdaFruit 'Trinket' library identifies itself as "Trinket HID Combo" when using as USB Keyboard. Is it possible to change this name to more useful name (with some code, constant etc)? I'm using Arduino 1.0.4 IDE. Take a look in the source of this library but cannot find this name hard coded. Any ideas to override this? 回答1: You have to change the Trinket library. Search for USB_CFG_DEVICE_NAME in usbconfig.h #define USB_CFG_DEVICE_NAME 'T', 'r', 'i', 'n', 'k', 'e', 't', ' ', 'H', 'I', 'D',

tinyAVR: best known multiplication routines for 8-bit and 16-bit factors? [closed]

大城市里の小女人 提交于 2019-11-29 08:20:44
"Faster than avr200b.asm"? The mpy8u -routine from avr200b.asm for those processors of Atmel's AVR family that do not implement any of the MUL instructions seems pretty generic, but mpy16u looks sloppy for rotating both lower result bytes 16 times instead of 8. Antonio presented a fast 16×16→16 unsigned multiplication using 64 cycles worst case excluding call/return overhead. I arbitrarily suggest as optimisation goals worst case cycle count , word count (RAM and flash), register usage , and expected cycle count in order of decreasing priority. (There are reduced core AVRs ("single digit"