#avr | Logs for 2016-10-12

Back
[00:09:16] <anonnumberanon> Yo you guys use interrupt.h or signal.h?
[00:10:30] <sabor> from signal.h: #warning "This header file is obsolete. Use <avr/interrupt.h>."
[00:11:41] <anonnumberanon> sigh.....all this time i was trying to use interrupts and thinking my toolchain to compile and upload wasn't working but i was missing avr/interrupt.h
[00:19:50] <rue_house> all cause he forgot to updatedb
[00:23:42] <anonnumberanon> Nah so actually I did have interrupt.h. So that wasn't the problem with this.
[00:27:06] <rue_house> willit compile ok now?
[00:27:47] <anonnumberanon> When did I ever say it did not compile correctly?
[00:28:01] <rue_house> I'm losing my mind, I dont know where your at
[00:29:18] <rue_house> my computer is choking on the ~3M trianges that form this pumpkin
[00:29:29] <anonnumberanon> lol
[00:29:46] <rue_house> pff, only takes 150M of ram
[00:29:49] <rue_house> GEEZ
[00:30:04] <rue_house> hehe the app is pulling 2G
[00:30:19] <rue_house> slightly less than firefox right now
[00:30:54] <rue_house> ackg, the system is using 4M of swap
[00:31:50] <rue_house> I have 3 procesors, be nice if openscad used more than one
[00:36:09] <rue_house> this is crazy, no model this size should take this long to process
[00:36:35] <rue_house> povray wouldn't take more than a minute to process this
[00:41:53] <anonnumberanon> I see a pwm.
[00:42:30] <rue_house> sure I had a pwm example...
[00:42:39] <rue_house> soft and hardpwm
[00:42:54] <rue_house> who wants to see some hardpwm?
[00:45:34] <anonnumberanon> now when i change optimization to -02 the signal becomes just high all the time
[00:45:46] <anonnumberanon> PWM shows up at -01
[00:45:53] <anonnumberanon> probably will too at -)s
[00:45:58] <rue_house> did you do a loop with nothing in it, not even a NOP?
[00:46:00] <anonnumberanon> -Os
[00:46:26] <anonnumberanon> Maybe?
[00:46:27] <anonnumberanon> while(1);
[00:46:30] <anonnumberanon> heh
[00:46:31] <rue_house> if you do for(i = 0; i < 600; i++); the optimizer will remove it
[00:46:41] <rue_house> casue it does nothing
[00:46:42] <anonnumberanon> ill add a nop to see if it stays at -O2
[00:46:46] <rue_house> you need to put a nop in it
[00:47:26] <anonnumberanon> tom's code is troll code, he puts nothing in the while and sets optimization to -O1 and it still works PWM :)
[00:48:01] <rue_house> the ways things are done has changed
[00:49:21] <anonnumberanon> lol and now with a nop in the while the PWM is a troll PWM with varying period
[00:49:31] <anonnumberanon> (still with -O1)
[00:49:35] <anonnumberanon> gonna try -O2
[00:49:43] <rue_house> what are you trying to do?
[00:49:54] <anonnumberanon> nothing
[00:49:59] <rue_house> and why are you trying to optimize it?
[00:49:59] <anonnumberanon> playing with chips
[00:50:03] <rue_house> hmm
[00:50:31] <anonnumberanon> no but to be serious my goal is to benchmark timer interrupts right now
[00:51:11] <rue_house> !@#$!@$#%^@# openscad crashED!?
[00:51:28] <anonnumberanon> yeah man, same thing -O2 with NOP in the while() still just puts the signal to high, no PWM or nothing.
[00:51:34] <anonnumberanon> trying -Os
[00:52:19] <rue_house> gngiht
[00:53:26] <anonnumberanon> allright
[00:53:34] <anonnumberanon> check you later
[00:53:50] <anonnumberanon> oh and this is working cause i added -I include paths blah blah
[00:53:55] <anonnumberanon> thanks to you
[01:13:34] <anonnumberanon> rue_bed, lmao so it's wasn't the include that was the problem
[01:13:46] <anonnumberanon> I won't say what it was :3
[05:03:28] <clean> on this page http://www.nongnu.org/avr-libc/user-manual/group__avr__time.html for the system_tick function, it says "Maintain the system time by calling this function at a rate of 1 Hertz." DOES that mean interrupt needs to be called once per second, or every clock cycle? I assume the former.
[05:03:42] <clean> for time.h
[06:43:50] <cehteh> clean: every second of course .. besides calling interrupt takes multiple clock cycles on its own
[08:32:56] <tsmz> hello everyone, just a quick question: I'm trying to program an attiny20 with an avr dragon, but it doesn't even want to read its signature. What could be the problem?
[08:34:53] <Haohmaru> lack of supply voltage, incorrect wiring, dead chip..
[08:35:38] <tsmz> supply voltage is there. For wiring, I'm using the standard ISP (SPI) connections
[08:35:48] <tsmz> it's a fresh chip, so very unlikely to be dead
[08:36:12] <Haohmaru> i thought the attinys don't use the same SPI programming interface as the atmegas
[08:37:07] <tsmz> they don't?
[08:37:35] <tsmz> I've programmed an attiny24 before, it worked there.
[08:37:54] <tsmz> but you might be right. Oh no
[08:38:26] <tsmz> is there a way I can program the attiny then?
[08:38:34] <Haohmaru> well, i'm not familiar with attinys, but i got a avrispmk2 clone, which has ICSP10 (that's for atmegas and most avrs), PDI (for xmegas) and TPI which afaik is for "tiny"
[08:39:50] <inflex> tsmz, is that a 6-pin tiny?
[08:41:16] <inflex> oh, I See it's a 2K 14~15 pin unit with normal ISP interface
[08:41:31] <tsmz> inflex: no, it's a 14 pin tiny
[08:41:57] <tsmz> my fault for specifying such a device, it looked like a smaller version of the attiny24 that I programmed in the past
[08:42:07] <inflex> Should be able to code that using the usual rst/clk/miso/mosi type interface
[08:43:13] <inflex> hmm... the 24/44 units are different beasts overall in terms of design focus but should still be able to port to the 20 perhaps with some changes based on the internals
[08:43:17] <Haohmaru> then, other reasons to fail to program it can be - disabled "SPI" from the fuses, enabled external clock from the fuses.. etc..
[08:43:48] <tsmz> my avr dragon doesn't want to program it. Which is unfortunate. I've got a couple of arduino boards around here, maybe there's a way to hack together a programmer for the TPI?
[08:44:16] <tsmz> it's going to be a new program, so no effort in porting required. Very simple program, so I thought the tiny20 would suffice.
[08:44:25] <inflex> you can do TPI if you bitbash via AVRdude and have a resistor between MISO and MOSI
[08:44:25] <Haohmaru> hold on, tsmz: is your chip meant to be programmed with TPI or with normal avr ICSP?
[08:44:37] <Haohmaru> check its datasheet
[08:44:42] <inflex> I really though the t20 was a ISP one
[08:44:47] <inflex> (it certainly has all the pins for it )
[08:45:20] <inflex> needs 5V to program perhaps?
[08:45:26] <Haohmaru> cuz xmega PDI is drastically different from avr ICSP for example
[08:45:48] <inflex> definitely has ISP interface (see page 5 of the data sheet)
[08:46:03] <Haohmaru> another possible cause: does the programmer receive voltage on its "Vtarget" pins?
[08:46:22] <tsmz> section 18, programming interface, only lists the tiny programming interface
[08:46:33] <Haohmaru> so it's TPI then
[08:46:55] <Haohmaru> does the "dragon" have TPI?
[08:47:09] <inflex> wow, I'm surprised, as their page 5 shows it as ISP
[08:47:11] <tsmz> Haohmaru: When I try to read the device signature with my avr dragon via atmel studio, it sees a 5V supply voltage, so I guess the supply voltage is there.
[08:47:23] <inflex> okay, with TPI, you can do it but you'll need a resistor and a patch to avrdude
[08:47:48] <Haohmaru> tsmz good
[08:47:50] <tsmz> inflex: Do you have more information on that?
[08:47:52] <Haohmaru> funky
[08:48:30] <tsmz> but yes, on page 5, it does say "isp interface" with an arrow to "programming logic"--very confusing.
[08:48:32] <inflex> tsmz, ja, gimme a mo... trying to find where I sourced the patch
[08:48:47] <inflex> basically I had to do the same for my T10 chips, because I blew up my TPI programmer :-o
[08:49:23] <tsmz> I just didn't think too much about it, I thought "it's not a 6-pin attiny, it has SPI pins, it looks like a sized down attiny24, surely it must have an ISP interface" ... ah well.
[08:49:24] <Haohmaru> tsmz "ISP" only means "in-system-programming"
[08:49:30] <Haohmaru> afaik
[08:50:13] <Haohmaru> so ICSP10, TPI, and PDI are all "ISP" interfaces
[08:50:23] <Haohmaru> if i'm not mistaking
[08:50:35] <tsmz> atmel calls it the "ISP interface": http://www.atmel.com/webdoc/avrispmkii/avrispmkii.section.zgf_vsd_lc.html
[08:51:14] <inflex> http://savannah.nongnu.org/patch/?8924
[08:51:38] <inflex> or https://github.com/kcuzner/avrdude
[08:51:42] <Haohmaru> ah
[08:51:50] <Haohmaru> so i was wrong then
[08:52:11] <inflex> Update: this is now included in the avrdude 5.11 release
[08:52:15] <Haohmaru> maybe what i said applies to "ICSP" instead
[08:52:25] <inflex> Okay, it seems in 5.11 it'll be included in the avrdude already
[08:52:30] <inflex> then you just need the resistor change
[08:52:32] <tsmz> Haohmaru: It's really confusing, different vendors call it different names. I think the ICSP naming is pretty standard with PICs
[08:52:44] <inflex> tsmz, http://irq5.io/2010/07/15/programming-the-attiny10/
[08:52:58] <Haohmaru> ICSP should mean in-circuit serial programming
[08:52:59] <inflex> there's a schem down half way that gives you everything you need if you have 5.11+ already
[08:55:30] <tsmz> okay.
[08:55:51] <inflex> tsmz, http://ctpc.biz/tpibrd.png <=- a board I made so I could plug in to my ISP (usbtiny)
[08:56:08] <tsmz> that's really annoying, I'll have to solder wires all over the place. Is there a pin-compatible AVR to the attiny20 that can be programmed via ISP?
[08:56:18] <tsmz> I'm using the SOIC version
[08:56:34] <inflex> you can ignore the 2x3 header on that, that was for my HV RST change
[08:56:44] <inflex> notice how mosi and miso are tied together
[08:56:54] <inflex> 1K resistor
[09:27:46] <clean> I'm coming across this syntax a lot [n:n] in register names in atmel documentation. For example "In Clear Timer on Compare or CTC mode (WGM0[2:0]=0x2),". Does this mean isolating bits 0-2 on WGM0, set them equivilent to 0x2?
[09:28:23] <clean> Because to me that implies CTC mode is achieved by setting bit 1 on. But from elsewhere I've read I need to set bit 2 on.
[09:30:05] <clean> Sorry WGM0[2:0] is bit name(s)
[09:31:04] <skz81> clean, I/O registers mapping is not the same for all chips. Unsure for I/O bit mapping, but no reason they can't change from chip to chip
[09:31:43] <clean> skz81: so am I right in my understanding, that would mean set bit 1 on, leave 0 and 2?
[09:37:08] <skz81> clean, unsure to understand what you're asking actually... I though you were asking about how are mapped logical bit blocs like WGMn to register TCCRnA/B
[09:38:49] <skz81> clean, and yes, you have to set WGM21 and leave WGM22 and WGM20
[09:39:19] <skz81> sorry set WGM01, leave WGM02 and WGM00
[09:39:45] <skz81> But you have to find where those 3 bit are actually implemented in TCC* registers
[09:41:02] <clean> Yep I've found it in the datasheet. My question was about the "[2:0]=0x2" part, if that meant setting the hex value to that bit range. I thought it did, but seeing a tutorial with different number made me unsure. Seems they were wrong though.
[09:42:07] <clean> Same device.
[09:45:39] <bss36504> WGM0[2:0]=0x2 is saying to shift a 0x02 to wherever it lines up with WGM0[2:0], wherever those bits are in the register.
[10:05:52] <skz81> bss36504, they're split into two registers
[10:07:24] <skz81> on atmega328 at least
[10:07:57] <LeoNerd> I wrap the timer setups in a little helper function, so you can pass the mode value in as a simple parameter
[10:25:25] <bss36504> skz81: Ok, but the fact remains, if you sucked out the bits for WGM0[2:0] they should equal 0x02 on their own, when youre done
[10:26:20] * skz81 approves this message !
[10:30:48] <Haohmaru> i don't recommend sucking bits
[11:19:30] <crib> https://pbs.twimg.com/media/CueM5TnW8AAzn_K.jpg:large
[11:20:28] <Thrashbarg> essentially, yup
[11:31:35] <bss36504> "But nobody would hack my thermostat!" - Naive IoT engineers
[11:53:51] <inflex> heh
[15:22:02] <specing> I[di]oT engineers :)
[22:04:46] <xMopxShell> besides price, are there any disadvantages to using a dc-dc convertor instead of a linear regulator? For example, http://www.digikey.com/product-detail/en/recom-power/R-785.0-0.5/945-1037-ND/
[22:18:45] <Casper> dc-dc is more noisy and less reliable
[22:19:14] <Casper> can't beat the '70 technologies!