#avr Logs

Nov 21 2017

#avr Calendar

12:51 AM polprog: Emil: lol
12:54 AM polprog: Emil: http://3.bp.blogspot.com/-8szCGW54NWo/VEqpAQ76rmI/AAAAAAAAfpk/FtfxKdMcwcA/s1600/It's%2Ba%2Bconspiracy!.jpg
12:56 AM polprog: on a serious note
12:58 AM polprog: im aure that the protoboard part emits everything in EMI and can be listened to via some tempest style way
12:58 AM polprog: sure*
01:40 AM day__ is now known as daey
02:00 AM rue_mohr: is a stock t26 1Mhz?
02:01 AM LeoNerd: Most AVR chips seem to default to internal 8MHz with DIV8 with factory fuse settings
02:01 AM rue_mohr: you can say yes
02:02 AM rue_mohr: being that 8Mhz/8 = 1Mhz
02:02 AM rue_mohr: trying to work out why my t26 code for 9600 baud is comming out at 1200
02:08 AM rue_mohr: hmm I had the prescaler set to /8 too
02:08 AM rue_mohr: I'll try fixing it that way
02:09 AM rue_mohr: I cringe to think the processor being hit up every 103 cycles for another serial bit
02:09 AM rue_mohr: actually
02:09 AM rue_mohr: good point, I'll boost the processor then
02:10 AM rue_mohr: hey, the t26 has a pll
02:15 AM rue_mohr: ugh, there is no way to change the t26 clock divider in code!?
02:25 AM cehteh: mhm? dunno the t26, but all others i know let one change the divider in code
02:25 AM cehteh: the div8 is just some startup default
03:08 AM Jartza: not all avrs let changing the clock source in code
03:08 AM Jartza: but just set fuses
03:09 AM Jartza: attiny26 doesn't seem to have clkpr register
03:22 AM specing_ is now known as specing
06:09 AM day__ is now known as daey
07:13 AM nuxil: mornings
07:14 AM nuxil: ltspice is starting to annoy me a bit. https://i.stack.imgur.com/HaN20.png
07:15 AM nuxil: why no search for this list :(
08:43 AM rue_mohr: how many transistors could someone possibly load into the list? 5? 6? no, it wont need a search
08:44 AM rue_mohr: nuxil, you know that if you design a circuit in a simulator, the simulator is where its operation is limited to.
08:45 AM rue_mohr: I bet the simulator dosn't know about the negative resistance region during the reverse CE breakdown
08:57 AM nuxil: it def need a search. lets say you need to sim something using a generic npn/pnp transisor,ie bc547/557. instead of scrolling up and down looking for the part. just type it in there. there is a search function already. but its useless.
08:59 AM nuxil: rue_mohr, why would you oppose something that would make a program a bit better :p
09:01 AM rue_mohr: I'm not, I'm reflecting the thought they prolly had when they made it, like the jukebox system webpage I downloaded that used a dropdown box for selecting the song to play
09:02 AM nuxil: lol woot :p
09:02 AM nuxil: what must been awefull to use
09:02 AM rue_mohr: it was used once to see if it worked, then I tore it all apart and rewrote it all
09:04 AM nuxil: just setup vlc with straming and webinterface :p
09:05 AM nuxil: anywho. i just fried a pnp transistor.. time to recheck my calulations :p
09:20 AM tpw-rules is now known as tpw_rules
09:32 AM polprog: https://www.youtube.com/watch?v=x7pPajOvQGol
09:32 AM polprog: id make that a cron job every sunday
10:09 AM kl0wn: jesus
10:10 AM kl0wn: clicked link in the descrition
10:10 AM kl0wn: http://www.post-data.org/beige/
10:32 AM polprog: holy fuck lol
10:32 AM polprog: the 00's called they want their gifs back
10:45 AM thornekey: hi, im trying to make a arduino uno programmer for atmega8515. i am following http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/ and this is my schematic so far. im not sure where the 1mhz crystal is meant to go as the instruction is not very clear. "Also connect an 10k resistor from the reset pin of the MCU to program to VCC.
10:45 AM thornekey: And connect the XTAL pins to a crystal (see second step on that frequency) and with 22pF capacitors to ground."
10:45 AM thornekey: http://picpaste.com/pics/ex-UkLWz4Ve.1511282665.png <- schematic
10:46 AM thornekey: i dont think i have the crystal right
10:48 AM NoHitWonder: u need 2 of them
10:48 AM thornekey: oh, on each XTAL
10:49 AM thornekey: then from the crystal go to capacitor, then to ground
10:49 AM thornekey: ?
10:49 AM NoHitWonder: like this https://www.avrprogrammers.com/images/schematics/atmega8-minimal-lg.png
10:56 AM thornekey: oh right, thanks :)
11:35 AM thornekey: NoHitWonder, is this correct now? http://picpaste.com/pics/ex-nynSqkLk.1511285729.png
12:01 PM fooman2011: Hello. Is it possible that a Mosfet N consumes current in the following configuration: Gate connected to a Microcontroller pin set to LOW, Source connected to GND, Drain connected to a Sub circuit ?
12:01 PM polprog: no
12:02 PM polprog: or it depends if its enhancment mode or depletion mode
12:02 PM fooman2011: polprog: it's totally 0A ot it can be some µA ?
12:03 PM polprog: some microamps will always leak
12:03 PM polprog: https://en.wikipedia.org/wiki/Depletion_and_enhancement_modes
12:03 PM fooman2011: polprog: µA is a problem because I'm working to reduce the current consumption.
12:04 PM thornekey: http://picpaste.com/pics/ex-r6GYn8Cz.1511287420.png is the reset button ive added (labelled sw) going to the right places?
12:04 PM fooman2011: Is there a way to cut the power of a sub circuit without amp leak ?
12:06 PM polprog: thornekey: a schematic will save you many problems
12:06 PM polprog: basically, 10k between reset and VCC, switch between reset and GND
12:08 PM polprog: so that reset trace you have there is wrong
12:08 PM thornekey: ok so i need to put gnd to the gnd pin next to 5V
12:08 PM thornekey: ?
12:08 PM polprog: VCC -- R -- reset -- switch -- gnd
12:08 PM polprog: the whole chain
12:10 PM polprog: https://puu.sh/yqKFY/f4322a7539.png
12:10 PM polprog: here there is a jumper insteadm and the reset pin had a different number cos it's a tqfp mega8
12:10 PM polprog: has*
12:11 PM thornekey: ohk. im gonna use a atmega8515
12:11 PM thornekey: in my pic, see how reset ends up going to pin 10 on arduino? how should i link that after i make the changes
12:12 PM polprog: wow
12:12 PM polprog: that's exotic, never seen this one ;)
12:13 PM polprog: external memory how cool is that
12:13 PM thornekey: what do u mean :)
12:14 PM polprog: i mean it is a little uncommon to have a paralell bus on atmegas
12:15 PM thornekey: im just tryna follow http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/ but its a bit vauge
12:15 PM polprog: it's general for all avrs
12:15 PM polprog: so it will be vague
12:15 PM thornekey: yea
12:15 PM thornekey: i just got a bit stuck on putting a reset switch :)
12:15 PM polprog: i really suggest you draw a schematic first ;)
12:16 PM Ameisen: so
12:16 PM Ameisen: using another atmega2560 for now
12:16 PM Ameisen: was gonna get an xmega, but couldn't find a development board
12:16 PM Ameisen: and I'm lazy
12:16 PM polprog: those are pumped up megas
12:16 PM thornekey: someone sent me this schematic https://www.avrprogrammers.com/images/schematics/atmega8-minimal-lg.png previously
12:17 PM Ameisen: polprog - I know
12:17 PM Ameisen: was just hoping to find a dev board
12:17 PM Ameisen: none on amazon
12:17 PM Ameisen: plenty of 2560s!
12:17 PM polprog: yeah, the ISP and reset (and crystal in this case) is pretty standard
12:18 PM polprog: Ameisen: oh lol i didnt notice you ;) i though thornekey said that
12:18 PM polprog: you guys' nicks are both pink in my client
12:18 PM polprog: it got pretty mixed up :P
12:18 PM thornekey: its ok
12:19 PM Ameisen: I'd rather use something better than 2560 though
12:20 PM Ameisen: may look at the harvard arms?
12:24 PM fooman2011: Do you know a low leakage TO92 MOSFET Channel N ?
12:28 PM thornekey: ok, polprog i think i fixed it :) http://picpaste.com/pics/ex-WBwHRz0w.1511288890.png
12:29 PM polprog: now you have a switch that connects vcc to gnd via the resistor ;)
12:29 PM thornekey: oh no
12:32 PM polprog: a real electronic design program would hilight the pads you need to connect basing on the schematic
12:33 PM polprog: so if you started drawing a trace from reset it would highlight one pin on the resistor and one on the switch
12:33 PM polprog: that simplifies stuff a lot
12:33 PM thornekey: i think my problem is i dont understand where how to get from reset to pin 10
12:33 PM polprog: meaning how to draw a trace?
12:33 PM polprog: that wont cross many other traces?
12:34 PM thornekey: i mean, VCC -- R -- reset -- switch -- gnd is the right way but where do i put pin 10
12:34 PM thornekey: before reset?
12:35 PM polprog: pin 10 is RXD
12:35 PM polprog: reset is 9
12:36 PM polprog: so you want one pin from the resistor to pin 9 and a trace from 9 to switch
12:36 PM thornekey: oh, i thought this http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/ said CS reset to 10
12:36 PM thornekey: is it wrong
12:37 PM polprog: the numbers are arduino pinouts
12:38 PM thornekey: sorry thats what i mean when i was talking about pin 10
12:38 PM thornekey: reset connects to arduino pinout 10?
12:38 PM polprog: reset connects to the reset pin on the programmer
12:38 PM thornekey: ohk so the other side
12:39 PM thornekey: i see
12:39 PM polprog: yes
12:39 PM polprog: so your cpu has reset like on your pcb
12:39 PM thornekey: wonder why the author of the page said to pin 10
12:39 PM polprog: that part tells you which pins on the avr connect to which pins on the avr
12:40 PM polprog: because i assume he uses the arduino later to program the avr
12:40 PM thornekey: yes
12:40 PM thornekey: correct
12:40 PM thornekey: i want to make a avr programmer :)
12:40 PM polprog: :0
12:40 PM polprog: :)*
12:43 PM fooman2011: polprog: Could you please give the terms to google to find a low leakage mosfet channel N ?
12:43 PM Ameisen: hmm
12:43 PM Ameisen: ok
12:44 PM Ameisen: my present plan for my 3d printer is likely to use both an ARM M4 _and_ an atmega2560
12:44 PM Ameisen: connected via 2-pin serial
12:44 PM Ameisen: ARM M4 will handle the more expensive tasks (steppers, planning), atmega will handle heaters and thermistors
12:44 PM Ameisen: steppers and planning benefit from floats and 32-bit ops
12:44 PM Ameisen: heating/thermistors don't
12:45 PM Ameisen: also divides the work up well and will increase the precision of my heating controls, since they can run way faster
12:45 PM Ameisen: and can perform more noise reduction work
12:52 PM MrFahrenheit: a few months ago I bought a siglent 1202x-e scope, and a week later I found out they're making a 4 channel version of it, today I found out the 4 channel version will be just ~$100 more, and then I found out the scope I got has a hardware bug
12:52 PM MrFahrenheit: can't say I'm happy
12:53 PM thornekey: polprog, ok so now ive got: vcc -> resistor -> reset (9 on atmega) -> switch -> gnd.. and then reset also jumps to arduino pinout 10 http://picpaste.com/pics/ex-CoE8gmtO.1511290365.png
12:56 PM thornekey: hope its right now haha
01:03 PM thornekey: does anyone know :)
01:15 PM fooman2011: Here are the full specs of my circuit. Minimal current consumption required. Works using 3 AAA cells and ATtiny2313 and DS1337. Each day the DS1337 interrupt the Attiny. The attiny activates the MOSFET or RELAY or whatever to turn on a device, Attiny sends UART commands to this device during 6sec then turn of MOSFET or RELAY to cut the power of the device. My problem is to select the best way to turn on/off power of the device with the lowest
01:15 PM fooman2011: Currently the Attiny consumes 100nA and DS1337 consumes 300nA
01:23 PM [1]MrMobius is now known as MrMobius
01:47 PM thornekey: http://www.engbedded.com/fusecalc/ says i need 16CK crystal resonator is is that just a 16mhz?
01:48 PM thornekey: 16K CK
02:08 PM day__ is now known as daey
02:09 PM nuxil: thornekey, https://www.youtube.com/watch?v=jP1NTgs-a-s
02:15 PM NoHitWonder is now known as nohitz
02:18 PM polprog: thornekey: yeah, it's right now ;)
02:20 PM polprog: thornekey: 16K CK means that the cpu will wait for 16k ticks for the crystal frequency generator insisde to stabilize
02:20 PM polprog: it's not dependent on the frequency itself... 16MHz crystal is "High freq." in the calc and the datasheets
04:40 PM nohitz is now known as nohitzzz
10:45 PM rue_ is now known as rue_mohr
10:54 PM thornekey: polprog, hi, sorry i went to sleep but saw u said it was good now. My last question is does all the things that connect to ground on the board go to the ground on the arduino uno? if so which gnd as there is one pinout on the digital side and 2 on the power side
10:56 PM cehteh: thornekey: morning, i havent read backlog, but usually (as in almost always) you must connect all grounds together, dont leave any one floating
10:56 PM anonnumberanon: I forgot the toolchain. I need to compile code, look at assembly output. gcc-avr should get me straight?
10:58 PM cehteh: (also connect all VCC's, but some need special treatment, like AVCC may have a filter etc)
10:59 PM anonnumberanon: i think i found what i used to read to get through this: http://www.atmel.com/webdoc/avrlibcreferencemanual/group__demo__project_1demo_project_compile.html
11:00 PM thornekey: hi cehteh, basically im following this http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/ trying to make a shield for arduino uno http://picpaste.com/pics/ex-Vmd0iBIX.1511326777.png here is my idea. notice how ground leads to the power gnd (top left set of headers) but there is a second gnd pinout below that one and also another gnd pinout over pinout 13 on the right set of headers
11:01 PM thornekey: i just want to load flash a .hex file onto a atmega8515
11:03 PM thornekey: although in that pic the crystal is wrong mhz its meant to be 16 not 1 lol
11:03 PM cehteh: eh 2 crystals? wtf?
11:04 PM thornekey: just one?
11:04 PM thornekey: ill just connect both XTAL to one :)
11:04 PM cehteh: read the datasheet!
11:06 PM cehteh: also you leave a lot pins unconnected, looks suspicious, i dont know the pinout from the AVR you are using but all GND's and all VCC's must be connected
11:06 PM thornekey: i looked on pg3 http://www.atmel.com/Images/2512s.pdf
11:06 PM cehteh: when you want to use the analog part then add a filter to AVCC else just connect it to VCC
11:07 PM thornekey: where is the AVCC on the atm8515
11:07 PM cehteh: and all other pins need somehow non floating, either by internal pullup or externally connected
11:07 PM cehteh: i dont know that AVR, just read the datasheet
11:07 PM cehteh: maybe as well it has no analog part
11:08 PM cehteh: i just noticed that plenty pins are not connected and many AVRs have more than one GND and VCC
11:08 PM thornekey: im on pg3 of the datasheet. i see only one VCC and GND on it
11:08 PM cehteh: ah oj
11:08 PM cehteh: ok
11:09 PM thornekey: so should i link both XTAL 1 and 2 to 1 crystal -> resistor -> gnd
11:10 PM cehteh: not resistor, cap!
11:10 PM thornekey: sorry i meant capacitor
11:10 PM thornekey: derp
11:10 PM cehteh: and the caps need to be determined according to the specs, datasheet makes only suggestiong, the actual crystal you are using and PCB design may need difffernt caps
11:11 PM cehteh: at worst the clock wont run stable
11:11 PM cehteh: why do you need the crystal anyway? wont running from internal osc do?
11:12 PM thornekey: im just following http://www.instructables.com/id/Arduino-on-all-sorts-of-Atmels/ cos im new to this
11:12 PM cehteh: also you need a 100nF (at least) ceramic cap from VCC to GND .. physically close to VCC
11:13 PM thornekey: ok i have one
11:13 PM cehteh: i dont see it on your pcb design :D
11:13 PM thornekey: i mean i have one on me ahah so thats good
11:14 PM thornekey: before or after the 10k resistor
11:14 PM cehteh: maybe a little bigger wet or multilayer cap at power input as well 2.2µF ceramic or 4.7-20µF Electrolyte
11:14 PM cehteh: depends on what you want to do with the thing (switching loads?)
11:14 PM thornekey: i literally just want to flash a .hex file onto the atmega8515
11:14 PM cehteh: and then?
11:15 PM cehteh: thats just a flashing adapter?
11:15 PM thornekey: and then use the 8515 in cartridge game saver ahah
11:15 PM cehteh: ah
11:15 PM thornekey: yeah :)
11:16 PM thornekey: so im only gonna use this shield once
11:16 PM thornekey: really
11:16 PM cehteh: for flashing may want to connect the reset to some i/o pin
11:16 PM cehteh: lol
11:16 PM cehteh: just make that on a breadboard then
11:16 PM thornekey: i wanted to do it on a board cos i want to become better at etching and stuff
11:17 PM cehteh: but on PCB you cant correct errors easily :D
11:17 PM cehteh: you want to prototype on breadbord first anyway
11:18 PM cehteh: at least as long you make so much basic errors
11:18 PM cehteh: and for just flashing you can leave most pins floating/unconnected
11:19 PM cehteh: but in real stuff, floating pins may cause exessive power draw
11:19 PM thornekey: oh i see
11:20 PM thornekey: so back to the ground stuff, there are 3 gnd pins on the arduino. all need to be coneected to the gnd line on my board?
11:23 PM thornekey: http://picpaste.com/pics/ex-2nnZwl1V.1511328141.png cehteh now the gnd line leads to all gnd pinouts
11:24 PM cehteh: thornekey: in that case one GND from arduino should be sufficient
11:24 PM thornekey: ohk ill just remove the extra ones :)
11:24 PM cehteh: but it wont hurt to connect them all together
11:24 PM thornekey: oh right
11:24 PM cehteh: so dont remove
11:24 PM thornekey: cool :)
11:25 PM cehteh: and the xtal is still wrong
11:25 PM cehteh: doh .. read the datasheet
11:25 PM thornekey: oh across the lines
11:26 PM cehteh: and .. for flashing the controlling arduino most likely want to control the reset line of the progammed avr
11:26 PM cehteh: instead a switch
11:26 PM cehteh: ah .. missed it, you connected it
11:27 PM cehteh: pin 10
11:28 PM thornekey: so all good :)?
11:28 PM cehteh: and you could avoid these bridge with some changes
11:29 PM cehteh: the 100nF cap still missing
11:29 PM cehteh: no .. not all good :D
11:29 PM thornekey: ohk
11:29 PM thornekey: 100n cap from VCC to gnd. after the resistor?
11:29 PM cehteh: resistor
11:29 PM cehteh: no resistor
11:30 PM cehteh: have you ever read the avr datasheets? i mean not just open but really read
11:31 PM cehteh: reset has a always enabled internal pullup (quite weak one), the 10k resistor is good style and required when you connect long wires/traces but not always required
11:32 PM thornekey: ive it open right now on pg3 :) but the page im reading says "Also connect an 10k resistor from the reset pin of the MCU to program to VCC."
11:32 PM thornekey: ohk so in my case just replace the 10k resistor with 100n cap
11:32 PM cehteh: yeah just do,
11:32 PM cehteh: no
11:33 PM thornekey: i mean remove 10k
11:33 PM thornekey: add 100n cap from cvv to gndf
11:33 PM thornekey: gnd*
11:34 PM cehteh: you can keep the 10k resistor, esp when the datasheet says so, since you have some circruit connected to reset it is ok (i just wanted out that it isnt always required, esp when you leave reset unconnected)
11:34 PM thornekey: i see
11:34 PM cehteh: but the 100nF cap must be really close to the VCC pin
11:35 PM cehteh: in your simple thing it prolly wont matter but in other things it makes a big difference
11:35 PM cehteh: and you can route traces below the chip
11:36 PM cehteh: esp groundplanes ..
11:37 PM cehteh: and when you plan to etch, just leave as much copper connected to gnd around and make traces for signals and vcc,
11:38 PM cehteh: less etchant needed and electrically better
11:39 PM cehteh: https://i.gyazo.com/d54863a9e15182a3a76f2349f27608ac.png
11:39 PM cehteh: big copper areas all gnd
11:43 PM thornekey: ok ill make that change
11:48 PM thornekey: http://picpaste.com/ex-CDpXSZp0.png cehteh
11:48 PM thornekey: also see the 22n caps i have a 27n cap will that do? cos i thought you can go up and itll generally be ok
11:48 PM thornekey: sorry i mean 22p and 27p
11:53 PM cehteh: for the crystal?
11:53 PM thornekey: yea :)
11:54 PM cehteh: you should try, in that case you can not go up but the caps need to be correct and pF is really very very litte, stray capacitance from the traces already add a bit
11:54 PM cehteh: at worst the crystal wont swing stable
11:55 PM Thrashbarg: it'll be fine :P
11:55 PM cehteh: prolly
11:55 PM thornekey: ohk cos 27p is all i have on me lol
11:55 PM cehteh: yes try it, you'll notice when it doesnt work
11:56 PM thornekey: when or if :S
11:56 PM cehteh: and when you turn the 100nF cap by 90° then your pcb can become somewhat simpler/smaller
11:57 PM Tom_itx is now known as Tom_L
11:57 PM thornekey: ok on it :)
11:57 PM cehteh: and there are plenty ways how it can be optimized
11:57 PM day__ is now known as daey
11:57 PM cehteh: ground below the 100k resistor to connect the groundplanes and the trace on the edge is gone
11:58 PM cehteh: 10k
11:58 PM cehteh: when you leave he left side GND's unconnected then you dont need that bridge
11:59 PM cehteh: btw what software do you use to draw that?