#avr Logs

Feb 23 2018

#avr Calendar

12:17 AM nuxil: so. i am having a big brain fart moment. i cleaned up some stuff in my code. moved the chip to another board that has the r2r network.
12:21 AM nuxil: but now 1khz shows as 2khz. 2khz shows as 4khz and so on.
12:21 AM nuxil: no idea what i done wron :\
12:21 AM nuxil: relvant code https://pastebin.com/Myt3D6CT spoint any obviouse errors that would cause this ?
12:21 AM Casper: internal RC set wrong?
12:21 AM nuxil: no it both board has same crystal on them.
12:21 AM nuxil: 16mhz
12:21 AM Casper: dunnot then
12:21 AM nuxil: :\
12:30 AM Casper: waitasec
12:30 AM Casper: is the code running half the speed or twice the speed?
12:30 AM Casper: if half the speed, check the clock source, you have it set to the internal RC, which is 8MHz, but you did succeded to disable the /div
12:38 AM nuxil: no its something else. fuses are good.
12:38 AM nuxil: i mesured the pins diretcly now. before the r2r network. so this is strange.
12:40 AM Casper: triple check your fuses
12:41 AM nuxil: pin7 = 1khz . pin6 is 2khz, pin5 is 4khz pin4 is 7khz pin3 is 13khz pin2 is 26khz pin1 is 34khz pin0 is 31 khz .. o.O
12:44 AM nuxil: and out from r2r its 2khz.
12:44 AM nuxil: need to check the r2r network.
12:44 AM nuxil: aswell
12:46 AM nuxil: btw. my fuses are . L:F7 , H:D9 ,"atmega324p"
01:03 AM nuxil: hmm
01:31 AM nuxil: so yeah. i hooked up the scope. and see what i made.
01:31 AM nuxil: its a mutation.
01:31 AM nuxil: 1/2 analog 1/2 digital
01:32 AM nuxil: https://i.gyazo.com/9cda60fd5433b7fe71d0403ea7207e9d.jpg
01:32 AM Thrashbarg: yaaay
01:47 AM polprog: morning
01:47 AM nuxil: g.morning
01:49 AM nuxil: so. my looking at the picture. it looks like there is only 1/4 of the sinus. the rest is a mess.
01:50 AM nuxil: *my - by
01:50 AM polprog: nice waveform, could make a neat sound :P
01:50 AM nuxil: heh
01:51 AM polprog: alarm set to 730... still late to school
01:51 AM nuxil: kind of funny looking waveform. kind of like
01:51 AM nuxil: ^-^
01:51 AM nuxil: :D
01:52 AM polprog: its a aparnoia. today lessosns start at 845
01:52 AM polprog: para*
01:52 AM nuxil: they gonna tech you how to get paranoia ?
01:52 AM polprog: lol
01:52 AM nuxil: ;p
01:53 AM polprog: i thought 730 was early enough :(
01:55 AM polprog: did you really stay up till 2am to fix that? and at 7am you are back?
01:56 AM nuxil: lol. you have no idea :p
01:56 AM polprog: i wouldnt be able to function after only 5 h of sleep :D
01:56 AM nuxil: 3.5 hours enuf
01:57 AM polprog: maybe once
01:57 AM Haohmaru: i get to sleep properly usually only on the weekend
01:58 AM Haohmaru: the other days i go to bed after midnight (often up to 02:00) and get up at 07:00
01:59 AM nuxil: is there a difference between.
02:00 AM nuxil: inline void static foo
02:00 AM nuxil: void static inline foo
02:00 AM nuxil: ?
02:14 AM Haohmaru: i would guess no diff
02:14 AM nuxil: according to <candide> bot in ##C there isnt.
02:15 AM Haohmaru: are you trying to tell the compiler to inline some func?
02:15 AM nuxil: kind of nice that bot.
02:16 AM Haohmaru: there's also geordi in ##C++
02:17 AM Haohmaru: he responds to private messages too
02:17 AM z999: hello friendly people
02:17 AM z999: :D
02:17 AM nuxil: i came across a site not that said that if i didnt use void static inline . it would not use the Z register. but instead r25-<
02:17 AM nuxil: *sidenote.
02:18 AM nuxil: i wounder if what could be the issue to my waveform.
02:18 AM nuxil: hello z999
02:19 AM Haohmaru: no idea about registers
02:20 AM polprog: i dont think that it matters
02:20 AM polprog: and the compiler could choose any register
02:20 AM Haohmaru: there are attributes and other stuff you can add to functions to tell avrgcc that you *really* want a function to be inlined, and also a warning that it can generate if it didn't
02:21 AM Haohmaru: -Winline i think
02:26 AM Haohmaru: as for the other trick, i think you declare the function in a header as extern, and then define it in the c/cpp as inline
02:58 AM shifttymike: is crosspack still the defacto for macos?
03:39 AM Jartza: nuxil: well yeah, the text misses the word "assigned downwards"
03:44 AM Jartza: but that might have changed with later gccs, better to check
03:45 AM Jartza: Function call conventions: Arguments - allocated left to right, r25 to r8. All arguments are aligned to start in even-numbered registers (odd-sized arguments, including char, have one free register above them). This allows making better use of the movw instruction on the enhanced core.
03:45 AM Jartza: If too many, those that don't fit are passed on the stack.
03:45 AM Jartza: Return values: 8-bit in r24 (not r25!), 16-bit in r25:r24, up to 32 bits in r22-r25, up to 64 bits in r18-r25. 8-bit return values are zero/sign-extended to 16 bits by the called function (unsigned char is more efficient than signed char - just clr r25). Arguments to functions with variable argument lists (printf etc.) are all passed on stack, and char is extended to int.
03:45 AM Jartza: that's what the latest doc says
03:47 AM Jartza: shifttymike: I've been using homebrew, crosspack haven't updated in ages
03:47 AM Jartza: osx-cross/avr/avr-gcc
09:28 AM polprog: it snowed a bit when i was on my way back home
09:28 AM polprog: https://puu.sh/zu1cj/16839e93c9.jpg
11:54 AM nuxil: snow. heh
11:54 AM Tom_L: yeah it's that white stuff
11:55 AM McDonaldsWiFi: You guys know if there's a way to compile and use avrdude with vs code like you can in atmel studio?
11:55 AM McDonaldsWiFi: vs code is a seriously slick IDE
11:56 AM nuxil: hu?
11:56 AM Tom_L: if it's just an ide, the code should be the same as any other compiled hex file
11:56 AM Tom_L: avrdude is just an uploader tool
11:58 AM nuxil: crosspack was mention earlyer.
11:58 AM nuxil: dont know what that is tho.
11:58 AM Emil: McDonaldsWiFi: visual studio is just an ide
11:59 AM Emil: But sure there probably exists a plugin if you want to hurt yourself like that
11:59 AM McDonaldsWiFi: not studio
11:59 AM nuxil: atmelstudio is basically vs
11:59 AM McDonaldsWiFi: studio is cancer
11:59 AM McDonaldsWiFi: vs code is sexy af
11:59 AM McDonaldsWiFi: if you haven't tried it I highly suggest it xD
12:00 PM McDonaldsWiFi: coming from a nano/notepad++ purist lol
12:00 PM McDonaldsWiFi: atmel studio is still kind of bulky.. and I don't like it much xD
12:00 PM nuxil: no.. code is sexy as fuck in notepad++ :p
12:00 PM McDonaldsWiFi: I need to learn how to just call avrdude myself from cmd lol
12:00 PM nuxil: np++ ftw :D
12:00 PM McDonaldsWiFi: yeah I love it
12:00 PM McDonaldsWiFi: minimalism is my top priority
12:00 PM nuxil: you can run avr dude from np++
12:00 PM McDonaldsWiFi: vs code is the first real IDE i actually like haha
12:01 PM McDonaldsWiFi: nuxil: you
12:01 PM McDonaldsWiFi: you srs
12:01 PM McDonaldsWiFi: :o
12:01 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/using_avrdude_index.php
12:01 PM McDonaldsWiFi: wow
12:01 PM McDonaldsWiFi: I feel like an idiot everyime I asked questions here and I love it lol
12:01 PM McDonaldsWiFi: you guys are the best
12:01 PM nuxil: yes im 99.9% sure you can exec the needed commands from np++
12:02 PM Emil: McDonaldsWiFi: emil.fi/avr
12:02 PM Emil: McDonaldsWiFi: section 5
12:03 PM Emil: Tom_L: do you have the schematic of that programmer?
12:06 PM Tom_L: Emil which one?
12:07 PM Tom_L: i made 2
12:07 PM Tom_L: and yes
12:07 PM McDonaldsWiFi: ty Emil !!
12:07 PM Emil: Tom_L: well of course linking both'd be great :D
12:07 PM Emil: but I just saw this one http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/mini_USB_prog1.jpg on the page
12:07 PM Emil: you linked above
12:07 PM Tom_L: neither one are online
12:08 PM Tom_L: that one on the avrdude page is bigbanged usb
12:08 PM McDonaldsWiFi: hmmmmm
12:08 PM Tom_L: with a buffer chip behind it
12:08 PM Emil: Tom_L: yeah I'm just mainly curious what's the other chip for
12:08 PM McDonaldsWiFi: Emil: hahah "without and GUI shit"
12:08 PM Tom_L: the early version didn't have the buffer chip
12:08 PM Tom_L: it's a fairly common design
12:09 PM Emil: Tom_L: so the first on is the attiny and the second one is just some buffer chip?
12:09 PM Tom_L: you can find it anywhere probably
12:09 PM Tom_L: yes
12:09 PM Tom_L: 2313
12:09 PM Emil: Just to protect against frying the tiny?
12:09 PM Tom_L: i don't even remember why now but it worked better than the ones without it
12:09 PM Emil: Hmm interesting
12:10 PM Tom_L: i've got a pile of those left over
12:10 PM Emil: McDonaldsWiFi: yeah so I don't appreciate people building unnecessary abstractions :D
12:10 PM Tom_L: somewhere...
12:10 PM Emil: McDonaldsWiFi: makes using them so much fucking harder
12:10 PM Emil: McDonaldsWiFi: that's why it's worded like that :D
12:10 PM Tom_L: the other one uses hardware usb and dean's library
12:11 PM Tom_L: alot better programmer
12:11 PM Tom_L: much faster
12:15 PM Jartza: http://hyperboleandahalf.blogspot.fi/2010/04/alot-is-better-than-you-at-everything.html
12:45 PM tchebb_ is now known as tchebb
12:46 PM nuxil: Jartza, haha. that was alot of fun reading ;)
12:47 PM polprog: alot <3
02:04 PM nuxil: so tried to finish that port from inline asm to pure asm i started on last night.
02:04 PM nuxil: https://pastebin.com/JfFRiVru someone please check it.
02:04 PM nuxil: https://pastebin.com/favQqGJa thats inline code.
02:05 PM nuxil: did i get the registers correct?
02:08 PM nuxil: all the ".def dds0"'s is fixed ofc :p
02:13 PM nuxil: seen that the 1st arument is a pointer to dataspace. will it automaticly use the Z register ? or will it be assigned 24:25 and i need to def it aswell?
02:13 PM * nuxil looks at Jartza
02:34 PM polprog: nuxil: looks goot to me
02:34 PM polprog: good*
02:34 PM polprog: if you sticked to the rules of calling convention (so you can call it from C)
02:36 PM nuxil: ok so registers looks ok.. fixed up a bit https://pastebin.com/p6eZgkn1
02:37 PM nuxil: look at what i did at last one.
02:37 PM nuxil: cant i do it like that ?
02:37 PM nuxil: remove a bunch of ldi and defs delta_adX
02:40 PM polprog: i never used nasm, but i assume .endfunc would make a ret there
02:40 PM nuxil: nasm is just the highlight i used on pastebin :p
02:40 PM polprog: anyway, you can use objdump to see the real output code
02:40 PM polprog: oh, ok
02:42 PM nuxil: so look at the last SigGen i removed delta_adX . you think thats ok.? since delta_adX is constant, and that also true fro adX
02:46 PM polprog: ldi loads constatnt
02:47 PM polprog: constant
02:47 PM polprog: to load *ad0 to delta_ad0, use ld with a register pair; or mov to copy ad0 value to delta_ad0
02:53 PM polprog: in other news
02:54 PM polprog: the net in my school has been acting up ever since i remember
02:54 PM nuxil: polprog, my point was. there is no need for delta_adx
02:54 PM nuxil: right ?
02:54 PM polprog: looks like it
02:54 PM polprog: assuming that by ldi delta_ad0, ad0, you wanted to move ad0 to delta_ad0
02:55 PM polprog: then you can just do add dds0, ad0;
03:20 PM nuxil: so that was a failure.
03:21 PM polprog: :/
03:21 PM nuxil: sig.S:41: undefined reference to `r31'
03:21 PM nuxil: sig.S:42: undefined reference to `r30'
03:21 PM nuxil: and i know why
03:21 PM polprog: lol, why
03:21 PM nuxil: if you look at code.
03:21 PM polprog: which one
03:21 PM polprog: https://pastebin.com/p6eZgkn1 this?
03:21 PM nuxil: 1 and 2nd line after SigGen:
03:22 PM polprog: mm
03:22 PM nuxil: :D see it
03:22 PM nuxil: look at the defines aswell
03:22 PM polprog: yes
03:22 PM nuxil: lol
03:22 PM polprog: i see
03:22 PM polprog: thats a very complicated nop
03:22 PM polprog: ;)
03:22 PM nuxil: so now version.. includeing ??? :p https://pastebin.com/p6eZgkn1
03:23 PM nuxil: err wront paste
03:23 PM nuxil: https://pastebin.com/8akYDkg6
03:24 PM polprog: so the ???
03:24 PM polprog: yeah?
03:25 PM nuxil: does this mean that the 1st argument "pointer to progmem location" is using r24:25 and i need to use other registers for ad0...
03:26 PM polprog: yeah, its a uint16_t so it should be in r24:25
03:26 PM polprog: mov it then
03:26 PM polprog: you can even use movw
03:26 PM polprog: still takes 2 cycles, might be clearer in soce
03:26 PM polprog: code*
03:51 PM Tom_itx is now known as Tom_L
05:05 PM polprog: niters, gtg
05:09 PM polprog: dad just came in and gave a digikey pcb ruler :D
05:44 PM nux_ is now known as nuxil
06:04 PM learath: polprog: with the fake website?
06:04 PM learath: or the real website
06:15 PM nohit2: sup guys
06:48 PM nuxil: trying to figure out some asm.
06:48 PM nuxil: trying an failing :p
06:50 PM nuxil: this https://pastebin.com/MANwC73g gives me error like.
06:50 PM nuxil: sig.S:47: undefined reference to `r25'
06:50 PM nuxil: sig.S:48: undefined reference to `r24'
06:50 PM nuxil: not sure why.
08:22 PM nohit2: sup guys
08:22 PM nohit2: disney would be proud
08:22 PM nohit2: http://dancingclown.tech/VID_20180224_041337.mp4
08:23 PM nuxil: nm. just ate. drinking some coffee now. and lookng at the asm.
08:36 PM nuxil: nohit2, rigging in unity ?
08:38 PM nohit2: http://dancingclown.tech/VID_20180224_043301.mp4
08:40 PM nuxil: nohit2, go 3d :p
08:40 PM nuxil: https://gyazo.com/2c46776c75148a2ed34aa8a159cd3153 my spider im currently working on when im bored
08:42 PM nohit2: yes riggin in unity
08:45 PM nuxil: :)
08:47 PM nuxil: i make spaceships too as 3d models when im bored. here is two models in wip. mother ship and small fighter.
08:47 PM nuxil: https://i.gyazo.com/856b59e458f746665916e655846401b9.jpg https://i.gyazo.com/986a3f81b20e4facbeadb446e72ede11.jpg
08:47 PM nuxil: :D
08:48 PM nuxil: nohit2, i been messing a round a bit in unity myself. 4.5x versions. so it been a while.l
08:54 PM nuxil: these spaceships are going into myother space scene when are done. https://i.gyazo.com/cbb54f5352427dfda6b2968b88beeb75.png :D
08:54 PM nuxil: i prefere making still images tho
09:02 PM nuxil: nohit2, what kind of game are you making ?
09:05 PM nohit2: DAF
09:06 PM nuxil: daf?
09:07 PM nohit2: drunk as fuck
09:07 PM nuxil: heh
11:27 PM day__ is now known as day