Skip to main content
Arduino

Timeline for Analog inputs on ATtiny85 don't work

Current License: CC BY-SA 3.0

8 events
when toggle format what by license comment
Jan 29, 2017 at 8:29 comment added Andrei Dragan Take an SD card application, it's good practice to use pull-ups on the SPI line in this case because a floating line (in the order of milliseconds, until the SPI communication is initialized) can cause problems on the SD card, possibly injecting unwanted signals onto it. It's unlikely but at least one time in our life we've seen the "This media is corrupted, reformat it bla bla" message, that's where the pull-ups on the data lines come in handy, to help you avoid that.
Jan 28, 2017 at 21:32 comment added Edgar Bonet Yo wrote "Any type of communication protocol uses pull-up resistors". No. I2C does use pullups, but neither SPI nor asynchronous serial does. The OP's problem has nothing to do with pullups: it's the serial ports (of the ATtiny and the one on the other end) actively driving the line to Vcc.
Jan 28, 2017 at 19:26 comment added blue-phoenix At the moment I'm not sure what the final setup will look like. Originally I have not planned to use serial communication, this was more for testing purposes just as the two LED's, but I will need at least one output for controlling the relay. But I think having the exact voltage can be quite useful. For now I have changed the serial configuration in that way so that I'm only using the TX pin (PB4) for sending the data. So I can read the exact results and using PB3 as A3 as sensor input. Everything is working now and I'm getting correct voltage values. Thank you again! :)
Jan 28, 2017 at 18:33 comment added Andrei Dragan You cannot get the ADC to work properly on the pins that the serial communication is using (that lines are going to be pulled up either by the attiny or the other thing you're trying to communicate with, in your case the usb-serial chip). In your current configuration you can't do much about it without losing some of the data you want: you can either measure both of the voltages at once with the help of 2 diodes or you can get rid of the serial communication. As an alternative you can use another chip (attiny84, which has 11 pins, 8 of which are ADCs)
Jan 28, 2017 at 18:26 history edited Andrei Dragan CC BY-SA 3.0
added 3 characters in body
Jan 28, 2017 at 18:16 vote accept blue-phoenix
Jan 28, 2017 at 18:15 comment added blue-phoenix I though I already tested it without. But it seems as I made some mistake. After disabling the serial communication it seems to work. Is there a way to change the serial pins to get the exact voltage via serial com? Thank you! :)
Jan 28, 2017 at 17:48 history answered Andrei Dragan CC BY-SA 3.0

AltStyle によって変換されたページ (->オリジナル) /