#avr | Logs for 2014-10-05

Back
[01:44:50] <xrlk> ヽ༼ຈل͜ຈ༽ノ
[07:14:25] <LeoNerd> Is there any way I can get gcc to output me some values to store in the .eeprom section of the .elf?
[07:14:41] <LeoNerd> That would simplify my code a little I think
[07:27:45] <Jartza> hallo
[07:28:01] <Jartza> how's all the flying rockets today? ;)
[07:31:33] <specing> LeoNerd: int value __attribute__(section((.eeprom))); ? as far as I remember
[07:34:46] <LeoNerd> Yah; or EEMEM from <avr/eeprom.h> :)
[07:35:04] <LeoNerd> Can I convince gcc to let me use some of the .initN symbols? I want to put the eeprom reading code there
[07:53:43] <LeoNerd> $(shell echo $(PRIMARY) | sed 's/\([^ ]*-\([^ *]*\)\.hex\)/-U \2:w:\1/g') # Yay for make... or, not.
[09:06:02] <Tom_itx> LeoNerd, http://tom-itx.ddns01.com:81/~webpage/abcminiuser/articles/avr_eeprom_index.php
[10:35:15] <LeoNerd> Tom_itx: http://pastie.org/9622389 the code's quite nice. The Makefile is horrible though
[14:40:18] <LeoNerd> Wow. I never read the Arduino disassembly before; that thing is pretty inefficient.. digitalWrite is about 40 instructions
[14:42:45] <Tom_itx> yep, it's stupidly bloated
[14:43:26] <LeoNerd> Quickly hacking something up, but I imagine I'll rewrite it to straight AVR before too long at this rate
[14:43:44] <Tom_itx> why wait?
[14:44:34] <LeoNerd> Because it's slightly quicker to get something working today by doing SPI.transfer(0x20) than my having to remember how the mega SPI module works :)
[14:57:19] <LeoNerd> Hmm. I wonder if I could build this by having one main Makefile that just drives a sub-makefile twice, to do the two per-device builds
[15:27:01] <Mustafa> http://www.atmel.com/Images/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf
[15:27:06] <Mustafa> Could somebody please verify that i'm not to dumb to find what the Bits PDIV3..0 in the PLLFRQ register will do?
[15:27:12] <Mustafa> Datasheet Page 39, seems like it is just missing that part.
[15:27:17] <Mustafa> Diagramm on Page 38 suggest it is some sort of way to controll the pll speed.
[15:29:17] <Tom_itx> that is the PLL frequency control register
[15:29:30] <Tom_itx> P 40 fwd
[15:30:03] <Tom_itx> 40 or 48M hz
[15:30:08] <Tom_itx> only 2 choices
[15:30:20] <Tom_itx> table on P41
[15:31:25] <Tom_itx> err table continued on P42...
[15:31:39] <Tom_itx> from 40 to 96Mhz
[15:33:25] <Tom_L> 6.10 PLL
[15:33:26] <Tom_L> The PLL is used to generate internal high frequency (up to 96MHz) clock for USB interface
[15:33:27] <Tom_L> and/or High Speed Timer module, the PLL input is supplied from an external low-frequency
[15:33:27] <Tom_L> clock (the crystal oscillator or external clock input pin from XTAL1).
[15:33:37] <Tom_L> The internal PLL in ATmega16U4/ATmega32U4 generates a clock frequency between 32MHz
[15:33:37] <Tom_L> and 96 MHz from nominally 8MHz input.
[15:33:49] <Tom_L> The source of the 8MHz PLL input clock is the output of the internal PLL clock prescaler that
[15:33:49] <Tom_L> generates the 8MHz from the clock source multiplexer output (See Section 6.10.2 for PLL interface).
[15:33:49] <Tom_L> The PLL prescaler allows a direct connection (8MHz oscillator) or a divide-by-2 stage for a
[15:33:49] <Tom_L> 16MHz clock input.
[15:34:03] <Tom_L> The PLL output signal enters the PLL Postcaler stage before being distributed to the USB and
[15:34:03] <Tom_L> High Speed Timer modules. Each of these modules can choose an independent division ratio.
[15:38:53] <Mustafa> Yeah i set cksel3:0 to my external 8mhz crystal, then pindiv to 0 to feed the 8mhz directly into the pll. And since clkUSB needs to 48Mhz the output of the pll must be either 96mhz (with divider by 2) or 48mhz
[15:39:27] <Mustafa> But i don't get how to set the three pdiv bits to get the 48/96mhz output from the pll
[15:44:11] <Tom_itx> PLLFREQ = (1<<PDIV3 | 1<<PDIV1 | 1<<PDIV0)
[15:44:21] <Tom_itx> ;
[15:45:04] <Tom_itx> or PLLFREQ = (1<<PDIV2); for 48Mhz
[15:45:57] <Tom_itx> err
[15:46:16] <Tom_itx> PLLFREQ = (1<<PDIV3 | 1<<PDIV1); for 96Mpz
[15:46:19] <Tom_itx> Mhz
[15:46:55] <Mustafa> where did you get these values from?
[15:46:57] <Mustafa> hmm i think atmel broke the new datasheet...
[15:47:01] <Tom_itx> the table
[15:47:06] <Tom_itx> on P 41
[15:48:33] <Mustafa> hmm, there is no table. The new datasheet is broken. D:
[15:48:38] <Mustafa> old: http://i.imgur.com/33KMrJl.png
[15:48:45] <Mustafa> new: http://i.imgur.com/3EcD9Vo.png
[15:48:51] <Tom_itx> so use the old one
[15:49:02] <Mustafa> yeah thanks anyway.
[15:49:37] <Mustafa> if you hadn't said anything about a table, i'd never would have found out that the new datasheet is incomplete.
[15:49:59] <Tom_itx> heh
[15:51:40] <Mustafa> guess i will write to atmel now, to prevent others having the same problem.
[15:52:00] <Tom_itx> good idea
[16:31:58] <avri> I'd like to have this: http://svn.navi.cx/misc/trunk/avrfid/avrfid.S flashed to an ATTiny85, but instead of it being powered by the coil, I'd like to connect a battery to the attiny85, run it at full speed (20MHz vs 125Khz), thus have more CPU cycles to run extra code. I would like the extra code to measure I/O pins for programming the RFID tag value - any idea how to go about porting this?
[16:40:42] <LeoNerd> If I use avr-gcc to compile up some source can I still load it with the Arduino bootloader on the target?
[18:07:54] <[F_F]> https://www.youtube.com/watch?v=8DMZSxS-xVc
[18:10:16] <theBear> LeoNerd, yeah, arduino bootloader is just a slightly mis-implemented err, stk500-over-usbserial as i recall, something like that, to sum up, yeah
[18:10:44] <theBear> LeoNerd, and congratulations on being awesome, or at least being awesome very soon :)
[18:11:02] <vsync> [F_F]: wow. thanks
[18:11:20] <LeoNerd> theBear: mmmhm; it seems to need -b 57600
[18:11:30] <LeoNerd> but otherwise works fine
[18:12:55] <theBear> erm, what does -b mean on whatever programmer you using ? oh, baud i spose
[18:13:12] <theBear> wait, no, byte? no, what does it mean ?
[18:31:27] <Duality> theBear: slightly mis-implemented ?
[18:33:08] <theBear> Duality, yup, it was supposed to work with any old standard programmer util/app, but they made a mistake and didn't notice till they'd deployed a LOT of the first arduinos, so then all the programmer software had to add a arduino programmer option so they would work
[18:35:39] <Tom_itx> just like their pinout
[18:36:56] <jadew> what did they screw up with the bootloader?
[18:38:45] <theBear> i don't remember, some unbelievably hard to miss little thing like a header byte or something
[18:38:54] <jadew> heh
[18:39:33] <theBear> the kinda thing that means they just flatout didn't test them with avrdude or pony or anything before they went out the door
[18:40:09] <Tom_itx> they were in a hurry to get em out for sure
[18:40:34] <jadew> now they're freaking everywhere
[18:42:48] <jadew> the only thing I worry about (regarding arduino) it that it might be one of those things where it represents actual advancement in technology, but I just don't see it because I'm getting old and grumpy about anything stupid
[18:43:16] <Tom_itx> it hides too much
[18:43:35] <jadew> it pisses away the performance of the chip
[18:44:18] <jadew> it's not like some library that is meant to expose functionality (like the ASF), it's a library that's supposed to be noob-proof
[18:44:37] <Tom_itx> the microsoft of the µC world?
[18:44:50] <jadew> ms is actually awesome in that regard
[18:44:58] <Tom_itx> i wouldn't give them that much credit actually
[18:45:07] <jadew> good documentation & very programmer friendly until recently
[18:45:33] <Tom_itx> i never got into windows programming
[18:45:40] <Tom_itx> in some ways i wish i would have
[18:45:54] <jadew> it's... consistent
[18:46:27] <theBear> i'm shocked how damned many different ones they got now
[18:46:36] <N1njaneer> jadew: Arduino is useful for people getting in to microcontroller, so it's advancement there, but it's a toy. It's generally NOT suited for real-world production or deployment.
[18:46:45] <N1njaneer> +microcontrollers
[18:46:50] <jadew> theBear, many what? many versions of arduinos?
[18:47:16] <theBear> half the libs are needless abstraction, and their whole approach encourages people to know NOTHING about the underlying tech or hw, to the point where many don't even know what an avr is, letalone that they have one
[18:47:16] <jadew> N1njaneer, you're right, but sadly it's being used in a lot of crap that ends in the market
[18:47:17] <Tom_itx> i got one of the 2560 boards from china simply because i couldn't make one myself near as cheap
[18:47:35] <theBear> jadew, yeah, it's been a while, but there was something ridiculous like 20 different models listed
[18:47:39] <jadew> theBear, yeah
[18:48:19] <jadew> Tom_itx, what do you use it for?
[18:49:10] <Tom_itx> not much right now
[18:49:19] <Tom_itx> i was looking into reprap when it was the board to have
[18:49:33] <Tom_itx> i played with that a bit and now just use it for testing stuff occasionally
[18:50:18] <Tom_itx> i've had the bootloader on and off it quite a few times
[18:51:44] <jadew> Tom_itx, I guess it has some value as a break out board
[18:52:16] <Tom_itx> they didn't bother to map all the pins
[18:52:23] <jadew> heh
[18:52:44] <Tom_itx> i added some to one of their headers once
[18:52:52] <Tom_itx> now i don't even remember what they were
[20:21:19] <orba> I am trying to program my 32u4 over the USB bootloader (DFU) and the FLASH address range is reading as 0x00 to 0x00
[20:21:30] <orba> Obviously the flash file is bigger than this. The device ID is okay.
[20:27:59] <Tom_itx> did you put it into program mode?
[20:28:10] <Tom_itx> HWB low and pulse reset low?
[20:28:27] <orba> what is pulse reset low?
[20:28:35] <orba> I followed the state daigram shown in the DFU pdf
[20:31:25] <Tom_itx> HWB pin must be held low while you take the reset pin low
[20:31:39] <Tom_itx> that will put the chip into programming mode
[20:32:38] <orba> k
[20:32:53] <Tom_itx> just take it low and release... you don't hold them both low
[20:33:26] <orba> It is still saying the address is out of range.
[20:33:37] <orba> The hex file is also way too big...there is no way it will fit into the flash
[20:33:41] <Tom_itx> you got the right chip selected in DFU?
[20:34:02] <Tom_itx> if the flash is too big why are you trying to load it?
[20:34:36] <orba> yeah
[20:34:43] <orba> no idea--ive seen people do it online before
[20:34:54] <orba> not sure if I am doing this correctly- I want to put the arduino bootloader onto the 32u4
[20:35:13] <Tom_itx> well, you need an ISP programmer to do taht
[20:35:24] <Tom_itx> you can't do that with the DFU bootloader thing
[20:36:03] <Tom_itx> it doesn't load at 0x00, rather the selected bootloader address
[20:36:18] <Tom_itx> then the fuses need to be set to point to that
[20:36:22] <orba> okay
[20:36:55] <Tom_itx> will the arduino bootloader work on that chip?
[20:38:46] <orba> Other people have gotten it working. The only problem is that we are doing this at a qty of 600
[20:39:02] <orba> we are getting 600 boards made--and ideally we would not need to ISP all of them
[20:39:39] <Tom_itx> if you plan to load a bootloader on them you will
[20:40:26] <orba> 1) Arduino requires a custom bootloader; 2) You cannot use DFU to load a custom bootloader; 3) IF you want arduino you must use ISP
[20:40:30] <Casper> orba: the .hex file do NOT get directly flashed to the flash
[20:40:31] <orba> so basically i need to make a programming jig
[20:40:36] <orba> Casper: ?
[20:40:42] <Casper> the .hex file is a text file
[20:40:55] <Casper> the programmer convert the text into binary
[20:41:12] <Casper> expect it to be close to 3 times the size of the actual code
[20:43:47] <Casper> the .hex is intel hex file format, basically there is an address, record type, record length, then the hex representation of the data in text, then a checksum... so 16 bytes of code is like 40 bytes long if not longer
[20:55:40] <[F_F]> how much can Temperature change Beta on a bipolar transistor?
[21:02:00] <Tom_itx> i suspect that would be in the data sheet
[21:30:03] <Bright> yess, my pdi header works
[21:33:54] <Tom_itx> why wouldn't it?
[21:34:01] <Tom_itx> only 4 wires...
[21:40:55] <Bright> Tom_itx: because i'm etching my own boards and i have to do a very strange construction technique since i can't have plated vias or accurate two-sided boards
[21:42:46] <Tom_itx> i've done a couple like that :D
[22:08:39] <obnauticus> I have question -- I'm trying to change the bootloader on this atmega 32u4 and I am getting an error with avrdude
[22:08:57] * obnauticus pastebins the output
[22:09:04] <Tom_itx> using ISP?
[22:09:11] <obnauticus> stk500, via isp.
[22:10:03] <Tom_itx> last guy was trying to load one with DFU is all...
[22:10:05] <obnauticus> I'm getting stk500v2_command: command failed. The avr device initalizes and is ready to accept instructions bt I am getting the wrong device signature.
[22:10:08] <obnauticus> I am the last guy.
[22:10:10] <obnauticus> lol
[22:10:14] <Tom_itx> hehe
[22:10:20] <obnauticus> i need to get the prototype working by tomorrow morning :(
[22:10:52] <obnauticus> It's getting 0x28ed56 and expects a 1E 95 87
[22:10:54] <Tom_itx> the program needs to know where it's supposed to load ( in the makefile when compiled )
[22:11:05] <Tom_itx> the fuses need to point to the bootloader flash section
[22:11:32] <Tom_itx> so when it loads it will go where it's supposed to
[22:11:53] <obnauticus> I'm just trying to read the fuses off of this thing.
[22:11:59] <Tom_itx> k
[22:12:13] <obnauticus> i am running avrdude -b 115200 -p m32u4 -c stk500 -P /dev/ttyUSB0 -F
[22:12:44] <Tom_itx> can't help you much with serial programming
[22:14:26] <Tom_itx> what baud does the stk500 expect?
[22:16:34] <obnauticus> 15200
[22:19:04] <obnauticus> i got it
[22:19:58] <Tom_itx> what was it?
[22:20:16] <obnauticus> just a pinout issue
[22:20:29] <Tom_itx> k
[22:21:05] <Tom_itx> once you get one the other 599 will be easy
[22:22:18] <strukturalna> 600 pins?
[22:41:35] <Tom_itx> 600 devices to program
[22:41:56] <Tefad> TAKE ONE DOWN PASS IT AROUND
[22:42:05] <Tefad> 599 devices to program!
[23:18:15] <orba> Tom_itx are you still there?
[23:18:34] <orba> I think I have the correct bootloader flashed and everything--I'm trying to uplodate my program to this board, and I'm getting some odd errors
[23:18:52] <orba> sec while i upload a screenshot
[23:19:30] <orba> http://i.imgur.com/MY7Pj1J.png