#avr Logs

Mar 17 2018

#avr Calendar

12:08 AM day__ is now known as day
12:13 AM day__ is now known as day
12:51 AM ohsix_ is now known as ohsix
01:36 AM * nuxil yawns and sips some coffee.
01:39 AM nuxil: jsoft, that warning i had several times, you get it if you use -Wstrict-prototypes and dont have void in functions with no aruments in the prototype declaration.
01:39 AM nuxil: so example with -Wstrict-prototype and a prototype delcaration like.
01:40 AM nuxil: void foo()
01:40 AM nuxil: will give error while
01:40 AM nuxil: void foo(void) will not
01:40 AM nuxil: */err.. warning.. not error
01:42 AM nuxil: also it just a warning. and the code will work.
01:46 AM nuxil: Ameisen, lol woot ? have you reported that ?
01:48 AM rue_: recon you cant prototype a macro
01:48 AM rue_: void extern ?
01:52 AM nuxil: his issues is elsewhere and not related to the macro.
01:52 AM nuxil: #define PIN_RESET_SET_OUTPUT() DDRC |= ( 1 << 3 ) should not give a warning like: implicit declaration of function ‘PIN_RESET_SET_OUPTU
01:52 AM nuxil: i just put that line into my code and compiled it without such a warning.
01:56 AM nuxil: i guess he has a function named PIN_RESET_SET_OUTPUT() somewhere.
01:56 AM nuxil: + the macro with same name
02:10 AM day__ is now known as day
03:33 AM jsoft: nuxil, thanks
03:41 AM nuxil: np. hope it was helpful
05:28 AM Jan-: hihi avr people
05:28 AM * Jan- waves
05:42 AM * antto drops a pic18f on the concrete floor
05:42 AM * antto steps on it
05:43 AM antto: "oops" ;P~
06:15 AM polprog: https://www.youtube.com/watch?v=6sSFUVL-bqc
06:17 AM polprog: antto: ^^ :D
06:21 AM antto: this.. is.. so.. wonderful
06:21 AM antto: :~)
06:24 AM polprog: http://electricstuff.co.uk/destructotron.html
06:24 AM polprog: beautifil device
06:24 AM polprog: beautiful*
06:45 AM antto is now known as h4x0riz3d
07:04 AM Emil: jsoft: that is horrible code
07:05 AM jsoft: Emil, cool bro
07:08 AM jsoft: Emil, Any earth shattering revelations as to why ? Or are you just a passing critic ?
07:15 AM Emil: jsoft: salty
07:15 AM Emil: #define PIN_RESET_SET_OUTPUT() DDRC |= ( 1 << 3 ) // PORTC 3 is literally bug
07:15 AM jsoft: hows taht ?
07:15 AM Emil: a) not using () to protect the macro expansion
07:15 AM Emil: b) using // comments in defines
07:15 AM Emil: c) having such a stupid function anyways
07:16 AM Emil: d) the comment section is literally eating your ; end statement symbol
07:16 AM Emil: (not really but it could be in a better world)
07:17 AM jsoft: what do you mean by a ?
07:17 AM jsoft: how would you do that
07:17 AM Emil: also e) idiotic name
07:18 AM h4x0riz3d: jsoft #define WUB() do { ugly_code_goes_here; } while (0)
07:18 AM Emil: I would a) not use a macro, DDRC|=(1<<PC3) is clear and concise
07:18 AM Emil: ALONE
07:19 AM Emil: b) #define MACRO() (THINGS HERE), or like h4x0riz3d said
07:20 AM Emil: d) if you really want to wrap such in a function like structure then just actually wrap it in a function like structure, gcc will inline it for you anyways
07:20 AM Emil: void setpc3asoutput(void){DDRC|=(1<<PC3);}
07:21 AM jsoft: Right ok. Well I did not know about b. But if you must know, this was just a change of an over abstracted library I was slowly cutting down
07:22 AM jsoft: The comment thing was noted earlier, and I removed that.
07:22 AM jsoft: But why the do { } ?
07:22 AM Emil: because it actually protects it
07:23 AM jsoft: protects it from other characters or whatever from ballsing it up you mean?
07:23 AM jsoft: that might be after or around the macro ?
07:23 AM Emil: https://stackoverflow.com/questions/257418/do-while-0-what-is-it-good-for
07:24 AM jsoft: Emil ahh I see
07:25 AM Emil: jsoft: anycase, just write DDRC|=(1<<PC3);
07:25 AM jsoft: No I its a thing where the pins changes
07:25 AM Emil: ...
07:26 AM Emil: that was your macro
07:26 AM jsoft: s/I//
07:26 AM Emil: DDRC|=(1<<3)
07:26 AM jsoft: Oh sorry, Gotchya
07:26 AM Emil: just write DDRC|=(1<<PC3); directly, don't macro it
07:27 AM Emil: or _BV(PC3) or something
07:27 AM jsoft: The reason I was using macros in this case is so I can shove all the various pins which change by board or situation into one area.
07:28 AM Emil: then I recommend #define THING DDRC #define THINGPIN PC3
07:28 AM jsoft: Hmmm
07:28 AM Emil: And now you can write THING|=(1<<PC3);
07:28 AM jsoft: Right, good point
07:28 AM Emil: And now you can write THING|=(1<<THINGPIN);
07:28 AM jsoft: But then I also need a define for DDRC
07:29 AM jsoft: oh no, misread.
07:29 AM jsoft: Yeah that makes more sense
07:29 AM Emil: If it's actually something that can change during development sure you can macro the whole thing
07:29 AM Emil: but I don't recommend it
07:30 AM jsoft: All right, noted, thank you :)
07:30 AM nuxil: use jartza's macros :p
07:31 AM nuxil: ""simple as"" https://pastebin.com/Dtu4W0Mf
07:32 AM nuxil: here https://gist.github.com/Jartza/56d006504316ef5fe5a3db1b3e438ca9 :p
07:32 AM * nuxil slaps Emil with some _BV macros :p
07:32 AM nuxil: _BV is awefull :)
07:34 AM nuxil: sorry. but i really like thouse macros :)
07:48 AM Emil: nuxil: I know
07:48 AM Emil: nuxil: _BV looks horrible
07:49 AM Emil: But it's "standard" from the libc
07:50 AM Emil: so that's why I can tell people it exists :D
02:20 PM day__ is now known as day
02:36 PM Jartza: hobla
02:37 PM nuxil: howdy
02:38 PM nuxil: Jartza,i think on monday i'll finnaly get my 3d printer.
02:38 PM nuxil: it left LEIPZIG / GERMANY 12 hours ago with dhl :)
02:46 PM Jartza: yay
02:48 PM nuxil: i'm excited
02:52 PM MrFahrenheit: man, what is it with cheap scopes and the manufacturer's inability to write a simple usb protocol... finally figured out why this scope's usb interface doesn't work on linux
02:53 PM Emil: MrFahrenheit: talk to us
02:53 PM MrFahrenheit: the scope says, "message is 58 bytes long", then returns 52... and when the driver asks for the other 6, the scope goes apeshit and just returns a random chunk of memory
02:53 PM MrFahrenheit: I heard the rigol has a similar issue
02:53 PM Emil: If you figured out why it doesn't work on linux you should be able to write a rather simple translation layer
02:53 PM Emil: MrFahrenheit: lolwat :D
02:53 PM Emil: MrFahrenheit: how can it work on winshit then?
02:54 PM MrFahrenheit: well yes, but the the driver turns into "if this device then this, if that device then that"
02:55 PM Emil: buthowcanitworkonwinshit
02:55 PM MrFahrenheit: well I've realised that firmware makers tend to tailor their firmware to windows driver quirks, so they probably hacked at it till it worked on windows whatever the reason may be, and never looked at the spec
02:55 PM Emil: ifitdoesn'tworkonlenux
02:56 PM MrFahrenheit: the windows driver probably doesn't follow the spec, the spec says "if the message says there's more bytes to read, ignore the end-of-message marker bit"
02:56 PM MrFahrenheit: kinda counterintuitive, so probably why it was implemented wrong
02:57 PM MrFahrenheit: there's actually a "rigol_quirks" mode in this driver, gonna see if that makes it work on this scope
02:58 PM nuxil: stick to windows :p
02:58 PM Emil: nuxil: btfo
02:58 PM * nuxil hides
02:58 PM Emil: this is a linux #safespace
02:58 PM Emil: ;D
02:58 PM MrFahrenheit: I actually tried to install windows on a usb yesterday to check if the driver works there... what a POS OS
02:59 PM MrFahrenheit: took all day to install it, then I installed a usb capture driver and it BSOD
03:05 PM MrFahrenheit: funny thing is, I have the previous model of the same scope and it works fine, so they forgot how to write code while they were making the new one
03:06 PM nuxil: is it possible to update the firmware ?
03:07 PM MrFahrenheit: yes, but I doubt they will improve this, they'll just say "use windows"
03:09 PM MrFahrenheit: actually, I was wrong earlier, the message IS 58 bytes, what they do wrong is they don't add a header on the second message part, they just send the data
03:18 PM Jartza: ouch. I'm using mac :(
04:07 PM h4x0riz3d: much shame
04:24 PM polprog: not using bsd on sparc
04:24 PM polprog: amateur hour
04:33 PM MrFahrenheit: got the scope working, turns out both the scope and the driver are buggy
04:34 PM MrFahrenheit: but the scope bugs are manageable once the driver works
04:34 PM nuxil: what brand and model?
04:34 PM MrFahrenheit: siglent sds1202x-e
04:34 PM nuxil: ahh.
04:34 PM MrFahrenheit: the old sds1102cml worked out of the box, not sure why they didn't just copy the code
04:34 PM nuxil: siglent is knowns for bugs
04:35 PM MrFahrenheit: I mean it breaks the usb spec in the interface descriptor 3 times, so yeah...
04:36 PM MrFahrenheit: and it has an interrupt endpoint that gives you an error if you try and use it
04:41 PM MrFahrenheit: I think the old scope only worked due to having a larger buffer on it so it could send all replies in a single message
04:42 PM polprog: tried to make rigol work in sigrok
04:43 PM polprog: not worth it
04:43 PM polprog: unles i, like really really needed to capture the trace in a sane format
04:44 PM MrFahrenheit: I think this would work fine, sigrok now has a siglent driver
04:46 PM MrFahrenheit: nope, doesn't work :P
04:49 PM polprog: what are you trying to set up on the PC side :D ?
04:53 PM MrFahrenheit: I made a bode plotter
04:54 PM MrFahrenheit: here, a first order rc low-pass vs a second order one: https://imgur.com/a/vYArO
04:54 PM polprog: nice
04:55 PM MrFahrenheit: it measures the frequency, amplitude and phase on the scope, so you just sweep your function generator slowly and do captures
04:55 PM polprog: adv maths. this is the part of electronics i suck at. ergo analogue is mostly voodoo for me
04:56 PM MrFahrenheit: can't go below 40 db though, even upping the input voltage does little at that level
04:56 PM polprog: -40db is like 1/10k right?
04:57 PM polprog: oh wait its 40 db. wheres your zero?
04:58 PM MrFahrenheit: it's 1/100
04:58 PM MrFahrenheit: for voltage at least
04:58 PM MrFahrenheit: 1/10k for power
04:58 PM polprog: Oh right
04:59 PM MrFahrenheit: that's always the confusing part with dB units, it always depends what you're talking about
04:59 PM polprog: something 20 log (A/A0) or what was it?
04:59 PM MrFahrenheit: yeah
04:59 PM MrFahrenheit: *depends on
05:00 PM polprog: last weekend i was denoising an audio tape. vhs rip. noise level was -50db.
05:00 PM polprog: signal peak at -20. fun
05:02 PM cehteh: hah yes, i've seen super8 films from the 60's which where in much better condition than vhs tapes from the 80's ... vhs really leaves some short dark age behind
05:02 PM MrFahrenheit: that reminds me though, I might be able to go below 40dB on the amplitude chart, I did find a noisy dc adapter plugged into my workbench power line, it was affecting scope readings
05:03 PM polprog: someone told me betamax was way better at sound though. we should have been recording porn on those instead
05:03 PM polprog: then they would become widely adopted
05:03 PM Emil: cehteh: well, super8 is actual film
05:03 PM Emil: cehteh: while vhs is magnetic tape
05:03 PM polprog: as vhs won because of pr0n
05:04 PM Emil: polprog: betamax was better
05:04 PM Emil: is better
05:04 PM Emil: vhs won because market adoptation
05:04 PM twnqx: price*
05:05 PM polprog: all of those
05:07 PM Emil: twnqx: market adoptation is a fancy word for price and availability
05:08 PM MrFahrenheit: so the driver works now, just 2 lines changed, but one of them involved the rigol quirk... maybe I should ask rigol to send me a scope so I can test the driver with it :P
05:09 PM polprog: wait you are writing a driver for the scope
05:09 PM polprog: wow
05:09 PM MrFahrenheit: no, just fixing the existing one
05:12 PM cehteh: Emil: and?
05:13 PM Emil: cehteh: degrading physical media is a lot harder than degrading magnetic media
05:13 PM cehteh: magnetic is physical :)
05:13 PM Emil: herp derp :D
05:15 PM cehteh: besides gelatin, organic dyes, cellulose .. film should (and will) degrade pretty much too. that some newer technology (vhs) got that *much* worse is rather bad
05:16 PM Emil: Not really
05:16 PM cehteh: later digital film/tapes are considerably better
05:16 PM Emil: Physical media stores all the picture data in a single separate entity
05:16 PM Emil: vhs stores "digital" data
05:16 PM cehteh: dunno about betamax in terms of storage, but since its analog i suspect thats the same as vhs
05:17 PM cehteh: vhs is analog
05:17 PM cehteh: and that was the main problem
05:17 PM Emil: well I don't know about betamax vs vhs longevity
05:17 PM cehteh: basically they just recording plain old TV signal (NTSC or PAL) with some tricks on tape to cope with the high bandwidth required
05:17 PM cehteh: and no error correction
05:20 PM nuxil: magnetic tape ftw :)
05:25 PM nuxil: <Emil> cehteh: degrading physical media is a lot harder than degrading magnetic media.
05:26 PM cehteh: digital tapes have a lot error correction
05:26 PM nuxil: if you think about cd/dvd and such. then nah no way hosey
05:26 PM nuxil: they rot
05:26 PM nuxil: http://cdm.link/2017/02/a-generation-of-cds-is-already-rotting-and-dying/
05:26 PM cehteh: and anyone remembers Laserdisk? :) ... thats the worst of all ...
05:26 PM nuxil: https://www.youtube.com/watch?time_continue=125&v=3TYBb9eHgdU
05:26 PM nuxil: like that one ?
05:26 PM nuxil: :p
05:27 PM cehteh: huge platters, still analog
05:27 PM cehteh: ja
05:28 PM polprog: holy moly it looks like a combo of a CD and a Vinyl
05:29 PM cehteh: thats it
05:30 PM cehteh: https://www.youtube.com/watch?v=PRFQm0eUvzs
05:42 PM nuxil: Movies on Vinyl - VHD :D
05:43 PM nuxil: https://www.youtube.com/watch?v=nqA0pyN_vYU
05:44 PM polprog: and i thought zip disks are weird
05:45 PM polprog: replaced the dc jack on my zip 100 drive hoping to read some zipdisks i found around the house. but i loose the bios prompt on serial port when i plug the drive to the parport on the sun
05:46 PM polprog: id have to bring up the pentium box or find the parport PCI card and put it in the amd PC. not worth it. especially resurrecting the pentium box
05:47 PM polprog: and iomega is a dead company anyway
05:48 PM polprog: whats on those pumped up floppies shall stay secret then.
05:53 PM twnqx: i only had scsi zips
05:58 PM polprog: i shot kind of a teardown / repair video abot that zip because it has a pretty neat mechanism inside. I could try and install the paralell port card in my PC (it didnt work with my printer) so i could film it in action
06:15 PM Jartza: I just designed a case for my new 3D printer controller board
06:15 PM Jartza: new printer = the one I'm building
06:58 PM rue_shop3: I'm just finishing the changes to the one I just built
06:58 PM rue_shop3: I think
06:58 PM rue_shop3: changing to M5x0.8
06:58 PM rue_shop3: so M92 Z2000
07:10 PM MrFahrenheit: good news everyone, I found more bugs in this scope's usb interface :)
07:10 PM MrFahrenheit: like it was written by monkeys
07:13 PM twnqx: probably not too far from the truth
08:25 PM Ameisen: Jartza - I'm still working on my 3d printer firmware
08:34 PM arduiko: Do you have this result https://pastebin.com/E5ygyiEw with https://sites.google.com/site/therobotronics/arduino/connect-a-phototransistor-to-arduino
08:35 PM arduiko: without doing anything
09:10 PM * Ameisen is investigating exceptions in ARM embedded
09:10 PM Ameisen: haven't investigated them in AVR yet.
09:10 PM Ameisen: Though some of the stuff I've seen shows that exceptions are sometimes _smaller_ than traditional error codes
09:59 PM arduiko: Does someone have already work with https://media.digikey.com/pdf/Data%20Sheets/Everlight%20PDFs/PT2559B_L2-F.pdf ?
09:59 PM arduiko: I got this result: https://pastebin.com/E5ygyiEw
11:08 PM rue_shop3: digikey made their suecurryity too high for my browser, what is it?
11:08 PM rue_shop3: and no, I can update my browser to YOU rewrite my cad software
11:08 PM rue_shop3: and your not doing that, so :P