#avr Logs

Feb 22 2018

#avr Calendar

01:23 AM rue_shop: hah, accidents happen, my car might catch fire and I'd like my logic analizer to survive that, oh and if there is an appocalypse
01:26 AM rue_shop: cause, ya know, after that, your gonna want your logic analizer to work
01:26 AM Haohmaru: what if.. zombies?
01:28 AM Haohmaru: someone isn't prepared for the zombies, someone is gonna be a human-flavored zombie snack
02:02 AM Casper: rue_shop: no, you don't want your LA to survive, you want to know who in town have a better one than your and how to get your hand on it!
02:23 AM rue_: heh
02:23 AM rue_: of the "you dont have to outrun the zombie, you just need to outrun the other guy" solution.
02:24 AM Haohmaru: kick him in the knee, that's how
03:00 AM _ami_: i think Rigol DS1054Z is the one which i want!
03:00 AM _ami_: its good for what i do. digital electronics at most of the time so more channels are required.
03:01 AM _ami_: the serial hack to unlock all features on Rigol 1054Z still works ?
03:28 AM nohitzwork: did you find any info _ami_ ?
03:28 AM nohitzwork: about the hack
03:28 AM nohitzwork: im gonna get that scope too
03:29 AM Emil: nohitzwork: buying which scope?
03:29 AM Emil: I should also acquire a scope
03:29 AM nohitzwork: Rigol DS1054Z
03:29 AM nohitzwork: https://www.ebay.com/itm/Rigol-DS1054Z-Digital-Oscilloscopes-Bandwidth-50-Mhz-Channels-4-/331941742120?hash=item4d49450628
03:29 AM Emil: Preferably one for free from one of those giveaways that scope fabs have :D
03:29 AM Haohmaru: i am very put off from this DS1052E here
03:30 AM Haohmaru: nohitzwork that's in the US..
03:31 AM nohitzwork: yes it is
03:31 AM Haohmaru: weren't you somewhere in the EU?
03:31 AM nohitzwork: yes
03:31 AM Haohmaru: eek then
03:32 AM nohitzwork: its 310e shipped, plus the taxes or whatever
03:33 AM Haohmaru: aren't the customs gonna love it? ;P~
03:34 AM nohitzwork: well i have to make calculations which is the best/cheapest way to get it
03:34 AM Haohmaru: if i were you, i'd try to get it from within the EU
03:35 AM _ami_: In S. korea, the same model price is 600$
03:35 AM Haohmaru: cuz in it's very hard for me to figure out how much the customs will skin me for something
03:35 AM _ami_: so its much better to buy this from USA - cheaper. With customs, its around 430$
03:35 AM _ami_: Haohmaru: buy from Amazon USA
03:36 AM _ami_: they already deduct the import duty
03:36 AM Haohmaru: hm?
03:36 AM nohitzwork: yeah, i have no problem for paying customs
03:36 AM nohitzwork: for that price its a steal anyways
03:37 AM Haohmaru: i don't have a problem with paying an extra tax.. as long as i *know* how much it's gonna be
03:37 AM _ami_: Haohmaru: calculate here: https://www.amazon.com/gp/product/B012938E76/
03:37 AM Haohmaru: and for my country, this is a very mysterious question
03:37 AM _ami_: change the "Ship to" your country
03:38 AM blscoe: Isn't a 50MHz bandwidth quite low?
03:38 AM blscoe: four channels are nice however
03:38 AM _ami_: blscoe: it can be hacked to 100Mhz easily.
03:38 AM blscoe: nice
03:38 AM _ami_: nohitzwork: are you buying from Ebay or Amazon?
03:39 AM Haohmaru: _ami_ it's already set to my country
03:39 AM nohitzwork: i dont know yet
03:39 AM Haohmaru: what shall i be looking at?
03:39 AM _ami_: Add to cart -> Checkout
03:40 AM _ami_: it will tell the import duty
03:40 AM Haohmaru: except it doesn't, i need to log in
03:41 AM nohitzwork: EUR 457,45
03:41 AM nohitzwork: for me
03:41 AM nohitzwork: i think ill go to ebay route, shipping is much less
03:42 AM nohitzwork: Items: EUR 294,25
03:42 AM nohitzwork: Shipping & handling: EUR 64,97
03:42 AM nohitzwork: Import Fees Deposit EUR 98,23
03:42 AM nohitzwork: Order total: EUR 457,45
03:43 AM _ami_: import fee is less for me ~ 60$
03:43 AM nohitzwork: that's the amazon
03:44 AM _ami_: nohitzwork: would you trust ebay?
03:44 AM _ami_: what if scope is defective?
03:44 AM _ami_: how would you replace it?
03:44 AM Haohmaru: pay with paypal
03:44 AM nohitzwork: i retrun it ?
03:44 AM nohitzwork: *return
03:44 AM _ami_: ebay has return policy?
03:45 AM _ami_: oh ok.
03:45 AM Haohmaru: smash it onto the seller's head ;P~
03:45 AM _ami_: :)
03:45 AM _ami_: http://www.gotroot.ca/rigol/riglol/ -> this is how u generate the key
03:45 AM _ami_: i don't know what is private key.
03:45 AM _ami_: none of utube video explains about private key.
03:47 AM _ami_: there is one buying option from Ali: https://www.aliexpress.com/item/Original-Rigol-DS1054Z-Unlocked-4-Options-for-free-4-Ch-50Mhz-Bandwidth-12Mpts-Memory-Digital-Oscilloscope/32605391910.html
03:47 AM _ami_: already unlocked!
03:47 AM _ami_: one
03:51 AM Haohmaru: doesn't that mean "slightly used" ;P~
03:52 AM _ami_: Yup. :P
03:55 AM _ami_: nohitzwork: this one is also pretty good: https://www.amazon.com/gp/product/B06XZML6RD/
03:55 AM _ami_: nohitzwork: the product warranty is still valid on items which you buy from Ebay?
03:57 AM _ami_: http://www.eevblog.com/forum/testgear/new-rigol-ds1054z-oscilloscope/
04:00 AM Haohmaru: the siglent has LAN?
04:24 AM _ami_: Haohmaru: https://www.eevblog.com/forum/testgear/digital-oscilloscope-comparison-chart/
04:31 AM _ami_: Haohmaru: i think it has.
04:32 AM Haohmaru: i saw a LAN port on its back, i asked wondering what is it for ;P~
04:35 AM _ami_: nohitzwork: you live in UK?
04:36 AM _ami_: nohitzwork: https://www.rigol-uk.co.uk/Rigol-DS1054Z-Digital-Oscilloscope-p/ds1054z.htm this might be cheaper?
04:42 AM _ami_: https://www.rigolna.com/clearance/ -> but only for usa.
05:00 AM day__ is now known as day
05:04 AM nohitzwork: _ami_ im in finland
05:04 AM nohitzwork: i dont know about the product warranty, i would assume its valid
05:07 AM nohitzwork: hmm that uk one has all software options for free
05:08 AM Haohmaru: omnomnom, biscuits
05:08 AM nohitzwork: i have a cold battery
05:17 AM _ami_: nohitzwork: http://int.rigol.com/Support/SoftDownload/3
05:18 AM _ami_: the firmware version is DS1000Z Firmware_00.04.04.03.02
05:18 AM _ami_: so i think its still hackable.
05:19 AM nohitzwork: is uk still eu?
05:19 AM nohitzwork: wikipedia says it is
05:21 AM * Haohmaru sniffs the UK, then the EU.. then the UK again..
05:22 AM Haohmaru: hm.. i'm not sure..
05:23 AM nohitzwork: that uk deal seems best, 418e shipped + all the software options included. if it still is a eu country
05:23 AM Haohmaru: it's nasty cuz ebay.co.uk was the only ebay that was in english and in EU
05:38 AM _ami_: nohitzwork: http://www.eevblog.com/forum/testgear/is-rigol-ds1054z-still-hackable/msg1429286/#msg1429286
05:38 AM _ami_: it seems that this now comes with all software option enabled
05:38 AM _ami_: only bandwidth is limited to 50Mhz which you can unlock it.
05:40 AM nohitzwork: nice
05:41 AM Haohmaru: why are certain infinite rotary encoders getting f*cked up after a given amount of time.. on some devices?
05:42 AM Haohmaru: the DS1052E here at work is only a few years old, and has been used rarely (less than once a month), it has also been handled with great care, and yet its position knobs are like.. ruined
05:44 AM Haohmaru: same with the volume encoder on the (gray) sony micro-hifi system, and the one at home (also gray), while no problems with the volume encoder of the older black sony hifi that i use
05:45 AM Haohmaru: i am guessing it must be hardware-related, because they don't respond in a jerky way when they're new
05:46 AM Haohmaru: the scope is now even more annoying to use
05:47 AM _ami_: Haohmaru: planning to buy a new scope then?
05:47 AM Haohmaru: me? who am i?
05:47 AM Haohmaru: this scope is at work, i don't have a personal scope ;]
05:47 AM _ami_: oh ok.
05:48 AM Haohmaru: any ideas about these encoders?
05:49 AM Haohmaru: i have encoder in two DIY devices at home too, and they don't jerk, one of them is much older than the scope here (i think, and certainly much more (ab)used)
05:50 AM nohitzwork: no idea
05:50 AM Haohmaru: but you know the issue i'm talking about, right?
05:50 AM Haohmaru: tell me i'm not alone in this
05:50 AM nohitzwork: actually no
05:50 AM Haohmaru: O_O
05:50 AM * Haohmaru hides
07:13 AM Jartza_ is now known as Jartza
08:09 AM day__ is now known as day
08:27 AM rue_bed: Haohmaru, they aren't optical encoders
08:27 AM rue_bed: their brushed mechanical encoders
08:28 AM rue_bed: that is why your having the problems
08:28 AM rue_bed: you need to put contact cleaner into them, they will need a steady supply of it
08:28 AM rue_bed: if they were optical encoders, you would have never had a probem
08:29 AM rue_bed: the ones like yours from china have almost .1ms of noise on each side of the transition, which is horrible
08:31 AM rue_bed: there is about a 100x price difference between a cheap encoder and a good one
08:31 AM Haohmaru: hm
08:32 AM Haohmaru: optical?!
08:32 AM Haohmaru: the only place i think i've seen optical encoders is in my cheap PC mice
08:32 AM rue_bed: and they still work, you just need to keep the ball clean
08:32 AM Haohmaru: they had a plastic wheel inside
08:33 AM Haohmaru: even today's mice have that for the "mouse wheel"
08:33 AM rue_bed: there were verry few mice ever made with brushed encoders, it just didn't work
08:34 AM Haohmaru: okay, but i got a device which is 9 or 10 years old, minimum, with one of those encoders which look like a potentiometer with 3 legs (plus two mounting legs)
08:34 AM Haohmaru: and it has a button if you press it
08:34 AM Haohmaru: and that hasn't f*cked up yet
08:35 AM Haohmaru: but could it be also related to software?
08:35 AM Haohmaru: i poll that encoder, and i know it is possible to also use input-change interrupts instead
08:36 AM Haohmaru: could it be that some devices, for example this scope, which is younger than 10 years for sure, to be using interrupts?
08:46 AM tyzoid: So I'm trying to compile some code with avr-gcc
08:46 AM tyzoid: but it's got an include <wchar.h> in it
08:46 AM tyzoid: fatal error: wchar.h: No such file or directory
08:47 AM tyzoid: But I've found that wchar_t is already declared
08:47 AM tyzoid: from stddef
08:47 AM tyzoid: so I'm not quite sure what's up with it
08:48 AM tyzoid: Is wchar.h supposed to exist/is there something up with my install of avr-gcc?
08:55 AM Haohmaru: was that code written for avr, and avrgcc specifically?
08:57 AM polprog: rue_bed: lets design a contact cleaner dispenser addon for those :P
09:04 AM tyzoid: Haohmaru: No, but it does assume c99
09:04 AM tyzoid: Haohmaru: It is designed to support everything from avr to x86_64 to ARM
09:04 AM Haohmaru: then you probably might have to modify it
09:04 AM Haohmaru: oh?
09:04 AM Haohmaru: i don't know then
09:05 AM tyzoid: I ended up adding another preprocessor flag to tell the library to use the stddef version instead
09:05 AM tyzoid: which seems to work for now.
09:05 AM tyzoid: just need to fix a bunch of memory-related problems now
09:10 AM polprog: Haohmaru: i think its just mechanical defects, the encoders on the rigol i borrowed are totaly fucked as well
09:10 AM polprog: and so it the timer knob on my stove
09:10 AM polprog: and the scope that i had last year
09:11 AM Tom_L: buy 25yr old equipment that still works better than the new stuff
09:12 AM polprog: the scope i got last year was 25 years old, i think
09:12 AM polprog: both are working well if not those mechanical encoders
09:15 AM Haohmaru: yeah, my older black Sony hifi is rock solid.. the cd changer died years ago (who cares about that) but the rest of it still works like a horse
09:15 AM polprog: so does my panasonic boombox. except for tape decks, but again, i dont have any tapes to listen to
09:15 AM polprog: i swapped the original speakers with a pair of B&W ones, and it sounds awesome
09:15 AM Haohmaru: heh, my ps/2 mouse at home is uber old too, from time to time i replace the tact switches with "new ones" (from a spare mouse)
09:17 AM polprog: haha
09:17 AM polprog: i would use my ps2 mouse if it had a scrollwheel..
09:18 AM polprog: i even cleaned its shell with alcohol from the yellowish gunk that it accumulated over the years
09:18 AM polprog: real mice have balls ;)
09:19 AM tyzoid: idk, I find laser mice to work better, honestly
09:19 AM Haohmaru: i miss my ball mouse so much
09:19 AM tyzoid: in a sadistic way?
09:19 AM Haohmaru: iirc it was genius netscroll plus or some such
09:20 AM polprog: very classic design
09:20 AM Haohmaru: now with these dumb optical mice, i stuff old batteries and metal junk inside so they weigh more
09:20 AM polprog: i like it. i had one like that
09:21 AM Haohmaru: i hate when the cable pulls my mouse away >:(
09:21 AM polprog: i had a rat 3 for a long time
09:21 AM polprog: but the cable stress killed it
09:21 AM polprog: cuts out all the time
09:21 AM tyzoid: Haohmaru: IIRC there was a mouse you could buy (optical/laser) which had a weighted base
09:21 AM tyzoid: you could adjust the weight it had too
09:22 AM Haohmaru: if it's more than 5 bucks - no thanks ;]
09:22 AM polprog: most high end gaming mice have that, but they are very expensive
09:22 AM tyzoid: true
09:22 AM Haohmaru: only once i threw money for an expensive mouse, and it was a huge mistake
09:22 AM tyzoid: At home, I use a trackball mouse
09:23 AM Haohmaru: since then, i only buy the cheapest mice
09:23 AM tyzoid: https://www.logitech.com/en-us/product/trackman-marble
09:23 AM tyzoid: Really helps with repetitive strain
09:23 AM polprog: i once threw some money at a trackball. i got kensington orbit. I miss the 3rd mouse button
09:23 AM day: mouse weights are there to be removed :P
09:24 AM Haohmaru: the mistake i mentioned was an a4tech trackball
09:24 AM tyzoid: polprog: I've got my system set to interpret primary + secondary simultaneous clicks as a 3rd mouse button
09:24 AM Haohmaru: when i bought it, i had no idea that this thing doesn't "move" on the desk
09:24 AM tyzoid: ah
09:24 AM learath: tyzoid: that is the one true trackball
09:24 AM learath: the old one
09:24 AM polprog: tyzoid: me too but that didnt help
09:24 AM Haohmaru: and since it was uber expensive, i couldn't ask for a new mouse on the next day
09:25 AM learath: I've got the new one ( https://www.logitech.com/en-us/product/mx-ergo-wireless-trackball-mouse?crid=7 ) and it is ok
09:25 AM Haohmaru: so i was stuck with that terrible thing for a loooong time
09:25 AM learath: .............
09:25 AM polprog: this logitech one look svery interesting
09:25 AM tyzoid: learath: Looks nice. not sure how I'd feel about using the thumb to move the mouse
09:26 AM learath: tyzoid: I've used them for.. like 2 decades
09:26 AM Haohmaru: imma die x_x
09:26 AM tyzoid: but yeah, very interesting.
09:26 AM learath: Honestly, I first switched for space savings.
09:26 AM tyzoid: The one I have has the ball centered, which uses a combination of index finger and middle finger to move the ball
09:26 AM learath: I've got two tenkeyless keyboards and two trackballs in very little space.
09:26 AM learath: oh the tripman marble! :P
09:26 AM tyzoid: but yeah, I've had problems with wireless mice and keyboards before
09:26 AM learath: ahh what was it called...
09:27 AM learath: https://www.amazon.com/Logitech-TrackMan-Marble-FX-Trackball/dp/B00000JBUI
09:27 AM learath: "TrackMan Marble FX"
09:27 AM learath: the "FX" is code for "lots of LSD" :P
09:28 AM Haohmaru: ah, here it is, my nightmare: http://xahlee.info/kbd/im/tb/A4Tech_wwt-13_trackball_87945.jpg
09:28 AM tyzoid: oh god
09:28 AM learath: what is that?
09:28 AM Haohmaru: :~(
09:28 AM tyzoid: It's an abomination
09:28 AM polprog: jesus
09:28 AM Haohmaru: that's the one mistake i made with PC mice
09:28 AM learath: you paid money for that?
09:28 AM tyzoid: How do I ergonomics?!?
09:29 AM Haohmaru: yes, and i was then stuck with it for a long time because it was expensive and i couldn't tell my parents that there's something wrong with it
09:29 AM polprog: haha
09:30 AM Haohmaru: mouse button 1 is on the left... my poor thumb
09:30 AM Haohmaru: when i opened it at home i saw rubber feet on it, i wondered why :~(
09:31 AM Haohmaru: childhood was ruined that day
09:31 AM polprog: damn
09:31 AM polprog: i found my rat 3. the cable is totally broken
09:31 AM polprog: it cant communicate
09:31 AM polprog: i should try to take it apart...
09:31 AM Haohmaru: repair it, resurect it
09:32 AM polprog: i think i tried, and it uses thos efunky plastic rivets
09:32 AM polprog: if i can get to the mainboard though, its saved
09:36 AM Haohmaru: basically, i couldn't play cstrike or anything with that, i went to play max payne, frustrated.. i think i enabled the cheats to get thru it
09:36 AM Haohmaru: and i said goodbye to drawing in mspaint
09:37 AM Haohmaru: when i finally got a normal ball mouse after that - i smashed that thing in the floor >:)
09:38 AM Haohmaru: i kept its skull
09:38 AM Haohmaru: (the blue ball)
09:39 AM polprog: *hacker voice* im in https://puu.sh/ztkHm/0561745e1f.jpg
09:39 AM Haohmaru: now i also avoid the "a4tech" brand
09:39 AM polprog: too many bloody screws
09:39 AM polprog: :P
09:39 AM Haohmaru: o_O
09:39 AM Haohmaru: what is this, so complex
09:40 AM polprog: mad catz rat 3
09:40 AM polprog: so complex it needs a patch in Xorg.conf
09:40 AM Haohmaru: braided cable o_O
09:40 AM Haohmaru: sounds like very VIP
09:41 AM polprog: after all, worth it
09:41 AM polprog: the cable seems intact at the connection side so it must be broken somewhere on the length
09:41 AM polprog: im thinking, how to fix taht
09:41 AM polprog: that*
09:41 AM Haohmaru: i thought it was a more normal mouse
09:42 AM Haohmaru: the ones i use have almost the same cables, so if there's something wrong with it - i can take a whole cable (with the connectors) from another mouse
09:42 AM Haohmaru: but i use ps/2
09:43 AM Haohmaru: polprog i give you bonus points for the lack of letters on your keyboard
09:46 AM polprog: work out :P
09:46 AM polprog: worn*
09:47 AM Haohmaru: <idontbelieveyou.gif>
09:50 AM polprog: the amount of engineering inside that mouse
09:50 AM polprog: the mode change button is on a separate flat flex pcb. the top two dpi change buttons are mounted on a separate pcb that connects to the mainboard via a 6 pin 50 mil pin header
09:54 AM polprog: the usb comes in to the mainboard via a 5 pin JST connector (50 mils), 4 wires + shield
09:54 AM Haohmaru: heh
09:55 AM polprog: im thinking, i will cut the braided cable close to the mouse end (to keep the strain relief and the JST connector - cant replace that, and use a generic type A cable, solder toghether, put heatshrink on
10:24 AM polprog: cable fixed
10:24 AM polprog: lets see if its alive
10:29 AM polprog: confirmed working
10:29 AM polprog: lets put it back together
10:32 AM Haohmaru: yey
10:34 AM tyzoid: polprog: You really should have consulted a vet before you tackled surgery on a mouse youself.
10:34 AM tyzoid: Glad it went okay
11:02 AM polprog: that and that genius one are the only comfortable mice for my huge hands
11:13 AM day__ is now known as day
11:39 AM nuxil: good evening.
11:39 AM nuxil: whats up to day
11:40 AM nuxil: polprog, wanna take a shot at some asm?
11:41 AM nuxil: https://pastebin.com/F2jKf9KP
11:41 AM nuxil: where am i doing wrong?
11:42 AM nuxil: i want this thing to loop as long as ddrb pb2 is set. and exit once its 0.
11:42 AM nuxil: it does that. but i get nothing on the output. on portD
11:42 AM antto: on line 3
11:42 AM * antto runs
11:50 AM nuxil: https://www.nongnu.org/avr-libc/user-manual/inline_asm.html is the usage of "I" correct in the clobber list? on this page it says its a 6 positive bit constant. but idk. im a noob.
12:09 PM nohit: i have no experience with inline asm but where is the Z pointing at
12:09 PM nohit: what this does "ld __tmp_reg__, Z "
12:10 PM nuxil: tmp is R0
12:10 PM nohit: yes but Z
12:10 PM nuxil: Z is r30-31
12:10 PM nohit: yes i know what Z is
12:10 PM nohit: but when and where it is set
12:11 PM nohit: to the address it holds
12:11 PM nohit: that you load into R0
12:11 PM nuxil: [sig] "z"(signal),
12:11 PM nohit: or the value of that address
12:11 PM nuxil: its input
12:11 PM nohit: ok
12:12 PM nuxil: see this line. "adc %A[sig], %[ad3]
12:13 PM nuxil: not 100% sure myself what it does myself :p
12:17 PM polprog: nuxil: let me take a look
12:17 PM nohit: but can you do that, adc is between 2 registers
12:19 PM Jartza: I hate inline asm syntax
12:20 PM nuxil: why ?
12:20 PM nuxil: nohit, this is the old code. https://pastebin.com/QHJsFC94
12:22 PM Jartza: nuxil: I don't think it's intuitive or too readable
12:22 PM nuxil: i want to avoid using lpm. and get the table into memory so instead. and get 32 bit input to the asm instead of 24 bit. but still keep the same amount of cycles.
12:23 PM polprog: this asm looks clean
12:23 PM polprog: i think... are you sure you are changing DDRB?
12:24 PM nuxil: yea.
12:24 PM polprog: hmm
12:27 PM nuxil: Jartza, yeah. i kind of agree on that.
12:27 PM nuxil: *on
12:27 PM nuxil: erm .. idea polprog what it coulde be?
12:28 PM nuxil: i can try an verify and set it to portD instead and put a led there and see if it truly does change.
12:28 PM polprog: that would be good
12:29 PM polprog: im sure that cant be it, but try to change the label to, say "loop"
12:29 PM polprog: waut
12:29 PM polprog: wair
12:29 PM polprog: wait*
12:31 PM nuxil: ?
12:32 PM polprog: sec
12:32 PM polprog: im trying to find if the comapiler actually compiles it
12:34 PM nuxil: what you mean if it compiles ? it compiles :p
12:34 PM nuxil: Program: 3404 bytes (10.4% Full) (.text + .data + .bootloader)
12:34 PM nuxil: Data: 279 bytes (13.6% Full) (.data + .bss + .noinit)
12:34 PM polprog: meaning if it doesnt optimize it out
12:34 PM nuxil: ah
12:34 PM nuxil: gcc beeing evil you mean?
12:35 PM polprog: maube
12:35 PM polprog: y*
12:35 PM Tom_L: just a problem child
12:36 PM polprog: hmm
12:37 PM nuxil: well. while i wait. lets me just change the code to use portd instead of ddrb :p
12:39 PM polprog: jumps are ok
12:39 PM polprog: no idea
12:41 PM nuxil: so yea. asm is doing the sbis correclt.
12:41 PM nuxil: but its not outputing anything on portd
12:41 PM nuxil: hmm
12:42 PM polprog: "ld __tmp_reg__, Z
12:42 PM polprog: this looks suspicious
12:43 PM polprog: try ld __tmp_reg__ %[signal]
12:44 PM nuxil: i can
12:44 PM nuxil: and will
12:44 PM nuxil: with , in there right=
12:44 PM nuxil: ?
12:44 PM nuxil: ld __tmp_reg__ ,%[signal]
12:44 PM polprog: yes, type
12:44 PM polprog: typo*
12:44 PM polprog: ;)
12:45 PM Jartza: if I need asm subroutines, I prefer to put them in other file and use gas
12:46 PM Jartza: pretty often much more readable that way
12:46 PM nuxil: polprog, error: undefined named operand 'signal'
12:46 PM nuxil: .. you meant %[sig] or just %3
12:46 PM polprog: yes
12:46 PM polprog: sorry
12:47 PM polprog: Jartza: i agree! and the nonsense to put \n\t every line
12:47 PM nuxil: lol indeed
12:47 PM Emil: polprog: you don't actually need those iirc
12:50 PM polprog: brb, xorg restart
12:50 PM Emil: you plebian, use ssh irssi and your phone :D
12:52 PM nuxil: polprog, sig gave error aswell.
12:53 PM nuxil: /tmp/cccGmlFc.s:647: Error: pointer register (X, Y or Z) required
12:53 PM nuxil: so would changing [sig] "z"(signal), to [sig] "e"(signal), fix that ? :p
12:53 PM Jartza: maybe I'm just being hard-headed, but I've been hating inline asm syntax as long as I've seen it :)
12:54 PM Jartza: no matter what asm flavor
12:54 PM polprog: nuxil: possibly
12:56 PM nuxil: nah same error.
12:56 PM polprog: damn
12:56 PM nuxil: yea damn indeed.
12:58 PM nuxil: im starting to wounder it all the data is just 0.
12:58 PM nuxil: and something up with memcpy_P(signalBuffer, sinewave, sizeof(signalBuffer));
01:01 PM polprog: how do you define sinewave?
01:01 PM nuxil: static const uint8_t sinewave[] PROGMEM = {
01:01 PM nuxil: 0x80,0x83, ....... };
01:01 PM polprog: looks ok to me
01:01 PM polprog: o_o
01:03 PM polprog: sizeof(signalBuffer)
01:03 PM nuxil: 256
01:03 PM polprog: is that malloc'd?
01:04 PM nuxil: uint8_t signalBuffer[SIGNAL_BUFFER_SIZE] __attribute__ ((aligned(SIGNAL_BUFFER_SIZE))) __attribute__ ((section (".noinit")));
01:18 PM nuxil: i got something :D seems to work now. :D
01:18 PM nuxil: maybe.
01:19 PM polprog: hmm
01:19 PM nuxil: i see some ports are high now.
01:27 PM Jartza: https://ucexperiment.wordpress.com/2012/02/09/mixing-c-and-assembly-in-avr-gcc-and-avr-studio-4/
01:27 PM Jartza: this is a pretty decent example even if it's a bit old
02:17 PM day__ is now known as day
03:12 PM chat is now known as Guest64380
03:30 PM z999: hmm i have to figure out how to write delays in the code. i got the segment 7 dissplay to show the number though. i was trying to figure out how to do 0 to 9 continously in a loop
03:31 PM z999: it took me 3 hours just to get it to show the number
03:31 PM polprog: z999: look at _delay_ms() function
03:31 PM z999: thanks polprog
03:31 PM polprog: unless you wanna go hardcore in your case, then figure out a timer :P
03:31 PM z999: polprog is that for asm?
03:31 PM polprog: no
03:32 PM polprog: i mean, you can call it from asm i think
03:32 PM z999: i need it for asm
03:32 PM polprog: hmm
03:32 PM polprog: id need to take a look whether its a macro or C function
03:32 PM polprog: if the latter one then you can call it
03:32 PM day__ is now known as day
03:32 PM z999: ok thx
03:33 PM Tom_L: nop
03:33 PM polprog: yeah, depending on how you compile your asm file, you might even be able to #define F_CPU, put proper value to proper register, and call it
03:33 PM polprog: otherwise, http://www.bretmulvey.com/avrdelay.html
03:34 PM Tom_L: isn't that cute
03:35 PM polprog: microcontrollers are cute
03:38 PM z999: tsk tsk so judgemental
03:38 PM z999: you boys are lucky to know hard core stuff. i am just a beginner at this.
03:38 PM polprog: dont worry
03:39 PM polprog: we were all beginners at some point
03:39 PM polprog: :P
03:39 PM day__ is now known as day
03:53 PM Emil: z999: of course we are a little elitist
04:04 PM nuxil: polprog, im back messing with the asm. its not worknig correctly, it kind of 1/2 works.. it sets some ports high when i run the asm code. but they stay high all the time. no change on the r2r pins "portd" once its running, strange..
04:04 PM nuxil: im looking at the line having this.. "adc %A[sig], %[ad3]
04:05 PM nuxil: that %A .. what would be the point of it?
04:24 PM polprog: let me check
04:26 PM polprog: im looking at the insline asm cookbook and there is no mntion of that [names] thing... they all use %0, %1 (which is horrible)
04:26 PM nuxil: i was reading thought this https://www.nongnu.org/avr-libc/user-manual/inline_asm.html
04:26 PM polprog: the only thing i can see that reseblmes %A[sig] is
04:27 PM polprog: the way to break up a multibyte value
04:27 PM polprog: %A0, %B0 ...
04:27 PM nuxil: So from what i understand from that. in the assembler code you would use %A0 to refer to the lowest byte of the first operand, %A1 to the lowest byte of the second operand and so on.
04:28 PM polprog: yeah
04:28 PM polprog: A final problem may arise while using pointer register pairs. If you define an input operand
04:28 PM polprog: "e" (ptr)
04:28 PM polprog: and the compiler selects register Z (r30:r31), then
04:28 PM polprog: from the doc
04:28 PM polprog: %A0 refers to r30 and
04:28 PM polprog: %B0 refers to r31.
04:31 PM polprog: Emil: its good to be a little elitist :P
04:36 PM polprog: 5:1 coffe/milk ratio, 1/2 tsp of sugar
04:37 PM polprog: a bit too watery for me
04:37 PM polprog: 4:1 i like more
04:37 PM nuxil: sounds good. think i make one too.
04:37 PM polprog: 1 tbsp of coffe grind
04:39 PM polprog: i need to see the chemical compund of caffeine. it may turn out that using water hotter than 100C makes the taste different
04:39 PM polprog: not too hot so the compounds dont get damaged :P
04:39 PM Emil: Good night
04:39 PM polprog: night
04:43 PM nuxil: i think im gonna revert back to the old asm code. this one i cant figure out.
04:44 PM nuxil: shouldnt "adc %A[sig], %[ad3] be like "adc %A4, %[ad3] ?
04:46 PM nuxil: bah.. screw this
04:46 PM nohit: what is that lpm without operands
04:47 PM nuxil: load program memory.
04:47 PM nuxil: doesnt need one. if your looking at old code.
04:47 PM nuxil: Z is incremented automaticly iirc.
04:48 PM polprog: did you push a new version? i dont see any lpm
04:48 PM polprog: wait
04:48 PM polprog: Z+ is incrememnted. Z is not
04:48 PM nuxil: no.
04:49 PM nohit: oh so it loads Z into R0 if no operands ?
04:49 PM z999: ''''''''''''''''''''''''''''''' '5.
04:49 PM nohit: or the value Z is pointing at
04:49 PM nuxil: nohit, yes from what i understand. and that isnt much :p
04:50 PM z999: 2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004444444444444444444444444444444444444444444444444444444444444444444444444
04:50 PM z999: 0.........................................................................
04:50 PM z999: ...........................................................................................
04:50 PM polprog: yeah, syntax (i) -> lpm === lpm r0, Z
04:50 PM polprog: nuxil: do you want to increment Z afterwards?
04:52 PM nuxil: yes since i need next data in table.
04:52 PM polprog: you use Z+ then
04:52 PM polprog: lpm r0, Z+
04:53 PM nuxil: hmm. thats not what these dds asm example codes i have use. and basing it off :\
04:53 PM polprog: unless they increment it somewhere else
04:54 PM nuxil: no. that asm is stuck in a loop as long as sbis condion. so no way to inc/dec it while the asm is started besides within the asm itself.
04:54 PM polprog: well, it keeps reading from the same address then
04:55 PM nuxil: yea. let me try Z+
04:55 PM nuxil: just change to "ld __tmp_reg__, Z+"
04:55 PM nuxil: ?
04:55 PM polprog: yeah
05:05 PM polprog: nuxil: and ?
05:05 PM nuxil: :(
05:06 PM polprog: damn
05:08 PM polprog: lpm, so the array is in progmem
05:08 PM polprog: but is the pointer in the args progmem as well? maybe gcc is doing weird stuff
05:10 PM nuxil: not sure what you mean.
05:10 PM nuxil: the table(s) are progmem.
05:10 PM polprog: are you sure that you have the right value in Z
05:10 PM nuxil: nop
05:11 PM polprog: i feel that it has to be incrememted as well so keep Z+
05:20 PM polprog: gotta do somw homework for tomorrow, lol
05:21 PM polprog: 00:19
05:21 PM polprog: :P
05:21 PM polprog: cya
05:21 PM nuxil: gn
06:17 PM nuxil: Jartza, i tried to read this https://ucexperiment.wordpress.com/2012/02/09/mixing-c-and-assembly-in-avr-gcc-and-avr-studio-4/ .
06:21 PM nohit: do it
06:21 PM nuxil: confusing as fuck. i mean if i want to make a func in asm acceseble in C. void foo(char *a, char b, char c, char d) how do i know what register to use for each arument,
06:22 PM nuxil: from that page "Arguments are allocated left to right, starting in register R25 through R8. All arguments are aligned to start in even-numbered registers" ??
06:23 PM nohit: polprog has an example project about it, he knows
06:25 PM nuxil: polprog, is asleep counting electrons
06:28 PM nuxil: so does this mean. that argument is 1 = (24:25) arg 2 is 22:23 --> down to 8:9
06:31 PM nuxil: i dont get this thing. 25 is not a even number :p
06:32 PM nuxil: aha.
06:33 PM nuxil: i kind of get it i think. foo(uint32, uint8) would be like. R25->22 and arg2 would be r20. r21 will be zero.
06:38 PM nohit: if you had atmel studio+it's simulator it would ease your work
06:38 PM nohit: you could test things and see the registers and memory
06:39 PM nohit: and how the change when you execute instructions
06:39 PM nuxil: never done that. dont know how to do it.
06:43 PM nuxil: im trying to see if i can make this inline asm pure asm.
06:43 PM nuxil: but meh.
07:31 PM nuxil: :D
07:32 PM nuxil: https://i.gyazo.com/5af22dc43801b93bee2819d16ed44a17.jpg
07:32 PM nuxil: 1 khz spot on :p need to verify with my scope
08:09 PM _ami_: people are still getting defective siglent scopes from Amazon.
08:09 PM _ami_: https://www.eevblog.com/forum/testgear/siglent-sds1202x-e-compensation-issue/400/
08:09 PM _ami_: this is unacceptable.
08:12 PM nuxil: heh.
08:12 PM nuxil: you ordered one ?
08:19 PM _ami_: no, After seeing this, i have decided to go for Rigol DS1054Z
08:20 PM nuxil: told you to go for rigol :p
08:20 PM _ami_: Yup. :)
08:20 PM nuxil: i read bad stuff about siglent in general.
08:20 PM nuxil: lots of fault and buggy firmware.
08:20 PM _ami_: check reviews here: https://www.amazon.com/Siglent-Technologies-SDS1202X-Oscilloscope-Channels/product-reviews/B06XZML6RD/ref=cm_cr_dp_d_hist_1?ie=UTF8&filterByStar=one_star&reviewerType=all_reviews#reviews-filter-bar
08:21 PM _ami_: those fu**** are still selling defective units to Canadians
08:21 PM _ami_: This problem was identified back in Sept. 2017.
08:22 PM _ami_: This guy got a good deal from Siglent: https://www.youtube.com/watch?v=uasDBPcibUw&t=1s
08:23 PM _ami_: it has compensation issue
08:23 PM _ami_: but he bought it in 170 Euros
08:23 PM _ami_: which is very nice.
09:33 PM Casper is now known as Phantom
09:33 PM Phantom is now known as Casper
11:28 PM day__ is now known as day