#avr | Logs for 2014-12-08

Back
[08:40:26] <LeoNerd> https://twitter.com/Xylit0l/status/541279485640081409/photo/1 <== for anyone who says PCBs can't be functional -and- artistic...
[08:41:38] <twnqx> awesome
[08:42:21] <LeoNerd> Certainly making me think a little more about how to combine silkscreen/resist mask/copper in my logo images
[08:42:29] <LeoNerd> silkscreen alone is so boring
[08:59:07] <twnqx> [15:35:14] marcan (マルカン): that board is ooooold
[08:59:11] <twnqx> [15:35:32] marcan (マルカン): I've even seen it advertised in akihabara somewhere :P
[08:59:24] <twnqx> damn tokyo residents :/
[08:59:51] <twnqx> [15:37:57] marcan (マルカン): https://twitter.com/marcan42x/status/520790881322799105 <- here's how they advertised photosensitive PCB in dendentown :D
[11:54:06] <twnqx> !seen abcminiuser
[11:54:12] <twnqx> damn, no seen bots :(
[11:54:28] <LeoNerd> Hah
[11:56:45] <Bright> 12:21 GMT
[11:57:00] <Bright> quitting
[11:57:06] * twnqx scrolls up
[11:57:13] <twnqx> right
[12:01:55] <twnqx> then i guess he's still around every now and then. thanks Bright :)
[12:03:40] <chickensk> hi! what is your favourite TINY chip and why ? :]
[12:03:58] <LeoNerd> Surely: the smallest one which will fit the design?
[12:04:24] <LeoNerd> I'm currently working on a tiny84 because I need the pins, 85 is too small. doesn't seem to need a 4323
[12:04:27] <LeoNerd> 4313
[12:04:44] <TechChristoph_> My favourite is the 2313
[12:05:24] <twnqx> i only ever used one tiny, the 13a
[12:05:35] <twnqx> 5 pins more than i needed, though :D
[12:05:50] <LeoNerd> Sometime soon I want to play with a tiny841... Hardware UARTs :)
[12:05:55] <TechChristoph_> Because it is not too expensive and has lots of pins
[12:06:17] <twnqx> i only needed a 50hz generator
[12:06:29] <LeoNerd> If all you need is 50Hz surely you want a 555?
[12:06:35] <twnqx> and the tiny used 0 external components...
[12:06:44] <twnqx> 555 needs external components :P
[12:06:49] <LeoNerd> Hmm.. true
[12:09:42] <twnqx> http://i.imgur.com/Db4nqCP.jpg it's the chip on top of the other chip :P
[12:11:28] <twnqx> and *poof* goes the watchdog.
[12:20:50] <Jartza> has anyone used spi (nor) flashes with attinys? :)
[12:21:46] <twnqx> no... only with a CAN mega
[12:21:53] <twnqx> but what difference does it make?
[12:26:14] <twnqx> Jartza: if you want some code to ID nor flashes or write a page to them, tell me :P
[12:26:41] <twnqx> i wonder if i should update my datasheet collection of them...
[12:28:43] <twnqx> hm.
[12:29:02] <twnqx> can anyone confirm if these two code snippets are effectively equal in performing the task? http://pastebin.com/jJ3m1xq8
[12:52:42] <Jartza> twnqx: nah, not much difference if tiny or mega, except some tinies don't have hw spi
[12:54:36] <LeoNerd> USI talks SPI quite nicely though
[12:54:54] <LeoNerd> Nicer in places, because you can talk non-8bit words just as easily ;)
[12:55:02] <LeoNerd> Want 7-bit SPI? Sure :)
[13:00:43] <apo_> speaking of 'the smallest one which will fit the design'
[13:01:10] <apo_> think I'll find something cheaper than a mega8 that has I2C, an ADC, and one additional I/O pin? :P
[13:01:44] <LeoNerd> tiny841?
[13:01:50] <LeoNerd> I don't know the price of those currently...
[13:02:16] <LeoNerd> Hrm.. actually maybe the 841 doesn't do hardware I²C
[13:02:19] <apo_> LeoNerd: Needs Multi-master I2C
[13:02:28] <apo_> the 841 apparently only has slave?
[13:02:38] <LeoNerd> Ohwait, it does
[13:02:41] <LeoNerd> Ahhh...
[13:02:48] <twnqx> apo_: just use software \o/
[13:02:52] <apo_> twnqx: No
[13:02:59] <LeoNerd> Huhh... really? I hadn't noticed that before
[13:03:02] <twnqx> software i2c! software adc!
[13:03:10] <apo_> twnqx: I will stab you
[13:03:17] <twnqx> :(
[13:03:17] <LeoNerd> How do you propose to do -software- ADC? :P
[13:03:19] <apo_> twnqx: In hardware
[13:03:22] <apo_> twnqx: at abgm
[13:03:33] <twnqx> not at 31c3? :>
[13:03:33] <LeoNerd> Hrm. I suppose a big RC filter on a PWM output and the anacomp could do it.
[13:03:40] <LeoNerd> Very slow sample time though ;)
[13:03:42] <apo_> twnqx: that works too
[13:03:55] <twnqx> bought my ticket today!
[13:03:58] <LeoNerd> Probably horribly inaccurate
[13:03:58] <apo_> neat
[13:04:06] <apo_> LeoNerd: I only need 7 bits!
[13:04:33] <apo_> MIDI doesn't support more anyway :)
[13:04:43] <LeoNerd> Huh.. So, the 841 can only I²C slave? Why... why would anyone put hardware /slave/-only on a microcontroller, without master?
[13:04:55] <LeoNerd> Ah if you're MIDI'ing surely you'll want a UART
[13:05:01] <apo_> nope
[13:05:35] <twnqx> LeoNerd: i want a hardware slave for multiple addresses
[13:05:51] <LeoNerd> Ooh.. trickier.
[13:05:54] <LeoNerd> USI can do that :)
[13:05:55] <apo_> LeoNerd: only the output is proper (USB) MIDI, the communications between different controls and the interface to the computer is I2C
[13:06:00] <twnqx> usi can?
[13:06:02] <twnqx> really?
[13:06:09] <LeoNerd> Actually USI can do that /easier/ than hardware I²C can
[13:06:19] <twnqx> hardware i2c can't, period
[13:06:26] <apo_> Because it's basically software I2C, with a shift register and a counter :p
[13:06:28] <LeoNerd> Yes.. the hardware I²C slave module knows its own hardware address, and won't respond to anyone else
[13:06:43] <LeoNerd> USI in I²C mode is just a shift register with start-condition detector
[13:06:46] <apo_> twnqx: Hardware I2C responds to two addresses
[13:06:48] <apo_> that's multiple
[13:06:50] <apo_> :D
[13:06:51] <twnqx> ha-ha
[13:07:00] <twnqx> i don't count the r/w bit as part of the address
[13:07:05] <apo_> I don't either
[13:07:06] <twnqx> though admittedly, some people (like VESA) do
[13:07:09] <LeoNerd> It leaves processing of the start byte to software. So you can just look and see that address, and do what you want with it. Then you can ACK/NACK accordingly
[13:07:17] <apo_> 0x00 is a general call address that all slaves respond to
[13:07:17] <twnqx> hmhm
[13:07:33] <twnqx> so.. anything with USI and hardware usb? :D
[13:07:37] <LeoNerd> Hah!
[13:07:56] <LeoNerd> You'll want two chips... put a USI-talking tiny next to the real chip and have it be the multi-address I²C bridge
[13:08:00] <twnqx> bah
[13:08:10] * twnqx just continues his finely timed I2c software slave
[15:45:15] <ike> hi guys
[15:45:28] <ike> how much is the shipping in Atmel store http://store.atmel.com/PartDetail.aspx?q=p:10500392;c:100113#tc:description
[15:56:29] <The_Coolest> ike it's tree fiddy
[15:56:37] <The_Coolest> that stupid link highlighted me
[15:57:32] <ike> so it's 15$
[15:57:43] <ike> for $8.88 board?
[16:06:22] <Rickta59> are those usable with avarice?
[16:06:38] <Rickta59> * for linux specifically
[16:08:52] <ike> how much is the cheaper avr debugger?
[16:09:27] <LeoNerd> ike: when I've finished building it: free open-hardware <.<
[16:12:14] <LeoNerd> Though I'll also put it on tindie :)
[16:13:30] <ike> what chip did you use?
[16:14:45] <LeoNerd> Currently considering a tiny841 with its two UARTs
[16:14:58] <LeoNerd> One for the dW port, one to talk to the USB computer host
[16:15:09] <LeoNerd> But I'm not sure I can clone STK500 in 8K of flash
[16:15:30] <LeoNerd> so I might end up doing it only with custom software on the PC, and not having it claim to be an STK
[16:19:01] <ike> can't you just use bigger chip?
[16:19:24] <LeoNerd> Oh I could, but I don't know for sure if I even want to implement it as an STK500 clone yet...
[16:19:29] <LeoNerd> Given that's -also- undocumented how it works
[16:19:33] <LeoNerd> I might just custom it all up
[16:19:40] <LeoNerd> Going for STK500-clone for HVSP though
[16:21:58] <ike> is there a list of chips that are dW compatible?
[16:22:10] <LeoNerd> Almost all of them
[16:22:13] <LeoNerd> Even down to the tiny13
[16:22:19] <ike> nice
[16:22:25] <LeoNerd> I've yet to find one that doesn't, anyway
[16:29:04] <ike> how much time does it take to proggram ATMega328 32KB flash with debugWire?
[16:29:37] <LeoNerd> I imagine much much slower than SPI
[16:29:58] <LeoNerd> dW is serial-based at /128 division from the CPU clock, and you can only write one program word at a time with a (IIRC) 2 byte prefix
[16:30:15] <LeoNerd> SPI would be atleast 10, maybe 20 times faster
[16:30:24] <Rickta59> doesn't dW always rewrite flash to set a breakpoint?
[16:30:50] <LeoNerd> dW can temporarily knock the chip back into ICSP mode though, so I imagine that's how you'd do a total rewrite
[16:31:22] <Rickta59> i got the impression that pdi was really 2 wire jtag .. but i could be confused
[16:31:50] <ike> so you want to do that? STK500 programmer that program mcu and then debug it via dW?
[16:31:51] <LeoNerd> I've not looked into PDI
[16:32:26] <LeoNerd> I've built an HVSP programmer already, but currently that talks to Bus Pirate
[16:32:37] <LeoNerd> Gonna build a fancier frontend as a 500-clone
[16:37:34] <Rickta59> in perl?
[16:38:00] <LeoNerd> Dunno yet... probably a first hack yes
[16:38:04] <LeoNerd> Fastest thing for me to write
[16:38:36] <LeoNerd> But the serial format will be openly documented so if people don't want that they can write whatever themselves
[16:38:37] <Rickta59> are you doing perl professionally? ( watched your video .. kind of interesting )
[16:38:57] <LeoNerd> Yup
[16:39:07] <Rickta59> i didn't think there was any call for that anymore
[16:39:13] <LeoNerd> My current contracting work is primarily for http://matrix.org
[16:39:31] <LeoNerd> There's tonnes of perl around. It's just not "glamourously shown-off"
[16:39:44] <Rickta59> i did a lot of perl in the 90's :)
[16:39:47] <LeoNerd> It doesn't make headlines
[16:39:59] <LeoNerd> Ah.. well, 2014 perl is much different to 1990s perl ;)
[16:40:09] <Rickta59> 4.36 .. i'm sure it is different
[16:40:36] <Rickta59> i never did object oriented perl
[17:21:40] <mrsun> hmm
[17:22:32] <mrsun> i have two AVR on one card, but want them programmable from just one port with a chip select jumper .. is it enough to just put the SCK line to the chip i want to program ?=
[17:22:45] <mrsun> i want both chips to reset as the programming is performed/done
[17:26:30] <LeoNerd> Sounds reasonable
[21:36:09] <SKiTZO> I am avr beginner trying to set up timers to controll an RC servo (PPM). Th code I found online is simple and allows for up to 6 servos but it uses some deprecated symbols/macros that makes compiling it a pain
[21:36:32] <SKiTZO> and finding out online what these deprecated symbols have been replaced with is not easy
[21:36:36] <SKiTZO> TCNT3 <-- that for example
[21:36:46] <SKiTZO> any tips are welcome!
[21:37:13] <Tom_itx> those are registers or bits in a register
[21:37:44] <SKiTZO> I see in the include file that defines it it is wrapped in a if defined __AVR_LIBC_DEPRECATED_ENABLE__
[21:39:16] <SKiTZO> Tom_itx, is that is deprecated, how would I find out what to use instead?
[21:39:24] <SKiTZO> *if
[21:44:38] <Tom_itx> check the data sheet for the part
[21:44:50] <Tom_itx> it will have the new register naming conventino
[21:44:53] <Tom_itx> convention*
[21:45:27] <Tom_itx> look in the back of it, there's a table with them all listed
[21:50:05] <SKiTZO> tx *looking
[22:03:54] <SKiTZO> I think that my particular chip does not have 3 timers but two. I have thus commented out everything that has to do with timer #3. However I think the problems I have are more general. I dont think my makefile invokes avr-gcc correctly. Is there a set of defines/compiler flags that are mandatory?
[22:05:18] <SKiTZO> For example, the chip I have has the following markings on it: ATMEL ATMEGA32L 8AU 1340D <-- How can I translate that into correct compile flags for my program?
[22:07:13] <Tom_itx> mega32 or mega32l
[22:07:31] <Tom_itx> it's a fairly old chip
[22:09:13] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/avr/atmega32/rs232_rx_test/
[22:09:21] <Tom_itx> you could probably use that makefile and mod it a bit
[22:23:34] <SKiTZO> Tom_itx, thanks! In terms of how it invoked the compiler it was pretty similar to what i already have, however I decided to adapt it just for the heck of it
[22:38:11] <SKiTZO> ok so basically it boils down to the fact that my old chip is lacking a bunch of features that the example code I found needs to work
[22:38:33] <SKiTZO> plus a lot of deprecated symbols being used on top
[22:39:08] <SKiTZO> fml. I'll have to figure out how to do this by myself using the features my chip has using modern syntax
[23:54:06] <koolatron1> Hi friends. I'm confused by something pgmspace.h-related.
[23:54:20] <koolatron1> error: variable 'cmd_data_table' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
[23:54:32] <koolatron1> However, cmd_data_table's declaration is:
[23:54:47] <koolatron1> PGM_P cmd_data_table[] PROGMEM = { CMD_DATA_FOO, CMD_DATA BAR };
[23:55:02] <koolatron1> it's my understanding that PGM_P is already const.
[23:55:36] <koolatron1> (the members of cmd_data_table are also declared const char PROGMEM)
[23:58:29] <koolatron1> Replacing the PGM_P macro with const char* just makes it more confusing:
[23:58:30] <koolatron1> main.c:43:20: error: variable 'cmd_data_table' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
[23:58:30] <koolatron1> static const char* cmd_data_table[] PROGMEM = {
[23:58:30] <koolatron1> ^
[23:58:49] <koolatron1> the const is /right there/