#avr | Logs for 2016-10-02

Back
[04:47:29] <dgriffi> I'm running on 5V and have a resistor ladder worked out for 13 buttons. If I change the operating voltage for the device, do I need to redo the ADC value cutoffs again?
[04:53:20] <sabor> dgriffi: no, it changes with the supply voltage if you use AVCC as positive reference
[04:55:04] <dgriffi> what "it" changes with the supply voltage?
[04:55:50] <sabor> these cutoff voltages
[04:56:38] <dgriffi> I understand that the voltages would necessarily change, but do the 8-bit values I find in ADCH change?
[04:57:43] <sabor> if yu have an external voltage divider connected to AVCC and it outputs 2.5V at 5V AVCC you get 0x80 (or 0x7f) as ADC result, if you change AVCC to 4V you have 2V at the input and still get 0x80 as ADC result
[04:57:58] <dgriffi> Ah! I see.
[04:58:31] <sabor> but you have to choose AVCC as positive reference voltage for the ADC
[04:59:12] <sabor> there are also other reference voltage options which will lead to different results
[05:01:33] <dgriffi> ADMUX?
[05:01:46] <dgriffi> I Was following http://www.marcelpost.com/wiki/index.php/ATtiny85_ADC
[05:02:30] <dgriffi> ah... it looks like I've already been using AVCC as my reference
[05:05:52] <sabor> yeah, you'd probably get unusable results with an other reference
[05:09:12] <dgriffi> sabor: thanks to your patient help, my device firmware is nearly complete
[05:14:14] <sabor> dgriffi: you're welcome
[05:14:41] <sabor> dgriffi: what is it doing when it's finished? is it open source?
[05:14:47] <dgriffi> eventually
[08:49:42] <LeoNerd> How annoying. The Bus Pirate doesn't support I²C clock stretching
[09:30:57] <hetii> hello :)
[09:32:13] <hetii> Q: I have such simple code: http://paste.ubuntu.com/23265076/ and issue with multiplexing 7-segment led display. The first digit on it is more or less brightness then others, depend if I use T_OFF; in ISR
[09:37:44] <sabor> hetii: in the ISR yu have a loop through all of these 7-segment displays in a very short time, then you leave the ISR
[09:38:24] <sabor> that means only the last one ligts up a long time, the others only very short time so they are more ore less invisible
[09:38:33] <hetii> sabor, this is how it looks: http://pasteboard.co/a8qjIbSzA.jpg
[09:39:55] <sabor> wow, pretty bright the other digits, i expected them to be very dark...
[09:40:24] <sabor> there are a few things i would do different:
[09:40:32] <hetii> or like that: http://pasteboard.co/a8snrryBk.jpg
[09:40:50] <hetii> ok i`m glad to hear of your changes :P
[09:41:32] <sabor> 1. don't calculate the digits in the ISR, calculate them in a function called from main, store them in an array of uint8_t
[09:43:04] <sabor> 2. you need a counter which counts which digit is displayed, in the ISR you count it up, then you output the corresponding digit
[09:44:28] <sabor> 3. the set_digit a,d set_char should be interleaved, for example T_OFF; set_char(x); set_digit(y);
[09:45:16] <sabor> the way you did it is a digit is selected and the segments are lit, then you change the segments, and last you change the digit
[09:45:56] <hetii> ok I start to change it in your way ;)
[09:46:11] <sabor> that means the next character is shown on the current digit for a very short time, this could be seen maybe
[10:02:38] <hetii> sabor, now I have like that http://paste.ubuntu.com/23265195/
[10:03:01] <hetii> all digits shine with the same insensitivity but a bit flickering
[10:04:21] <hetii> and also need to remove leading zeros
[10:05:22] <sabor> heh, yeah, a special digit value which means "dark"
[10:05:52] <sabor> how is it flickering?
[10:06:02] <sabor> what's the clock frequency of the CPU?
[10:06:30] <hetii> its default internal oscilator 1Mhz for atmega8
[10:06:55] <sabor> ooh, yeah, then it will update it pretty slow
[10:07:19] <sabor> make the timer run faster to get more updates
[10:07:28] <hetii> yep I set it to: TCNT0 = 235
[10:07:32] <hetii> and looks fine
[10:07:50] <sabor> nice :)
[10:15:50] <hetii> hmm
[12:00:35] <rue_house> the update freq is usually not as important as the duty that the leds are left on
[12:01:07] <rue_house> erm, are you putting an etching tank over a control box?
[12:02:48] <rue_house> hmm, what is that
[12:03:11] <Lambda_Aurigae> Time is a great teacher that eventually kills all of its students.
[12:04:12] <rue_house> mhm
[12:04:37] <Lambda_Aurigae> maybe I should change my name to Time!!!
[12:12:01] <rue_house> is it an etching tank?
[12:12:14] <rue_house> .. if so,.. it realyl should have a drain...
[14:01:58] <hetii> rue_house, yep its etching tank