attiny | ATtiny microcontroller support for the Arduino IDE

 by   damellis C Version: Current License: No License

kandi X-RAY | attiny Summary

kandi X-RAY | attiny Summary

attiny is a C library typically used in Internet of Things (IoT), Arduino applications. attiny has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

This repo contains a set of "cores" which adds support for some members of the Atmel AVR ATtiny family of microcontroller to the Arduino IDE.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              attiny has a low active ecosystem.
              It has 631 star(s) with 206 fork(s). There are 84 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 29 open issues and 68 have been closed. On average issues are closed in 271 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of attiny is current.

            kandi-Quality Quality

              attiny has 0 bugs and 0 code smells.

            kandi-Security Security

              attiny has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              attiny code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              attiny does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              attiny releases are not available. You will need to build from source code and install.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of attiny
            Get all kandi verified functions for this library.

            attiny Key Features

            No Key Features are available at this moment for attiny.

            attiny Examples and Code Snippets

            No Code Snippets are available at this moment for attiny.

            Community Discussions

            QUESTION

            Progamming inside a Attiny85 with rust
            Asked 2022-Feb-14 at 17:08
            Introduction

            I created a small project that uploads C++ code to an Attiny85, for this I used arduino.

            Question

            But I would have liked to know if it was possible to download and run rust code in Attiny85 or other Attiny. If we can, how do we do it?

            Details

            I found this GitHub repo to do this, but it is not explicit on how can export the rust code to Attiny. The GitHub repo in question: https://github.com/q231950/avr-attiny85-rust?ref=https://githubhelp.com

            ...

            ANSWER

            Answered 2022-Feb-14 at 17:08

            C++ is cross-compiled to AVR machine code on your development host. What you are loading is not C++ code; that is the source code used to generate the machine executable binary code, which is what you load..

            You can develop for AVR using any language for which a cross compiler exists. Rust is certainly such a language. This article discusses using Rust on Arduino Uno hardware.

            Whether ATTiny85 with only 8Kb of Flash and 512 bytes of SRAM will support a Rust runtime environment and any useful code I cannot tell; I am not familiar with Rust's runtime requirements, but it does not seem like an efficient use of limited resources to me, and I would treat it as an academic challenge rather than a practical development approach. I would expect Rust to have a considerably larger run-time footprint than C or even C++.

            Source https://stackoverflow.com/questions/71096073

            QUESTION

            ATTiny85 Interrupts in Arduino IDE
            Asked 2021-Nov-25 at 00:12

            I have an ATTiny85 which I program using a sparkfun programmer (https://www.sparkfun.com/products/11801) and the ATTiny Board Manager I am using is: https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json

            Below is my code, I am having trouble getting the interrupt to work when I ground Pin 2. I have tested the LED does work outside of the interrupt (inside the loop). Any suggestions are welcome.

            ...

            ANSWER

            Answered 2021-Nov-16 at 04:27

            I see one possible error with your Boolean data type. Boolean data types are either true or false. I see that your using it for variable lastState. The initialization to equal 0 is something that I don't think the compiler allows. Maybe you should try setting the bool variable to the following...

            Source https://stackoverflow.com/questions/69983525

            QUESTION

            How to downsize code that uses DHT11 for AVR (Attiny45)
            Asked 2021-Nov-09 at 12:55

            I'm trying to build a small hygrometer based on the DHT11 and I'm having a bit of an "issue" with the code size. I want to run it on an Attiny45 and it's a wee bit too big (352 bytes too big to be exact). I am aware that I could just use an Attiny85 and have space to spare or don't use a bootloader and barely fit it in (94%) but I kind of want to make my life harder than it needs to be and figure out how to reduce size since it'll probably come in handy in the future. Treat it as a learning experience if you will.

            What it's supposed to do:

            • Read DHT11 input
            • Display results on 2 two-digit 7-segment displays (so I guess 4 7-segments in total)
            • Go to sleep most of the time to preserve battery
            • Wake up every 8 seconds to update sensor values (without turning on the display)
            • Wake up on a button press to display the values for humidity and temperature

            Side note: 7-segments are adressed via two 74HC595s of which I am using 7 outputs each for the displays and 1 each for a transistor that connects the display in question to GND. There's a schematic at the bottom if you're interested.

            As pointed out, my main issue is code size so if anyone has any tips on how to reduce that (or any other tips how to improve the code) please let me know.

            I hope I'm asking the question properly, if not please let me know.

            Compiler output:

            ...

            ANSWER

            Answered 2021-Nov-09 at 12:55

            Okay so thanks to the input of Mat I tried substituting the DHT11 library with something more sleek, which took me a while to get up and running. I ended up using this as a base, edited around a bit and commented heavily for my benefit. I added my updated code below for anyone interested (thanks for pointing out the correct highlighting issue), there's also a github with the rest of the design files.

            Seems the library is really heavy, as the compiler output shows:

            Compiler output:

            Source https://stackoverflow.com/questions/69867327

            QUESTION

            Compiling Error with interrupt service routines for ATtiny using xc8
            Asked 2020-Aug-04 at 20:42

            I am working on a project using an ATtiny 202 and I am nearly done with my programming, but I have run into a large problem. I can't create any ISRs, because I always get a compiler error.

            I am using the newest version of MPLABX IDE (5.35) (yes it is for pic and avr mcus) and the second newest version of the xc8 compiler (v2.10). I cannot use the newest version of the compiler, because that is for some reason missing the device header for the ATtiny 202. (I had a different thread about that problem a while ago)

            I have created the ISRs exactly like described in the XC8 Manual, and the IDE doesn't mark it as a problem either, but when I then try to compile the program I always get a compiler error. Here is one of my ISRs:

            ...

            ANSWER

            Answered 2020-Aug-04 at 20:42

            Fixed:

            I had posted this question on the microchip forum as well, as no one here seemed to be able to help.

            So I figured out that the problem was that in the project properties under

            XC8 Global Options -> XC8 Compiler -> Option categories: Preprocessing and messages

            the option "Use CCI Syntax" was disabled. This needs to be enabled for the __interrupt to work.

            Source https://stackoverflow.com/questions/62983899

            QUESTION

            UDR register always reads 0xFF
            Asked 2020-Aug-04 at 15:42

            I have an ATTiny that is supposed to receive commands over UART. I have a simple display of eight LEDs that should show the contents of the most recent byte received. I am using an interrupt to read data as it is received. No matter what data I send UDR always reads 0xFF in the interrupt. I know the interrupt is being triggered since the display changes from 0x00 to 0xFF, but it never displays the value I sent over the serial bus.

            This is how I enable UART.

            ...

            ANSWER

            Answered 2020-Aug-04 at 15:42

            There can be several problems with uart communication. First check some things:

            1. Is controller configured with the right clock?
              • Internal/External
              • Is F_CPU defined for ?
              • Is BAUD defined for ?
              • Are you using a controller like ATmega16 that has special register access?
              • If you are using an external clock (that should not be devided) is CKDIV8 disabled in FUSES or in special registers at some controllers?
            2. Is:
              • Baudrate,
              • Paritybit,
              • Stopbit setup corret on Transmitter and Receiver

            Debug:

            • If you are using a PC for communication, create a loopback at the UART adapter and check with a terminal (TeraTerm, Putty, ...) if the messages you send are received correctly.
            • You also can enable the TX controller and check if loopback is working on your uC.
            • If it is possible try to write the received data to some leds to check if some date is received
            • Is GND betweend receiver and transmitter connected?
            • Are the voltage levels between transmitter and receiver the same?
            • Do transmitter and receiver have its own source? (Then do not connect VCC!)
            • Check if the clock on the controller is correct (switch on an led with _delay_ms() function every second)

            Example Program

            Source https://stackoverflow.com/questions/63237743

            QUESTION

            Supported Arduino functions on ATTinyCore by SpenceKonde
            Asked 2020-Jul-14 at 15:24

            I've just discovered the ATtiny84/85 chips and have ordered a few to use in some projects. I've looked high and low for all the support it has for programming through the Arduino IDE and Uno and have come across high-low tech's website and the supported arduino functions in that core.

            Then I came across SpenceKonde's ATTinyCore which is another highly regarded core for the ATTiny series. The problem is that I can't find any information as to what classic Arduino functions this core supports. I mean like a list. I'm sure the basic functions are supported but how about using sleep mode / low power mode and a few other things. Is everything in the Arduino.h library supported?

            Sorry if this is a silly question but a little help would be much appreciated.

            ...

            ANSWER

            Answered 2020-Jul-14 at 15:24

            I have contacted DrAzzy a.k.a Spence Konde on the Arduino Forum regarding this matter and I'm going to quote his reply to me down below.

            ATTinyCore (and my other cores) implements all of the standard Arduino API functions that are logically coherent for the hardware in question. Everything should work, even the stuff that I think is a dumb idea (eg, SerialEvent, yield()) - if it doesn't, it should be reported to me as a bug. There are only a few places where I knowingly departed from the official Arduino behavior

            Stuff that isn't arduino API, like the stuff that's included with avrlibc, has no dependence on the core whatsoever. If the hardware supports it, those libraries should work. If it fails to compile with the library (or a specific call in the library) in the sketch (generally giving either a #error saying it's unsupported, or an "undefined reference" to a register or bit name - actually calling it at a sensible time or uploading and verifying it behaves the way you want is usually unnecessary)

            Hope this helps you guys. Thanks again to Spence Konde (DrAzzy) for the amazing ATTinyCore and his help in this matter.

            Source https://stackoverflow.com/questions/62859404

            QUESTION

            ATTINY 85 SLEEP MODE
            Asked 2020-Jan-29 at 14:35

            I am new to programming microcontrollers and I've just started using Attiny85. I am trying to build a circuit for LED with tactile switch. Every time the tactile switch is pressed it jumps the LED to next state of operation. Since it is battery operated, when the LED is OFF I want the attiny 85 to consume as low current as possible. As of now it is consuming 4mA when the LED is OFF without sleep mode. So I tried the power down mode for Attiny 85 but some how i am stuck in the power down mode

            ...

            ANSWER

            Answered 2020-Jan-29 at 14:35

            Please refer to the datasheet, section 7.1 Sleep Modes at page 34.

            In the table you can see, in Power-down mode only 3 sources can wake up the CPU:

            1. INT0, only level interrupt and pin change interrupt
            2. USI module start condition
            3. Watchdog interrupt

            That means, if you want the part to wake up when button has been pressed, then best option will be to configure the pin change interrupt.

            First you need to configure an interrupt service routine (ISR). The ISR is required just to handle the interrupt event, without it the program will be restarted. Since there is no action required, the ISR can be empty:

            Source https://stackoverflow.com/questions/59908541

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install attiny

            Following the [installation guide](http://hlt.media.mit.edu/?p=1695) to install the core files and follow [this guide](http://hlt.media.mit.edu/?p=1706) to find out how to build the circuit. Also check out this video from Make which explains how to setup and use this core.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/damellis/attiny.git

          • CLI

            gh repo clone damellis/attiny

          • sshUrl

            git@github.com:damellis/attiny.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link