#avr Logs

May 10 2017

#avr Calendar

12:49 AM Xark- is now known as Xark
01:14 AM c4017_: If my vcc is 3 volts and I apply 5 volts through a large resistor to an input pin, will the mcu be damaged? As long as the current going into the pin is < ~1 mA, the protection diodes should just shunt it to vcc, right?
01:17 AM Snert: 50KV and a billionMeg resistor will prolly kill it. 12V and a smaller R may not.
01:17 AM Snert: what is the order of magnitude.
01:18 AM Snert: 5v may not kill it. But why other than accident.
01:18 AM Snert: like...is it really dead now?
01:19 AM c4017_: I'm just designing a board and trying to avoind putting another pulldown resistor on zener diode on the pin to save sapce
01:19 AM c4017_: or zener*
01:19 AM c4017_: I need someway to detect if external power is being applied, with minimal components
01:20 AM c4017_: datasheet says nothing about maximum input currnet on a pin...
01:26 AM c4017_: heh, according to AVR182, you can put mains voltage on a pin through a 1M resistor. I think I'll be fine
02:36 AM rue_house: thats because the current from the 170V peak thru the 1M is not more than the protection diodes on the avr pin can handle
02:37 AM polprog: bad idea
02:38 AM polprog: at least use a voltage div
02:55 AM Casper: c4017_: atmel use 2M to 240VAC
03:11 AM skz81: <polprog> http://www.harbaum.org/till/nanovm/index.shtml >> Impressive piece of masochism !! ^^
03:20 AM Emil: c4017_: the datashit does specify that sink and source current capability is around thr same
03:20 AM Emil: iirc sinking is slightly better
03:26 AM c4017_: Emil, that's regarding output mode though. It specifies what the push/pull transistors are cabable of. I was looking for a spec of the maximum current through the pin protection diodes. That app note suggests around 1 mA
03:36 AM Emil: oh you meant that
06:24 AM hetii: Hi:)
06:33 AM hetii: I use such circuit: https://snag.gy/IFXsGE.jpg and have no clue why, but as soon as I put mcu into socket my triac are on, even when the ports are in high-z state, I also test other port configuration without result
06:34 AM hetii: so wonder if that can happen cause avrs have internal diodes in each pins
06:47 AM Emil: might be
06:47 AM Emil: is that mains?
06:47 AM Emil: 230V?
06:49 AM hetii: yes
07:10 AM hetii: hmm
07:10 AM hetii: its odd even when I just add transistor between gate and gnd or vcc, then traic is on
07:15 AM Thrashbarg: I hope you're testing this on an isolation transformer
07:18 AM hetii: don`t worry :)
07:30 AM hetii: Ok I found the reason
07:30 AM hetii: I select other type of triac when design pcb that have cross A1 with A2
07:31 AM hetii: so it make difference with one terminal of triac is where when we have common main line
07:36 AM Emil: why is your live and neutral reversed btw?
07:37 AM Emil: I mean, "it doesnt matter" but my it is absolutely #triggard
07:37 AM hetii: because the plan was to put this board near wall switch so, such switch in most case control main line not neutral
07:37 AM Emil: s/my //
07:38 AM hetii: and also according this: http://electromotiveforces.blogspot.com/2011/05/automatic-night-light-circuits.html
07:40 AM hetii: its better to have common main,so operating the triac in quadrants 2 and 3
08:42 AM Emil: "common mains" makes no sense ;)
09:13 AM rue_house: you can also put a mosfet in the middle of a bridge rectifier, you lose the 1.4V of the rectifier on your switched line, but thats usually not an issue
12:09 PM xentrac: the mirror of the kicad library from library.oshec.org might be http://blog.spitzenpfeil.org/wordpress/wp-content/uploads/2009/04/alltar.gz
05:28 PM daey_ is now known as daey
06:45 PM jchillerup: hi, is it possible to write to .text flash from within .text?
06:46 PM jchillerup: I have set my lock byte to 0xFF and am using boot_page_fill and boot_page_write_safe respectively
06:47 PM jchillerup: Not much luck... What I want to do is to be able to load a new program on to the AVR from a comms channel that's not available to the bootloader. So the plan is to load the new program at some address (say, 0x4000) and copy it into the right spot in the bootloader
07:15 PM Emil: jchillerup: there's a couple of hacks that allow you to do it
07:15 PM Emil: jchillerup: the speshul instruction iirc locks only after you have written the last page of flash so you have n-1 pages of flash to use
07:16 PM Emil: That means you stay in the bootloader forever
07:16 PM Emil: jchillerup: but it is also possible to overwrite flash from application space
07:16 PM Emil: though it requires a lot more hacking
07:26 PM jchillerup: Emil: Staying in bootloader forever would work
07:27 PM jchillerup: I've been looking at the optiboot bootloader (the majekw fork) that can do it too
07:27 PM jchillerup: Then I just need the copying part of it
07:29 PM jchillerup: This optiboot fork has the copying functionality: https://github.com/kgyrtkirk/optiboot - although it'd need some porting to have it working on the atmega2560
08:01 PM jchillerup: Emil: Oh, I actually managed to get the majekw fork to work on atmega2560... So I can write to flash now: rad. Now I just need to further modify the bootloader to copy stuff in at the right place
08:01 PM Emil: that's pretty cool
08:01 PM Emil: good job
08:02 PM jchillerup: :)
08:05 PM Emil: That also saves on bom so it's nice
08:06 PM Emil: I wonder what's the overhead of it
08:06 PM Emil: Personally I would design a small bootloader section that "always works" and is "never rewritten" and then update the application after that
08:06 PM Emil: and if it's fast to rewrite it's pretty kewl
08:46 PM Interex_ is now known as xa0z
09:50 PM enhering: Lambda_Aurigae?
09:50 PM enhering: I will never forgive you for telling me to try KSP.
09:50 PM enhering: Now I have no more time left for anything.