#avr | Logs for 2012-04-02

Back
[01:23:26] <rue_house> Casper, do you have a tetnis shot?
[01:23:41] <Casper> rue_house: had
[01:23:47] <Casper> too many years ago
[01:23:51] <rue_house> k, hmm
[01:24:03] <rue_house> I dont know what tetnis symptoms are
[01:24:10] <rue_house> but I know it lines iron
[01:24:17] <rue_house> and dirt
[01:24:25] <Casper> rue_house: I checked the meds I put... and it contain something that I might be allergic
[01:24:25] <Casper> actually
[01:24:30] <rue_house> and I know it can cause a heart muscle to sieze up
[01:24:38] <rue_house> which is usually fatal
[01:24:38] <Casper> it's a bacteria
[01:24:39] <Casper> that is everywhere
[01:24:41] <rue_house> ok
[01:25:01] <Casper> but the most common infection source is rusty nail
[01:25:05] <rue_house> I did a good one on myself last year and decided to get an update
[01:25:25] <Casper> to get it you need it to go under the skin
[01:25:35] <rue_house> any linux users successfully using google talk?
[01:25:44] <Casper> so rusty nail is a common way
[01:26:09] <rue_house> how about unsuccessfully?
[01:27:06] <Casper> google talk... do you need an account?
[01:27:11] <rue_house> yes
[01:27:25] <Casper> what is the prob on your side? do not start?
[01:27:26] <rue_house> it seems to be tacked onto gmail
[01:28:16] <rue_house> it seems that talk cant sleect the line in input that I use for my mic, the only sources it lists for the microphone are audio outputs
[01:29:00] <Casper> checking
[01:30:22] <Casper> installing the plugin, let me compile
[01:30:35] <Casper> 4 packages to install
[01:31:06] <Casper> 404
[01:31:19] <rue_house> heh, you might be a while
[01:32:15] <Casper> syncing portage
[01:32:20] <Casper> might be just out of date
[01:35:33] <rue_house> back in 6.5
[01:38:33] <Casper> 6.5 mins or hours?
[01:39:34] <Casper> well, google talk seems to be fully working here using my ps3 camera
[01:39:50] <Casper> camera is working, I could pick up the camera mic as the input source
[01:47:19] <Casper> hi Richard_Cavell
[01:47:32] <Casper> how's the studying and the head? :D
[01:57:34] <Richard_Cavell> brain is full
[01:57:39] <Richard_Cavell> I'm up to page 120 out of 168
[01:58:20] <Casper> not too bad
[01:59:46] <Richard_Cavell> I can do about 5 pages per day
[02:00:02] <Casper> only? yuck
[02:00:58] <Richard_Cavell> http://www.mcgraw-hill.com.au/html/9780070134676.html
[02:03:30] <Casper> Richard_Cavell: are you a student or already work and study to renew or improve?
[02:03:37] <Richard_Cavell> the latter
[02:03:54] <Casper> ok
[02:19:58] <nofxx> Hm..where's avr-gcc for osx?
[02:20:11] <j4cbo> nofxx: http://www.obdev.at/products/crosspack/index.html
[02:20:33] <nofxx> j4cbo: thanks!
[05:15:43] <Hackbat> I need to know What UBRRVAL is exactly and How to calculate it
[05:16:04] <Hackbat> oh screw you google :\
[05:16:08] <Hackbat> nvm
[05:17:44] <skorket> sorry for the stupid question, but I can drive an LED directly from an I/O pin, right? I'm only drawing 20mA max from an ATMega328.
[05:20:11] <mrfrenzy> what is the max current capability according to atmega328 datasheet?
[05:20:44] <skorket> 40mA
[05:21:00] <mrfrenzy> per pin?
[05:21:01] <skorket> per pin. Max of 200mA for the whole chip
[05:21:08] <mrfrenzy> then the answer is yes ;)
[05:21:52] <skorket> yeah, sorry, just making sure. It just occurred to me that I think i've only ever seen LEDs with pullups and never being directly driven from the I/O pin so I got worried
[05:22:07] <mrfrenzy> as long as you're within spec it doesn't care if you drive transistors, LED's or motors
[05:26:19] <Hackbat> Welp that didn't fix my problem
[06:25:13] <Hackbat> I learned a valuable lesson :\
[06:26:28] <Hackbat> If you're using an arduino to sit between you and another chip when doing uart communication make sure the PC is talking to the Arduino at the correct speed
[06:36:34] <Tom_itx> Hackbat, http://www.wormfood.net/avrbaudcalc.php
[06:37:06] <Tom_itx> now that you figured it out
[06:37:40] <Hackbat> UBBR gets alot more on google than UBBRval :\
[06:37:58] <Hackbat> bbiab
[09:19:55] <Hackbat> So many lessons to be learned
[09:23:56] <asteve> Hackbat: so many times to learn them
[09:25:07] <Hackbat> learned the proper use of INT0 and PCINT0
[09:25:16] <Hackbat> @_@
[09:27:02] <rue_house> Casper, hours
[09:27:10] <rue_house> off to work, back in 9
[09:50:05] <exDM69> Yo! Is there anyone present who would be familiar with building LUFA firmwares for the ATmega16u2 in Arduino Uno Rev3
[09:51:11] <exDM69> I could use Darran Hunt's pre-built firmwares successfully but I was unable to build a working firmware from source
[09:51:43] <exDM69> I did not, however, use the exact same LUFA version, etc
[09:52:41] <exDM69> I can get a firmware to report it's descriptors correctly but when reporting HID reports something goes wrong and Linux kernel tells me that the device was reset (3 times a second)
[09:53:15] <exDM69> so I would appreciate any help from someone who has built their own firmwares
[09:54:23] <gkwhc> hi guys! might anyone here have experience working with MCU & wireless communication? How can I determine the range of transmission?
[09:59:06] <asteve> gkwhc: range of transmission being the distance you'll be able to transmit?
[09:59:21] <asteve> set up a line of sight test station and walk a foot each time
[10:02:26] <gkwhc> asteve: oh yes, i am trying to select a single chip solution (MCU + transciever) that will get me around 360ft or 100m
[10:02:44] <asteve> gkwhc: read their datasheet and specs
[10:03:14] <asteve> they will tell you how far (usually line of sight) they can transmit
[10:03:52] <Casper> gkwhc: only way is to check the datasheet. Power is meaningless so is the frequency
[10:04:30] <gkwhc> asteve, Casper: most datasheets seem to only specify power & frequency...but i will try to dig deeper
[10:04:32] <Casper> gkwhc: I've hear of a 10mW signal being picked up over 50km away, yet some need like 1W/km
[10:05:16] <Casper> gkwhc: actually, the receiver should specify the receiving sensibility and required minimum signal-noise ratio
[10:05:19] <asteve> gkwhc: are you going to use an external antenna?
[10:06:09] <Casper> the transmitter should specify it's transmit power, so you then need to calculate the wiring loss and antenna gain, then you can do math on line of sight air attenuation and see how long you can do
[10:07:16] <gkwhc> i see. i'll google for the formula
[10:08:30] <Casper> but
[10:08:44] <gkwhc> the Si101x wireless transceiver mcu im looking at has a sensitivity of -121dBm and +20dBm transmit power
[10:08:46] <Casper> you should be able to get the range of the modules too
[10:11:01] <tosmo> is a self referencing c++ template a good idea? like "template <class T, T n>". at least the compiler doesn't complain
[10:27:46] <tosmo> will gcc optimize modulo operations with powers of two to bitwise operations?
[10:28:23] <asteve> tosmo: gcc or avr-gcc?
[10:28:29] <OndraSter> I'd say, try it out
[10:29:07] <asteve> you want 8%4 to be converted to what bitwise operation?
[10:30:39] <theBear> i suppose it'd be err, shift right by 0b0100 and show whatever is left over ?
[10:30:43] <tosmo> on avr-gcc. i want x % 255 to be converted to x & 255
[10:31:38] <theBear> err, that might work for that operation in 8bit land (without thinking too hard or double checking) but it won't work for most other mod operations
[10:31:43] <tosmo> i want to write % a) for readability and b) in case the 255 actually is something else (its a compile time constant)
[10:32:52] <karlp> so, you don't want it converted to & then, do you?
[10:33:16] <tosmo> i want it to be optimized to & in all cases where its sensible
[10:33:35] <tosmo> which is whenever the second operand is 2^n-1
[10:33:40] <karlp> if the performance requirements are hard enough that you really care, compile some tests and look at the assembly.
[10:34:39] <theBear> oh wow, it is, in those cases
[10:35:14] <theBear> even if it doesn't matter for any given reason, i'd write a 1 or 3 line program right now and compile it with a few different maths then look at what i got
[10:35:17] <tosmo> theBear: yep. and it's one bitwise operation vs multiple operations involving division
[10:37:25] <theBear> on reflection tho, avr should be just as efficient the way i mentioned, which works if the mod is any exponent of 2
[10:37:37] <gkwhc> Casper: is there a name for the formula to calculate the distance of wireless transmission?
[10:40:04] <Casper> gkwhc: there is one for sure, but I do not know it
[10:40:11] <Casper> check out the ham radio channel maybe
[10:40:25] <theBear> depending on the kind of transmission/modulation/reception, there are many factors involved.... for example on an old car radio, at what point do you define the signal as "not received" ? you can sync to the carrier WELL beyond understandability of the output, especially in a dynamic signal (ie. moving) situation.... some might consider half-fuzzy audio to be received, while others may not, etc etc
[10:40:58] <gkwhc> hmm'
[10:42:24] <gkwhc> it will be used in an open field, so it might not affect the system that much, i hope
[10:43:02] <tosmo> gkwhc: in general (at least for line of sight setups) you have to increase the power proportional to square of distance, if that helps
[10:44:23] <tosmo> (or to put it another way, at constant transmission power the received signal strength will decrease proportional to the square of distance to the sender)
[10:44:39] <gkwhc> i see
[10:46:37] <Casper> in other words, doubling the distance cut the received in strength by 4
[10:49:06] <gkwhc> thanks!
[10:59:59] <nofxx> Anyone uses the Pirate Bus's UART mode? Must be missing something... need to send 'ENTER' and '"' double quote as hex? there's no escape or "real" live mode?
[11:00:48] <nofxx> "AT+FOO=\"baz\"" cant send...
[11:01:03] <nofxx> and plus need a 0x0D after to send the CR =/
[11:05:26] <OndraSter> nofxx, can you access it via regular serial on your PC?
[11:05:30] <OndraSter> I made an app just for that :)
[11:05:34] <OndraSter> it is simple and sometimes buggy
[11:05:36] <OndraSter> but you can do
[11:05:50] <OndraSter> AT+FOO="baz"\0D\0A
[11:05:51] <OndraSter> :)
[11:06:19] <nofxx> OndraSter: let me catch up, it's a app to binary control the bus pirate?
[11:06:26] <nofxx> can't have direct seril with this board...
[11:06:50] <OndraSter> no idea what you have or use, I don't have bp
[11:07:09] <OndraSter> this is desktop PC app that connects to serial port
[11:07:29] <nofxx> OndraSter: ahh got it. No, can't. Don't have serial on none of my pcs
[11:07:41] <OndraSter> well doesn't the BP create virtual one?
[11:07:42] <nofxx> on any? sorry bad french
[11:07:59] <nofxx> OndraSter: yes, but it's a PITA to use (or Im doing it wrong)
[11:08:07] <OndraSter> how do you use it? :)
[11:08:20] <OndraSter> I am used to FT232RL with its drivers and what not
[11:08:29] <nofxx> OndraSter: there's a live mode, but it's not live.. you need the quotes so it understand as a WRITE
[11:08:36] <OndraSter> oh
[11:08:38] <nofxx> "AT" ... writes to the UART
[11:08:45] <OndraSter> hmm
[11:08:45] <nofxx> but it doesnt understand
[11:08:48] <nofxx> ops.. escpae
[11:09:14] <OndraSter> can't help there, sorry man
[11:09:32] <nofxx> cant escape a quote hehe.. need to write like: "AT", 0xFF, "FOO", 0x0D
[11:09:43] <nofxx> not a really big deal, but ... lil boring
[11:10:27] <theBear> i used to use, umm, cutecom i THINK for programming related serial stuff, few dec/bin/ascii kinda modes for both view and transmit windows
[11:12:03] <OndraSter> mine is fairly simple... anything from between 0-9/a-z/A-Z is showed as character (+ the others like CRLF, space, ..)
[11:12:06] <OndraSter> the rest is hex :)
[11:13:30] <theBear> but can you easily type EITHER FF in hex, OR 0xFF in text ?
[11:14:03] <OndraSter> yes
[11:14:06] <OndraSter> only \ is hard to type :)
[11:14:09] <OndraSter> \ in ASCII
[11:14:30] <theBear> hehe
[11:14:43] <OndraSter> you need \'s ASCII value
[11:15:07] <nofxx> there's a binary protocol to talk to the bus pirate, I might try some scripting. A kind of REPL terminal as you did OndraSter.
[11:15:18] <nofxx> thanks theBear too, check out cutecom
[11:15:58] <OndraSter> nofxx, I made it in C# and I am afraid you might be one... of those
[11:17:15] <Kevin`> one of those people who uses appropriate tools to the job? ;p
[11:17:26] <OndraSter> no
[11:17:28] <OndraSter> who uses looniks :P
[11:17:38] <Kevin`> as I said.
[11:18:27] <OndraSter> -.-
[11:18:35] <theBear> sigh, these casual slurs do nothing to encourage race-relations
[12:41:27] <RikusW> Reverse engineered that fence enrgizer a bit today
[12:42:02] <RikusW> seems they measure fence voltage using 2x 150k + led and a phototransistor
[12:44:43] <RikusW> and the remote signal is detected via 2x 27pF (made from 1.6mm pcb) and a opamp
[12:45:24] <RikusW> seems lightning killed the tea1507 smps ic, since battery mode still works....
[12:47:14] <exDM69> Re: Has anyone successfully built a LUFA firmware for ATMega16u2/Arduino Uno Rev3?
[12:47:28] <Tom_itx> i'm guessin abcminiuser has
[12:47:43] <abcminiuser> Whats different about the R3?
[12:48:37] <exDM69> R3 has 16u2
[12:48:40] <exDM69> not 8u2
[12:48:50] <exDM69> abcminiuser: you are the developer/maintainer of LUFA?
[12:49:07] <abcminiuser> exDM69, sole developer, yes
[12:49:25] <exDM69> abcminiuser: cool! thanks for your efforts!
[12:49:43] <exDM69> now, can I bother you for a while, I have not had success building a LUFA-based firmware from source
[12:49:48] <Tom_itx> abcminiuser is da man!
[12:50:06] <abcminiuser> exDM69, you're welcome :)
[12:50:11] <abcminiuser> What's the error you get?
[12:50:30] <exDM69> abcminiuser: I could use one of Darran Hunt's pre-built firmwares but I was unable to build one myself
[12:51:13] <exDM69> the version of LUFA Mr.Hunt used (100807 or sth) did not build out of the box with the version of GCC I have at hand
[12:51:39] <exDM69> so I took the latest release tarball and I also tried SVN trunk
[12:52:07] <exDM69> I was able to successfully build and flash the firmware, connect the USB device and see it appear as a joystick
[12:52:33] <exDM69> but when I tried reading it, I got a bunch of error messages from the Linux kernel
[12:52:35] <mrfrenzy> RikusW: lightning often kills them unfortunately, a spark gap helps a little
[12:52:40] <exDM69> "full-speed usb reset" or sth
[12:53:28] <exDM69> abcminiuser: should LUFA SVN trunk or latest release 120xxx work with the ATMega16u2 in the UnoR3?
[12:53:58] <abcminiuser> Latest SVN trunk should work fine for joystick
[12:54:06] <abcminiuser> Latest release may have a Linux bug
[12:54:24] <abcminiuser> Arduino serial firmware is probably super old and needs to be updated to match the new API however
[12:54:39] <RikusW> mrfrenzy: there is some mov's and a gas arrestor, the ic is cheap, I'll just try replacing it
[12:54:53] <exDM69> abcminiuser: I am using the arduino serial binary that came with arduino, no problem there
[12:55:09] <Tom_itx> abcminiuser, did they put a bigger 'UNO' chip on the R3?
[12:55:19] <Tom_itx> iirc they used a u8 before didn't they?
[12:55:30] <Tom_itx> 8U2*
[12:55:39] <abcminiuser> Tom_itx, yes, looks like it
[12:55:49] <Tom_itx> wonder if they kept running out of room
[12:56:04] <abcminiuser> exDM69, try building the latest trunk's joystick
[12:56:19] <exDM69> abcminiuser: it builds
[12:57:15] <abcminiuser> But doesn't run?
[12:57:40] <exDM69> abcminiuser: I took Demos/Device/ClassDriver/Joystick, removed Board/{Joystick,Buttons} stuff and report a constant dummy HID report
[12:58:08] <mrfrenzy> RikusW: I was thinking baout this http://www.lantbutiken.se/butik/askskydd-for-elaggregat/215-askskydd-som-skyddar-mot-att-askan-skadar-elaggregatet-7393609082168.html
[12:58:27] <exDM69> abcminiuser: it builds, flashes, the usb devices boots, reports itself correctly as a joystick with correct number of buttons and all but when reading from the joystick something goes wrong
[12:58:40] <mrfrenzy> but that won't protect about line spikes ofcourse
[13:00:29] <RikusW> mrfrenzy: http://www.gallagher.co.nz/energizer.aspx?mktprodid=3009
[13:00:37] <abcminiuser> exDM69, what's the error you see, and what does dmesg say?
[13:01:20] <mrfrenzy> looks like a nice unit
[13:01:58] <exDM69> abcminiuser: I only get an error in dmesg saying "kernel: usb 1-2.1: reset full-speed USB device number 36 using ehci_hcd"
[13:02:09] <exDM69> abcminiuser: no error from jstest, which I was using for testing
[13:02:14] <RikusW> mrfrenzy: at the default 5joule pulse its gives you quite a kick :-P
[13:02:25] <mrfrenzy> ooh yes I know
[13:02:34] <mrfrenzy> even with rubber boots
[13:02:46] <RikusW> especially if you are earthed well....
[13:03:02] <mrfrenzy> I try to avoid that ;)
[13:03:07] <abcminiuser> exDM69, when did you pull from trunk?
[13:03:11] <RikusW> me too ;)
[13:03:14] <Tom_itx> RikusW, trying to keep the neighbor kids out?
[13:03:16] <exDM69> abcminiuser: yesterday
[13:03:17] <mrfrenzy> but it has happened, holding an iron spear and touching the fence...
[13:03:30] <RikusW> Tom_itx: trying to keep the cattle in...
[13:03:37] <abcminiuser> exDM69, darn that should be the corrected version then
[13:03:39] <abcminiuser> Hrm
[13:03:46] <exDM69> abcminiuser: but the exact same thing happened with latest release tarball version
[13:03:51] <abcminiuser> Does it immediately reset, or just when you try to read?
[13:03:59] <exDM69> only when reading
[13:04:14] <exDM69> 3 resets, 1 second pause, 3 more resets, pause, repeat
[13:04:26] <exDM69> kill jstest -> resets stop
[13:04:58] <RikusW> mrfrenzy: what energizer brand do you have ?
[13:05:35] <mrfrenzy> foga techtronic
[13:05:45] <mrfrenzy> but it's in the shed since I don't have any cattle atm
[13:05:46] <RikusW> not heard of it
[13:06:11] <RikusW> I've built one too, using a microwave transformer
[13:06:14] <mrfrenzy> it's a swedish brand
[13:06:23] <RikusW> and a 20uf pulse grade cap
[13:06:39] <mrfrenzy> I wouldn't dare doing that
[13:06:46] <RikusW> charged it to about 650V via a scr into the MOT
[13:07:13] <exDM69> abcminiuser: https://gist.github.com/2285710 here's the Joystick.h I've used
[13:07:16] <RikusW> getting it to oscillate at 1s was tricky
[13:07:32] <exDM69> abcminiuser: Joystick.c that is
[13:07:45] <mrfrenzy> easy to kill cattle(and people) if you get it wrong
[13:07:55] <mrfrenzy> for example the oscillation stops or you charge the cap too high
[13:08:21] <RikusW> if the osc stops its just off
[13:08:49] <abcminiuser> exDM69, seems ok, only thing I can think of would be Linux getting unhappy that the report is fixed
[13:08:55] <RikusW> mine was about 4 joules
[13:09:06] <abcminiuser> I haven't got my equipment here yet to test it out locally
[13:09:12] <mrfrenzy> you connect the cap alternately between MOT and fence?
[13:09:37] <exDM69> abcminiuser: what about the makefile? what should I use for arduino uno?
[13:09:37] <RikusW> no via the MOT to the fence so 650V * 10
[13:09:55] <mrfrenzy> aha, clever
[13:09:57] <RikusW> cap -> scr -> MOT primary
[13:10:05] <RikusW> 2N6509 iirc
[13:10:08] <exDM69> abcminiuser: or the ATMega16u2 in the uno. Where can I find the appropriate values for MCU, BOARD, F_CPU
[13:10:10] <mrfrenzy> so if it gets a constant DC there would be no voltage on fence
[13:10:44] <exDM69> I have: MCU = at90usb162, BOARD = UNO, F_CPU = 16000000
[13:11:09] <RikusW> I've put in a trigger circuit to turn on the scr when the cap reaches a certain voltage
[13:11:34] <RikusW> and then a voltage multiplier using a 470nF cap to the 20uF one
[13:11:38] <RikusW> directly from mains
[13:12:45] <RikusW> the mains charging current is too low to keep the scr on
[13:13:15] <exDM69> abcminiuser: btw. what compiler have you been using with LUFA? I have avr-gcc from gcc's git repo
[13:13:31] <exDM69> can that cause issues you are aware of?
[13:13:56] <abcminiuser> exDM69, MCU = atmega16u2, F_CPU = 8000000, F_USB = 8000000, BOARD = UNO most likely
[13:14:07] <abcminiuser> I use the WinAVR and Atmel Toolchain versions of avr-gcc
[13:14:26] <exDM69> abcminiuser: is MCU used for anything else than dfu-programmer?
[13:14:50] <exDM69> because that is the correct value I have to give for dfu-programmer, it's a bug in it
[13:14:50] <Tom_itx> of course
[13:15:02] <abcminiuser> MCU is used to set what CPU you are compiling for, if you set that wrong it'll generate an invalid hex
[13:15:12] <exDM69> okay
[13:15:13] <Tom_itx> mcu specifies what chip to compile the code to
[13:15:17] <Tom_itx> for the registers etc
[13:15:39] <exDM69> I will change MCU to that value and not use "make dfu" then
[13:15:41] <Tom_itx> except in a couple cases :)
[13:15:46] <RikusW> 16u2 and 162 is fairly similar...
[13:16:09] <Tom_itx> at90sb162 will work on atmega32U2
[13:16:24] <Tom_itx> probably not vice versa
[13:16:41] <RikusW> bootloader location won't be right
[13:16:58] <Tom_itx> it works
[13:17:51] <exDM69> abcminiuser: I will now rebuild, flash and test, brb
[13:25:22] <exDM69> abcminiuser: I tried with the values you gave, and the result was worse. Changed F_CPU=16.. and got back to where I started
[13:28:14] <exDM69> abcminiuser: next I'll try to get a wireshark capture of the USB traffic
[13:28:29] <Tom_itx> the MCU and F_CPU should be defined regardless of any other errors
[13:29:02] <exDM69> they are defined
[13:29:34] <Kevin`> what frequency crystal does the arduino actually use? what are you setting the prescaler to?
[13:29:42] <Tom_itx> and you don't want F_CPU = 16, rather #define F_CPU 16000000UL
[13:30:03] <abcminiuser> Use F_* to match the crystal on the board
[13:30:45] <exDM69> F_CPU = 16000000
[13:31:05] <Tom_itx> it is a constant, not a var
[13:31:10] <exDM69> This what was used in dhunt's Arduino
[13:31:23] <Tom_itx> fcking arduinos
[13:31:23] <exDM69> Tom_itx: it's defined in the makefile and compiler args
[13:31:56] <exDM69> don't bash, arduino's are what got me interested in micros
[13:32:33] <Tom_itx> they have their place until someone has trouble then their place becomes here
[13:32:39] <Tom_itx> which is ok i suppose
[13:33:08] <Kevin`> the schematic says the usb chip has a 16mhz crystal, fwiw
[13:35:31] <exDM69> Tom_itx: I promise to try to contribute something back
[13:38:40] <abcminiuser> exDM69, any chance you can try the mouse demo?
[13:38:58] <abcminiuser> Narrow it down to either the stack/board or the joystick code specifically
[13:39:07] <exDM69> abcminiuser: I'd have to make a dummy version out of it
[13:40:50] <j4cbo> dear atmel
[13:41:32] <j4cbo> the atmega32u4 can do usb without an external crystal at all, as long as it's at low speed and in a reasonable temperature range
[13:41:39] <j4cbo> so
[13:41:52] <j4cbo> Y U NO SHIP THE MEGA32U4RC WITH A BOOTLOADER?
[13:42:48] <Kevin`> j4cbo: why not just put one on the chip with isp?
[13:43:16] <j4cbo> well, that's what i did, but it would be nice to not have to
[13:43:26] <j4cbo> (not have to bring out the ISP pins, etc)
[13:43:42] <OndraSter> you can get away with small pads
[13:43:45] <RikusW> m32u2 does come with a bootloader
[13:43:46] <OndraSter> and programming pogo pins :)
[13:46:39] <Kevin`> not bringing out the isp pins to at least pads would be mistake. you should really do jtag too if you don't need those pins for something else. you'll regret that the first time you need to fix it or change fuses or debug your software or ..
[13:47:59] <OndraSter> if it is production device, then it is not worth it... if there would be BL pre-programmed, you wouldn't need them :)
[13:48:07] <OndraSter> although, you would probably use non-stock bootloader
[13:48:24] <OndraSter> just take out ISP pads somewhere :P
[13:50:27] <Kevin`> OndraSter: I mean for a production device. changing a setting on one device by soldering tiny wires is painful enough, try doing it on 200
[13:50:44] <OndraSter> if you ship the device, you want to be sure it works :P
[13:51:04] <OndraSter> so if you had the option to pre-programm it directly through USB, it would be k3wl
[13:51:10] <OndraSter> and later rewrite the stock BL with your own one
[13:51:16] <OndraSter> that you would develop somewhere
[13:51:17] <Kevin`> oh, sure it works, except 5% fail after a week because of edge conditions
[13:51:50] <OndraSter> on the other hand, chinese have easier way to dump it ...
[13:51:54] <OndraSter> you'd have to lock the bits probably
[13:51:55] <Kevin`> hah
[13:52:12] <Kevin`> lock bits don't prevent you from completely rewriting the chip
[13:52:17] <Kevin`> anyway, pads don't cost anything.
[13:52:20] <OndraSter> you can't read it
[13:52:26] <OndraSter> you can completely erase it
[13:52:29] <Kevin`> so what if you can't read it, why would you need to read it
[13:52:40] <OndraSter> chinese can't read it
[13:52:43] <Kevin`> you erase it and write the changed firmware back to it
[13:52:45] <OndraSter> and copy it completely
[13:52:48] <OndraSter> oh well
[13:52:50] <OndraSter> you are right
[13:52:59] <Kevin`> eh?
[13:53:03] <Kevin`> china what now?
[13:53:10] <OndraSter> china copies everything!! :D
[13:53:10] <Kevin`> I was talking about internal use
[13:53:23] <OndraSter> china copies even unreleased stuff often :P
[13:54:04] <mrfrenzy> well then there is an internal leak
[13:54:17] <Kevin`> OndraSter: what i don't understand is why you were talking about china at all :D
[13:54:24] <OndraSter> :))
[13:54:33] <OndraSter> just trying to joke :(
[13:54:53] <OndraSter> afk
[13:54:57] <Kevin`> and indeed china will copy even locked devices
[13:55:14] <Kevin`> you only need to do it once, so wacky timing attacks or decapping is fine
[14:02:05] <exDM69> abcminiuser: mouse demo gives exact same behavior, usb init works fine, descriptors seem correct but then I start getting the resets to dmesg again
[14:18:25] <exDM69> abcminiuser: next up: getting a wireshark trace of some usb traffic
[18:36:45] <skorket> I'm writing a program in C for the ATMega328. I have an array of ports (i.e. unsigned char p[] = { PORTB, PORTC, PORTD }) and now I want to do something like: " p[0] |= (1<<PB0); ". This is obviously wrong, but what is the right way?
[18:37:29] <skorket> I could, for example, write a long if statement that examines the value of p[i] and then do the appropriate port option, but that seems unwieldy
[18:43:29] <Casper> I'ld say that pointers are what you are seeking for
[18:47:52] <skorket> volatiles uint8_t *foo = &PORTB; ... *foo |= (1<< PB0); would work?
[18:47:56] <skorket> *volatile
[18:51:11] <timemage> skorket, it should
[18:51:23] <skorket> ok, thanks, I'll try it out
[18:58:45] <timemage> volatile uint8_t * const portarr[]={ &PORTB }; *portarr[0] = 'x'; should be effectively PORTB='x'; you could define a macro to do this if you wanted to avoid using * to dereference.
[19:24:33] <Hackbat> I love that moment when you stop seeing a mess of crap text and you suddenly "see the matrix".
[19:24:49] * rue_house quickly puts a blast shield around the volatile integer
[19:31:13] <timemage> heh.
[19:41:51] <wollw> Hackbat: like working with arrays of bitfields? :)
[19:56:22] <Hackbat> wollw, :P I'm just meaning understanding code for these things
[19:56:38] <Hackbat> wow this is a REALLY consistent bug
[19:58:24] <Tom_itx> feature
[19:58:50] <Tom_itx> pass it on to marketing
[19:59:08] <Hackbat> :P
[19:59:33] <Hackbat> It's a bug with my design not with AVR :P
[20:00:09] <Hackbat> The relay bounces the contact EXACTLY 3 times
[21:56:54] <inflex> Oh dear fugging GOD... a whole batch of boards I built I put the chip on backwards *face palm*
[21:57:24] <inflex> *test* POOOF "hrmm... must have been a bad luck item..." *test* ]POOOF[ "Okay, that's not good
[21:58:03] <Tom_itx> you've been away too long
[21:58:12] <inflex> nah, built these weeks ago
[21:58:23] <inflex> but I built them at 10pm... bad move.
[21:58:33] <inflex> should never build batches after sun-down, or certainly no later than 9pm
[22:05:04] <Casper> inflex: blame beer
[22:05:56] <inflex> Casper: right, wish that was that case :(
[22:07:36] <Casper> you probably talked to some aussie before doing it, they take more alcohol than russian, just talking to them, the fumes are enought to drunken you up :D
[22:07:57] <Casper> ah right, you're aussie... must be the alcohol in the air :D
[22:08:19] <Casper> (actually, almost every aussie that I talk to... are near always drunk)
[22:19:15] <inflex> bastard ;)
[23:42:25] <Valen> http://vimeo.com/17517733 #australia ;->