You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
1I 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! :)blue-phoenix– blue-phoenix2017年01月28日 18:15:08 +00:00Commented Jan 28, 2017 at 18:15
-
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)Andrei Dragan– Andrei Dragan2017年01月28日 18:33:58 +00:00Commented Jan 28, 2017 at 18:33
-
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! :)blue-phoenix– blue-phoenix2017年01月28日 19:26:22 +00:00Commented Jan 28, 2017 at 19:26
-
1Yo 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.Edgar Bonet– Edgar Bonet2017年01月28日 21:32:44 +00:00Commented Jan 28, 2017 at 21:32
-
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.Andrei Dragan– Andrei Dragan2017年01月29日 08:29:59 +00:00Commented Jan 29, 2017 at 8:29