#avr Logs

Nov 29 2020

#avr Calendar

10:01 AM * fstd notes that accidentally tying a pin to VCC and then driving it low is not the best idea
10:16 AM LeoNerd: Yeah each half is separate
11:25 AM luxemboy1 is now known as luxemboye
11:48 AM Rab: And you should disable both if you're sleeping, because each sucks up a bunch of power (relatively speaking).
11:49 AM LeoNerd: Huh... Does TX actually consume power if it's not transmitting?
11:49 AM cehteh: likely
11:50 AM cehteh: little but the clock is running and hardware unit is activated
11:50 AM LeoNerd: Also, usually if I've enabled the UART RX at all it's because I specifically want to wake from sleep, so.. I wouldn't disable /that/ while sleeping
12:17 PM Rab: LeoNerd, it does, and in sleep mode.
12:19 PM Rab: I characterized the difference, it's something like a few tenths of a mA. Not a lot for some applications, but I needed a long battery standby time.
12:20 PM LeoNerd: I seee... Useful to keep in mind, thanks
12:22 PM cehteh: Rab: the AVR's have power reduction registers and more, going to 'proper' sleep can be a bit more involving
12:23 PM cehteh: setting PUD (pullup disable) turn off all unused hardware parts etc
12:23 PM Rab: I should specify, that was an ATmega88PB.
12:31 PM cehteh: add a diagostic pin (or more) add led there turn it of when going to sleep, on when woken up
12:31 PM cehteh: often enough a small error can lead to improper sleep, also measure current while sleeping
12:31 PM Rab: And I'd have to check, but I think some pull-ups have to be enabled in sleep mode for certain peripheral parts on the board. But thanks for the tip, I'll take a look at that.
01:14 PM fstd: what JTAG adapter do you guys use for your in-circuit debugging purposes on linux-ish?
01:16 PM rue_bed: I dont use jatag for debugging, never have, never needed to
01:16 PM rue_bed: are you debugging your own code or stuff written by other people?
01:18 PM LeoNerd: There's only a rare few AVR chips that talk JTAG anyway
01:18 PM LeoNerd: I find I mostly work with ATtinys actually, and none of them do
01:18 PM fstd: it would be my own code, and well i'm not debugging anything right now, but i'm wondering whether it might be useful in the future
01:18 PM fstd: wait, what?
01:19 PM fstd: i feel like every avr i've used so far had a jtag section in its datasheet
01:19 PM twnqx: i have a jtag mk1 clone i use for programming of an at90 series
01:19 PM LeoNerd: You must have picked the rare few ones that do
01:19 PM twnqx: but uh.. i gave up trying to set up debugging
01:19 PM LeoNerd: None of the modern ones I can think of do JTAG.. None of the ATtiny 0-, 1-, or 2-seires. Or the ATmega 0-series
01:19 PM LeoNerd: They're all the single-pin UPDI
01:21 PM fstd: i've so far mostly used atmega 8/16/32 and attiny 26, 2313, 13
01:23 PM LeoNerd: Mm.. yeah those are all really old chips ;)
01:24 PM fstd: i like them :)
01:24 PM fstd: especially the tiny2313
01:24 PM LeoNerd: If you want a modern 20pin tiny, you want the tiny1616
01:24 PM LeoNerd: Lovely chip
01:25 PM LeoNerd: The tiny2313 has UART, USI (which isn't even real I²C), and.. er. I think that's basically it.
01:25 PM LeoNerd: tiny1616 has UART, real I²C, real SPI, four timer modules having in total I think about 8 PWM output pins, ADC, DAC, ... Oh an interrupts on /every/ pin
01:26 PM fstd: but is the tiny1616 available in a DIL package? i don't like SMT very much, it's a pain to solder
01:26 PM LeoNerd: None of the new chips are. Stop expecting it. It isn't going to happen
01:27 PM LeoNerd: If you /really/ insist on DIP'ing it, get a breakout board. Either buy one of mine [by the way I sell them ;) ], or just get any ol' SMD adapter board
01:27 PM fstd: or i just stick to ol' reliable? ;)
01:28 PM LeoNerd: I just outright refuse to use any of the older chips that lack the modern peripherals these days.
01:28 PM LeoNerd: E.g. that USI thing. It kinda sucks. It's -terrible- at I²C
01:29 PM LeoNerd: I have wasted many hours trying to implement an I²C slave on that. It'd be done in 5 minutes on a modern chip
01:29 PM LeoNerd: Or the stupid juggling of trying to assign peripherals around to avoid interrupt pins. The new chips have interrupt on /every/ pin
01:29 PM fstd: some years ago i wrote some uart routines in assembly that used the USI
01:29 PM fstd: seemed reasonably straightforward
01:29 PM LeoNerd: UART on USI is horrible.. for one, it requires bitswapping
01:30 PM LeoNerd: If I really need virtual UART I just bitbang it directly with a timer module... it doesn't need much hardware support
01:33 PM fstd: well, it went okay for me. i can't imagine an i2c device to be much more difficult
01:33 PM fstd: maybe the problem wasn't the USI :)
01:34 PM LeoNerd: It's just all the fiddly cornercases
01:35 PM LeoNerd: And I still don't think I have multiple byte read operations working correctly