#avr Logs

Feb 27 2018

#avr Calendar

12:00 AM Casper: now, the question is: why
12:03 AM Casper: and who
12:03 AM nuxil: becuase they say it makes life easyer for admins to do updates etc etc.
12:03 AM polprog: yadda yadda
12:03 AM polprog: gtg
12:03 AM nuxil: bs excuses. :D
12:03 AM Casper: specially since nobody have access to it
12:03 AM nuxil: hehe yea
12:03 AM Casper: but... one question I couln't find a real answer: where does it run? and where does it take it's ram?
12:03 AM nuxil: no idea
12:29 AM rue_: chrome takes over a gig of memory to display a simple webpage and your worried about maybe 512 bytes of ram for minix?
12:30 AM Casper: I don't use chrome
12:30 AM Casper: and not worried
12:30 AM Casper: kust curious
12:32 AM rue_: wait according to this, its in te bios anyhow
12:32 AM rue_: not the cpu
12:32 AM Casper: the bios is a piece of code executed by the cpu and stored in ram
12:33 AM Casper: thru your source is wrong
12:35 AM rue_: yea, as I ead the story changes
12:35 AM rue_: it must come up in memory tho, otherwise it couldn't be manipulated like their saying
12:36 AM Casper: or it use DMA
12:36 AM Casper: and my understanding is that it does use DMA and virtual device
12:43 AM rue_: https://software.intel.com/en-us/articles/getting-started-with-intel-active-management-technology-amt
12:43 AM rue_: huh, gnight
01:28 AM Casper: rue_: afaik, AMT is not the minix part
01:29 AM Casper: the minix part was not documented anywhere, and hidden from everyone
03:30 AM z999: hello
03:30 AM z999: tom around?
03:30 AM z999: i got a reply
03:30 AM z999: Tom_L http://www.avrfreaks.net/forum/header
03:31 AM nuxil: i bet hes asleep now
03:33 AM nuxil: z999, your to late on.. or to early, depends on how you look at it :)
03:35 AM z999: hi nuxil
03:35 AM z999: trying to solve this thing
03:35 AM z999: is he in UK?
03:35 AM nuxil: hi
03:35 AM nuxil: i dont know.
03:36 AM nuxil: iirc. he mention something about studio been buggy or something,
03:37 AM z999: yeah it crashed on me earlier
03:39 AM nuxil: heh. atmel studio is now microchip. and is just a visual studio version from mircsoft. microsoft+micrchip must == microshit :p
03:41 AM nuxil: anywho. back to messing with my own asm code.
03:41 AM polprog: asm in visual studio :D
03:42 AM nuxil: http://www.nooooooooooooooo.com/
03:46 AM Haohmaru: msvc.exe /HURTMEPLENTY
03:50 AM z999: omg improvement
03:50 AM z999: it build!
03:51 AM nuxil: congrats :D
03:51 AM * nuxil give z999 a cookie
03:55 AM z999: next time i will restart computer and do a new project when this happens
03:55 AM nuxil: haha
03:56 AM nuxil: so done with task 2 and task 3 now ?
03:56 AM z999: activity 1
03:56 AM z999: hhave to do the lab now
03:56 AM nuxil: why?
04:04 AM z999: nuxil, it is an assignment and had to document what happened.
04:04 AM z999: this is assignment 2. Using a simulator, single-step the program in Activity 1. Single-step through the delay subroutine. Examine the registers of the delay subroutine and make the delay shorter or longer by changing the register values.
04:04 AM z999: how do you suggest i make the delay longer?
04:07 AM nuxil: several ways.
04:07 AM nuxil: you can use instructions that does more than 1 cycle. example use lpm,
04:07 AM nuxil: or call the your current delay several times.
04:07 AM nuxil: from another loop.
04:08 AM z999: how do i call the current delay several times
04:08 AM z999: just repeat the code?
04:09 AM nuxil: it was all in the stuff Tom_L showed you.
04:10 AM z999: https://pastebin.com/6C8JC5FB
04:10 AM z999: this is what i have
04:10 AM z999: do i repeat the loop twice?
04:10 AM z999: just name the second one loop 2?
04:12 AM nuxil: z999, take a look at this https://medium.com/jungletronics/meeting-assembly-hello-world-arduino-blinking-code-330386652309
04:13 AM nuxil: Tom_L, gave you that link yeasterday. readup :=)
04:16 AM z999: hi Tom_L
04:16 AM z999: Tom_L my software was buggy yesterday. i should have restaarted computer
04:17 AM nuxil: he's still asleep :D
04:17 AM z999: oh sorry
04:17 AM z999: thought it was him
04:18 AM nuxil: z999, why dont you comment your code?
04:21 AM Haohmaru: i have some very funny comments in some of my old code from 10+ years ago
04:22 AM Haohmaru: comment your code in english
04:22 AM nuxil: indeed
04:26 AM nuxil: z999, you need to work a bit on your code style :)
04:26 AM nuxil: compressing stuff like in your paste is awefull to read.
04:26 AM Haohmaru: there is a code style in assembler? o_O
04:27 AM nuxil: Haohmaru, no but its more readble if you do it like this. still not any good tho.
04:27 AM nuxil: https://i.gyazo.com/4f25afaf631ab9f686bc6a8a6a1be081.png
04:27 AM nuxil: something like that
04:28 AM Haohmaru: rjmwp83920 h093dj d93d39j d93j DJOIJ)(@_DJD@) <- that's how it all looks like to me ;P~
04:28 AM nuxil: heh
04:28 AM nuxil: and thats simple asm :p
04:29 AM Haohmaru: C/C++ is moar simple
04:29 AM nuxil: no doubt
04:29 AM Haohmaru: const int four = 2+2; // boom
04:30 AM nuxil: and python even simpler :p
04:30 AM Haohmaru: pls no sneks
04:30 AM nuxil: szzzz
04:30 AM Haohmaru: noooo
04:30 AM * Haohmaru climbs a tree
04:30 AM nuxil: :}
04:30 AM Haohmaru: * a binary tree
04:31 AM nuxil: dont worrie. this snake is real slow :D
04:31 AM Haohmaru: hahaha
04:33 AM z999: omg it build!
04:33 AM z999: how do i know if it works
04:33 AM z999: step it
04:34 AM z999: where do i look in the iO or registers if it delayed longer
04:34 AM Haohmaru: either flash it onto the chip or run it in a simulator, i guess
04:36 AM z999: https://pastebin.com/MYJmyZia
04:36 AM z999: Haohmaru you do not seem to understand my question
04:36 AM z999: it is in the stimulator
04:36 AM z999: WHERE do i check it?
04:37 AM z999: if the delay is longer
04:37 AM nuxil: sorry. im of no help there. i dont know how to use the simulator. never used it.
04:37 AM Haohmaru: surely i don't, i've not used any simulators, nor do i understand ASM
04:37 AM Haohmaru: i've debugged my programs by stepping thru the source code only
04:38 AM nuxil: i think most people in here just write their code. fixes compile errors until its clean. uploads it and checks itf its working, then does the tweeks needed after done the real test if any neeed.
04:39 AM Haohmaru: doesn't the simulator ask you about a cpu frequency? in order to show you how much time has passed in the simulation..
04:39 AM nuxil: just a feeling. since z999 is basically the only one in here messing around with the simulator :p
04:39 AM Haohmaru: or at least it should show you the number of clock ticks that have passed
04:39 AM Haohmaru: you can use that to keep track of time
04:40 AM Haohmaru: yeah, i looked into simulators available, but there were only a few options and none featured my atmega of choice
04:40 AM nuxil: the freq can be set in the makefile. so i guess there is a setting in studio to do something simmular.
04:41 AM Haohmaru: in the make file i suppose you would define F_CPU which is (usualy) only needed for some time-related calculations like timers, baudrates, etc..
04:41 AM nuxil: i guess there is also a equivilant to #define F_CPU bla blah
04:41 AM Haohmaru: the simulator won't care about that
04:45 AM nuxil: z999, why is .include "m328pdef.inc" after start ?
04:45 AM z999: yesterday
04:45 AM nuxil: system includes go at the top of the file
04:45 AM z999: Tom_L told me to include it
04:46 AM nuxil: ok
04:46 AM nuxil: dont change anything
04:46 AM nuxil: lol
04:46 AM nuxil: i dont do that nasm stuff
04:47 AM Haohmaru: why make things harder with this asm stuff
04:47 AM Haohmaru: learn C or something
04:48 AM nuxil: start with something simpler. bash. then move to python/ruby/js then C/C++ then asm :p
04:49 AM Haohmaru: i think i once or twice tried including some inline asm for certain things (reading in the datasheet) and i failed even at that
04:49 AM nuxil: tell me about it. spent 2weeks getting 20 lines of code to work :p
04:50 AM Haohmaru: then i figured that it's not needed since avrgcc was smart enough to recognize and optimize those things, and/or avrlibc had macros for em
04:50 AM nuxil: you can not alwasy trust the compiler
04:50 AM Haohmaru: no, but it's easier to just write the code, and flash it
04:51 AM Haohmaru: instead of staring at ASM in the datasheet and then staring at gcc complaining about every single inline asm block you added
04:52 AM nuxil: yea. if it i didnt need to control each cycle as i do with this dds. the generator code would be written in C instead.
04:52 AM nuxil: i done everythign else in C. its just the time critical stuff that is asm in my project.
04:52 AM Haohmaru: i had one project with pic12f where i had to count the instruction cycles
04:53 AM Haohmaru: i had to make a signal parsing algorithm that had a lot of IFs and ELSEes and the whole thing had to sum up to equal number of cycles no matter which way it went
04:53 AM nuxil: btw. inline asm is confusing as fuck :p
04:54 AM Haohmaru: so i wrote it in C, exported ASM code from the elf, and i wrote a mIRC script to parse the ASM instructions and count the cycles x_x
04:54 AM nuxil: hehe nice.
04:54 AM Haohmaru: then i added NOPs where needed
04:56 AM Haohmaru: oh wait, i lied, it was on pic18f
04:56 AM Haohmaru: with the SDCC compiler
04:56 AM Haohmaru: and now i remember what the device was supposed to do
04:57 AM Haohmaru: it sampled a signal from an IR sensor and recorded it into a big buffer in RAM
04:57 AM Haohmaru: then it could re-play that signal thru an IR diode thing
04:57 AM Haohmaru: basically, press "record" then point some IR remote at this thing, press a button on it, done, then press "play" on the device and it sorta worked
04:58 AM Haohmaru: the timing during the sampling and replaying was important to minimize jitter
04:58 AM Haohmaru: i hate that whole project >:(
04:58 AM nuxil: :)
04:59 AM nuxil: why?
04:59 AM Haohmaru: because i the objective was to build a device that could "control air conditioners"
05:00 AM nohitzwork: im gonna write my next game in ASM, i got this book https://www.retrogamedev.com/c64edition
05:00 AM Haohmaru: the bosses were unaware that each and every single model has its own top-sekret data protocol
05:00 AM nuxil: nohitzwork, hehe
05:01 AM nuxil: Haohmaru, wait, wat?
05:01 AM nuxil: same model had different protocole ?
05:02 AM Haohmaru: no
05:03 AM Haohmaru: the bosses basically thought that there is probably some standard well-known protocol for air conditioners, and everybody used that
05:03 AM nuxil: ahh
05:03 AM twnqx: lol
05:03 AM nuxil: thats silly to think
05:03 AM Haohmaru: so it's a matter of implementing it and boom - your device can suddenly control every possible air conditioner
05:04 AM Haohmaru: in reality, each manufacturer has their own protocol, and probably even each model has a slightly different one, since some have different sets of features
05:05 AM nuxil: so.. run of to a shop selling different AC. and take your gadget with you and start copying the protocols :p
05:05 AM Haohmaru: so my solution was to not try to "understand" any protocols, just record the IR signals and play them back brainlessly
05:06 AM Haohmaru: of course, another briliant limitation was that it had to happen on an 8bit pic
05:06 AM Haohmaru: and the biggest one of those doesn't even have 4K RAM
05:06 AM Haohmaru: so the recording buffer was short
05:07 AM Haohmaru: it could only hold one "command" signal at a time
05:24 AM nohitzwork: Haohmaru can you tranlate this to C ? y = x^n , n = 0...m
05:37 AM Haohmaru: x^n is pow(x, n)
05:37 AM Haohmaru: pow() for doubles, powf() for floats
05:38 AM Haohmaru: if they are integers - i don't know, but there's probably some pow() which takes integers too
05:44 AM Tom_L: well at least she got it
05:44 AM Tom_L: doubt she makes it as a programmer
05:45 AM Tom_L: barely squeaked by her c class
05:45 AM Tom_L: hope in 10 yrs she proves me wrong though
05:45 AM nuxil: she got a B in C
05:45 AM nuxil: isnt that good?
05:45 AM Tom_L: oh that's not so bad then
05:46 AM Tom_L: if i'd have had 7 installed it wouldn't have taken nearly so long
05:46 AM nuxil: but i think theacher has been kind when giving her that grade
05:46 AM Tom_L: someone closer should have suggested it along time back and she would have never made it here
05:47 AM Tom_L: ^^ the error
05:47 AM nuxil: hehe
05:47 AM Tom_L: now i'm stuck with shit software on my pc :_(
05:48 AM nuxil: jup. good deeds only result in crap :p
05:49 AM nuxil: did it mess up your v4 install?
05:58 AM Tom_L: i doubt it
05:58 AM Tom_L: i didn't try
05:59 AM Tom_L: i seldom use it now anyway
06:06 AM Haohmaru: our grading system here is "2 to 6" where 2 == youshallnotpass, and 6 == eggselent
06:06 AM Haohmaru: so what's B?
06:09 AM nuxil: after A
06:09 AM nuxil: before C
06:10 AM Haohmaru: >:(
06:10 AM Emil: Haohmaru: lolwat
06:10 AM Haohmaru: wut'z so phunny?
06:10 AM Emil: that grading
06:10 AM Emil: 2-6
06:11 AM nuxil: yea 6 would be A (A+)
06:11 AM nuxil: B would be a 5
06:11 AM Haohmaru: each number has an actual name "weak 2" "average 3" "good 4" "very good 5" "excelent 6"
06:11 AM Emil: I can sorta understand where our 4-10 came from (even if it has morphed into something else) and our 0-5 is okayish (where 0 means you didn't pass)
06:12 AM Emil: but 2-6 is just lol
06:12 AM Emil: it probably was 1-5 but then someone did really well and they had to be given a 6
06:12 AM Emil: and you can't pass shit students that only get 1
06:12 AM nuxil: Emil, Haohmaru, that grading was common here. before. it been a while since i was at school so dont know if they still use it.l
06:13 AM Emil: nuxil: which grading?
06:13 AM nuxil: it was 1-6 wher 1-2 is fail
06:13 AM Haohmaru: no, 1 is not valid, but there exist a joke "dumb 1"
06:13 AM Haohmaru: and "very dumb 0"
06:13 AM Emil: Haohmaru: read more carefully what I wrote
06:13 AM nuxil: also at on som university thingy it was the obosite 6 was fail and 1 was best. verry confusing
06:14 AM Emil: nuxil: well, baseline could be 0 errors
06:14 AM Emil: and the more errors you get the higher you fall
06:14 AM Emil: (from)
06:14 AM Haohmaru: oh, i even translated them correctly: https://en.wikipedia.org/wiki/Grading_systems_by_country#Bulgaria
06:15 AM Emil: Haohmaru: >lowest passing grade
06:15 AM Emil: >average
06:15 AM Emil: ayyyyyyyyyyyyyy
06:16 AM Emil: HEH
06:16 AM Emil: I was right about the 4-10
06:16 AM Emil: https://en.wikipedia.org/wiki/Grading_systems_by_country#Finland
06:18 AM Haohmaru: so what was so funny about 2-6?
06:19 AM Haohmaru: my mantra at school was "3 is love, 3 is life, pls god, give me three" ;P~
06:19 AM Emil: Haohmaru: it makes not a single bit of actual sense :D
06:19 AM Haohmaru: but i typically got 2 ;P~
06:19 AM Emil: lol
06:20 AM Haohmaru: i had mostly 5 and 6 in english ;P~
06:21 AM Haohmaru: barely 3 in bulgarian and literature (the h0rr0r)
06:21 AM nuxil: Haohmaru, finnish people are just a bunch of smartasses :p they got the best school system in the world. best result on test world wide. no homework etc.
06:22 AM nuxil: just kidding ;)
06:22 AM Haohmaru: then why does he have a bulgarian name?
06:22 AM Emil: YOU TAKE THAT BACK
06:22 AM Emil: :D
06:22 AM Haohmaru: oops
06:22 AM Emil: Anycase eh
06:22 AM * Haohmaru hides behind the curtains
06:23 AM Emil: Emil is from the latin root Aemilia
06:23 AM nuxil: Emil fra lønneberget :p
06:23 AM Emil: or greek
06:23 AM Emil: nuxil: well that's where we got it pretty much :D
06:23 AM Emil: Eemil is the Finnish version
06:23 AM Emil: or Eemeli
06:23 AM nuxil: :)
06:24 AM Emil: though I much like mine better than the Finnish version, even though I'm 100% Finnish and am excempted from having to learn Swedish anymore :D
06:24 AM Haohmaru: and my silly nickname turned out to be a legit finnish name o_O
06:24 AM Haohmaru: what a coincidence
06:24 AM Haohmaru: i blame Emil for that
06:24 AM Emil: at
06:24 AM nuxil: lol
06:24 AM Emil: Haohmaru is not in any way Finnish
06:24 AM Haohmaru: not Haohmaru, antto
06:25 AM Haohmaru: oops, i just woke up the cat >:)
06:25 AM nuxil: sounds japanees
06:25 AM Emil: nuxil: yeah I thought Haohmaru was from asia or something :D
06:25 AM Haohmaru: that's my alternate nickname
06:25 AM Emil: Haohmaru: well, sure antto could pass
06:26 AM Haohmaru: when i was a kid they called me "anto" but on IRC i decided to steal one guy's nicknmae styling (who had repeated one of the letters in his name for aestethics and had an underline) and thus i named myself antto_,
06:27 AM Haohmaru: later he dropped the _, so did i
06:27 AM Haohmaru: and it stuck
06:27 AM Haohmaru: i thought it was unique
06:27 AM Haohmaru: turns out when i google that, i got results for the vocalist of HIM
06:27 AM nuxil: shuffle my nick and you get a Os :)
06:27 AM Haohmaru: X_X
06:28 AM Haohmaru: as well as a bunch of others, i think most of them are from finland
06:29 AM Haohmaru: it seems hard to come up with something cool and unique
06:30 AM nuxil: try http://www.fantasynamegenerators.com/nicknames.php#.WpVPGajiaUk
06:30 AM nuxil: or some other random nick generator :p
06:31 AM Haohmaru: Mutt or Pig?
06:31 AM Haohmaru: r u kidding me
06:32 AM polprog: nick generator lol
06:32 AM nuxil: yes.. press it several times and collect words and put them together and get nick like BashThunder SugarFox :p
06:32 AM Haohmaru: "Snowflake" huh
06:32 AM Haohmaru: i saw "Special" earlier
06:33 AM Haohmaru: maybe SpeciaSnowflake >:)
06:33 AM Haohmaru: am i doing it right? ;]
06:33 AM nuxil: FuzzyFlip :)
06:33 AM polprog: -=xXxJohny69xXx=-
06:33 AM polprog: reminds me of all those mmo nicks
07:32 AM nohitzwork: hard to stay awake
07:34 AM nuxil: so. 1 lesson i learned about mixing C and asm is that. calling your asm function with multiple uint8_t is basically a no no.
07:37 AM nuxil: because. each time you use uint8 you get a gap in the register. so if you have 2 or 4 uint8's its better "IMO" to pass it as 16/32 bit.
07:37 AM nuxil: example if you got a function foo like
07:37 AM nuxil: extern void foo(uint8_t a, uint8_t b);
07:37 AM nuxil: then the register looks like
07:37 AM nuxil: a = r24;r25 is empty
07:37 AM nuxil: b = r22;r23 is empty
07:38 AM nuxil: but if you do.
07:38 AM nuxil: extern void foo(uint16_t v)
07:38 AM nuxil: and call it foo( (a<<8) | b)
07:38 AM nuxil: your get
07:38 AM nuxil: a = r25
07:38 AM nuxil: b = r24
07:39 AM Haohmaru: wouldn't that make the C code which calls the function slower due to juggling bytes around?
07:39 AM Haohmaru: variables around i mean
07:39 AM nuxil: once you start the asm code. C isnt doing much
07:40 AM Haohmaru: but the (a<<8)|b) part is a job too, isn't it?
07:41 AM nuxil: yea. but you do that before you enter the asm code so its irrelevant.
07:41 AM nuxil: aslo. if you keep having lots of uint8 aruments they will end up on the stack.
07:42 AM nuxil: *uint8
07:42 AM Haohmaru: i think i've read some programming notes from a guy who wrote an RTOS for avr or some such
07:42 AM nuxil: real time os ?
07:43 AM Haohmaru: he explained that to make things better he encodes parameters of functions tightly
07:43 AM Haohmaru: i don't remember the exact reasons
07:43 AM Haohmaru: but instead of making a function with say 5 bool arguments, he would make it 1 uint8_t argument instead, and smash the bits tightly together
07:44 AM nuxil: thats makes perfect sense
07:45 AM nuxil: btw. isnt shifting <<>> one of the fastest operations in C?
07:46 AM Emil: nuxil: out of scope
07:46 AM Emil: speed of operation depends on your arch
07:46 AM Emil: not the c language
07:47 AM nuxil: ic.
07:47 AM Emil: on AVRs a single shift is a single cyhcle
07:47 AM Emil: so >>1 is a single cycle
07:47 AM Emil: but >>3 is three cycles
07:47 AM Haohmaru: even it be fast, it takes time
07:47 AM Emil: and that's for single byte entities, multibyte entities require more of course
07:48 AM Emil: iirc it did work in a single cycle for some 16 bit register combos though
07:48 AM Haohmaru: Emil shifting by two takes twice longer?!
07:48 AM Emil: Haohmaru: on AVR you can shift once per cycle
07:48 AM Haohmaru: ugh
07:48 AM Emil: Haohmaru: so yes, >>1 is one cycle, >>2 is two, >>3 3, ...
07:48 AM Emil: I know right
07:49 AM Haohmaru: i have a habbit of using shifting instead of division/multiplication by power of two
07:49 AM Emil: one would expect that on a bit twiddling device like avrs you'd have efficient shifting but noooo :D
07:49 AM Emil: Haohmaru: your compiler will optimise highly likely
07:50 AM Emil: multiplication is two cycles for 8bit inputs and 16 bit output
07:50 AM Haohmaru: hm, the xmega has some multiplication stuff
08:30 AM rue_bed: do you know some multiply instructions are 12 cycles?
08:30 AM rue_bed: check before throwing out the idea of using a bunch of shifts
08:31 AM * Haohmaru shifts rue_bed out of his bed
10:03 AM polprog: so we had a programming test from the if instruction in the morning today
10:03 AM polprog: pretty nice, i think everyone wrote something that worked according to the excercise
10:04 AM polprog: on my way back home i came up with this
10:04 AM polprog: https://puu.sh/zwQqU/e131bfb4e6.png
10:04 AM polprog: alternative way to check if a value is bigger than 10 :D
10:17 AM nn77 is now known as nn7
10:17 AM nohit: why you're learning x86 asm ?
10:18 AM polprog: no reason
10:18 AM polprog: its just the basics
10:19 AM nohit: im gonna learn 6502 asm
10:19 AM polprog: i wanted to learn the syntax of inline GCC asm
10:19 AM nohit: so i can make c64 and nes games
10:19 AM polprog: its fater to compile/run on a computer
10:19 AM polprog: learn z80 so you can make gameboy games
10:19 AM polprog: iirc
10:19 AM nuxil: no. inline asm is weird.
10:19 AM polprog: sdcc advertises it can compile for gameboy :D
10:19 AM nuxil: learn how to call asm functions instead
10:20 AM polprog: nuxil: yes. inline asm is weird
10:20 AM nohit: 6502 and 68K
10:20 AM polprog: 68K looks nice at the first glance
10:20 AM nohit: 68K for sega megadrive/amiga
10:20 AM polprog: no hardware though in my lab
10:21 AM nohit: this guy has a tutorial http://mrjester.hapisan.com/04_MC68/
10:21 AM polprog: nuxil: thanks for showing me you can use the pseudonames in asm though.... i would be stucj with %0, %1 etc. . UGH
10:21 AM polprog: that would be even worse
10:22 AM nuxil: heh yea i dont like hat stuff.
10:23 AM nuxil: you see %0, and some %1 and perphaps a A%3 and you go wtf is that
10:23 AM polprog: now that i think about it
10:23 AM polprog: if i would teach C programming to students sometime in the future
10:23 AM polprog: which is kinda possible
10:24 AM polprog: and some student would bring me a piece of C with inline asm in it
10:24 AM polprog: trying to troll
10:24 AM polprog: id dig out the olderst powerpc computer on the campus
10:24 AM polprog: compile there
10:25 AM polprog: and give 0 points beacuse it doesnt compile :^)
10:29 AM nohit: it would be kinda cool to make a c64 game in a 48h game jam
10:29 AM polprog: mm
10:29 AM polprog: would be kinda cool to make a c64 game
10:30 AM polprog: but amiga community seems more alive that c64
10:30 AM polprog: i think theres even debian for amigas
10:30 AM nohit: my co-worker is a c64/amiga freak
10:30 AM nohit: he buys them all the time
10:31 AM nohit: and he is learning to fix them
10:31 AM polprog: my dad once told me about a sysadmin he had at a job long time ago
10:31 AM polprog: he told me this i think early 2000s
10:31 AM polprog: the guy bought an SDcard floppy emulator
10:32 AM polprog: he said "the chip in the emulator was probably more powerful than the amiga itself"
10:32 AM polprog: :D
10:32 AM nohit: hehe
10:32 AM polprog: ive also seen an x86 CPU card for sparcstations
10:32 AM polprog: that enables SUN SPARCstations to run x86 code
10:33 AM polprog: wonder if someone did something like that for amiga
10:33 AM polprog: nuxil: maybe you can help me out here
10:33 AM polprog: nuxil: ": [flo] "=E" (a) : : "eax");
10:33 AM polprog: nuxil: mainfloat.c:34:31: error: impossible constraint in ‘asm’
10:38 AM jragon is now known as jippo
10:39 AM nuxil: :\ idk
10:39 AM polprog: jfc thats worse than web dec
10:39 AM polprog: dev*
10:40 AM nohit: this is the tool that is used in the book http://www.ajordison.co.uk/
10:40 AM nohit: it has sprite editor and all
10:41 AM nohit: and a debugger
10:41 AM nuxil: -E ?
10:42 AM nuxil: *=
10:42 AM polprog: i got it to compile
10:43 AM polprog: now it segfaults
10:43 AM polprog: usually id be taking out a scope now.... but not on an effing PC :DD
11:03 AM polprog: floats cracked
11:03 AM polprog: im enough lol
11:08 AM robinak is now known as robink
12:27 PM nohit: what waveforms you have ready now, nuxil ?
12:34 PM polprog: roses are red
12:34 PM polprog: violets are blue
12:34 PM polprog: unexpected token
12:34 PM polprog: in line 32
12:35 PM Tom_L: boo hoo hoo
12:57 PM antto: hahaah
12:58 PM polprog: hey. i can write more nonunderstandable C!
12:58 PM polprog: and cpp!
12:58 PM antto: how? ;P~
12:59 PM antto: tell me the secret
12:59 PM antto: you write only expected tokens? ;P~
12:59 PM * polprog whispers in the cpu language
01:00 PM antto: oh wait, NONunderstandable C x_x
01:00 PM antto: >:/
01:00 PM polprog: :DD
01:00 PM * polprog sprinkles some inline assembly into anttos project directory
01:01 PM * antto looks and thinks this is some currupted file
01:01 PM polprog: its an older code sir
01:02 PM antto: i know how to write nonunderstandable C/C++
01:02 PM antto: ..no effort
01:03 PM nohit: antto your answer was incorrect
01:03 PM antto: what answer?
01:03 PM nohit: <nohitzwork>Haohmaru can you tranlate this to C ? y = x^n , n = 0...m
01:04 PM antto: i should've asked "translate from what?"
01:04 PM antto: i assumed it's a math thing
01:04 PM nohit: it is
01:04 PM nohit: you dont need pow()
01:04 PM antto: and ^ isn't the symbol for power?
01:04 PM nohit: yes
01:05 PM polprog: its xor i think
01:05 PM antto: okay, i got 3 in maths (barely, i did not deserve it)
01:05 PM polprog: lol
01:05 PM antto: so what is it then?
01:05 PM polprog: for?
01:07 PM nohit: y = 0; for(n = 1; n <= m; n++){ y += x; }
01:07 PM antto: i think bitwise/logic operation have different symbols when written in books or on paper, with some funky symbols
01:07 PM antto: eh?
01:07 PM antto: o_O
01:07 PM polprog: xor in maths is like an o with a + in it
01:07 PM antto: yes, a plus with a circle
01:07 PM polprog: there was this lisp machine lang that uses maths like operators
01:07 PM antto: * in a circle
01:08 PM antto: nohit well, i would have never guessed that
01:08 PM nohit: sorry that was wrong
01:08 PM antto: ^ in my mind is either "power" or "XOR"
01:08 PM nohit: y = 1; for(n = 1; n <= m; n++){ y *= x; }
01:09 PM nohit: it is POW
01:09 PM polprog: thats better
01:09 PM nohit: but you dont need to use it
01:09 PM antto: i really don't understand..
01:10 PM antto: r u trying to make confooz on me?
01:10 PM nohit: its just that math formula translated to C, i just wanted to see if you can do it
01:10 PM nohit: its from that book
01:10 PM polprog: what book?
01:10 PM nohit: that Kostix recommended
01:10 PM antto: you were testing me if i can make a integer power algorithm without using pow() or any such functions?
01:10 PM polprog: ?
01:10 PM nohit: http://basicsynth.com/
01:11 PM polprog: ah
01:12 PM polprog: looks like adv maths
01:12 PM * polprog hides
01:13 PM polprog: https://scontent-ams3-1.xx.fbcdn.net/v/t1.0-9/27540184_2303003806392068_4345388645502504792_n.png?oh=df80958edefe6957d12b5a666be5026c&oe=5B0DA575
01:13 PM polprog: oh damn what a terrible link
01:15 PM nohit: i was just testing your math skills. personally i suck at math, i got all 1's at school
01:18 PM nohit: those weird math symbols are all gibberish to me, but that book will help
01:20 PM nohit: "books on digital signal processing describe sound generation in terms of complex equations and leave it up to the reader to solve the practical problems of programming the equations. BasicSynth takes you beyond the theory and shows you how to create a custom synthesizer in software using the C++ programming language. "
01:25 PM nohit: here it is actually http://basicsynth.com/index.php?page=equcode that example
01:45 PM polprog: http://polprog.net/papiery/x86/inline_asm/
01:45 PM polprog: some snippers
01:45 PM polprog: snippets*
02:31 PM Emil: Anyone looked at m4809?
02:31 PM Emil: I sensed a dma on the video
02:31 PM Emil: but not quite
02:32 PM Emil: https://youtu.be/SScQqkGWoB0
04:41 PM z999: hello
04:41 PM z999: is using 100 ohms resister the same as 1k ohms resister on a arduino board?
04:41 PM z999: does it make that much of a difference
05:01 PM nohit: what are you using it for ?
05:03 PM deshipu: the difference is about 10x
05:08 PM z999: nevermind i found a 1k and am able to use it
05:08 PM z999: can not figure out the setup
05:08 PM z999: circuit setup
05:17 PM z999: i figured it out
05:17 PM z999: an idiot likes me figured it out how to turn an led on
05:35 PM Tom_L: hi z999
05:35 PM Tom_L: figured it out ehh?
05:35 PM z999: yeah Tom_L
05:35 PM Tom_L: bad software ehh?
05:35 PM z999: Tom_L i had to recycle the computer
05:35 PM z999: that was why the code wasnt working on sunday
05:36 PM z999: after it was recycle i had 6 errors which was the .equs
05:36 PM Tom_L: you turn it in?
05:36 PM Tom_L: yeah
05:36 PM z999: i semi comma them out..and code worked beautifully
05:36 PM Tom_L: i took those out too because it saw the config file
05:36 PM z999: yes
05:36 PM Tom_L: the stuff we wrote?
05:36 PM z999: yes
05:36 PM Tom_L: i ran it thru sim
05:37 PM Tom_L: looked ok
05:37 PM z999: me too
05:37 PM z999: Tom_L amtel studio is very buggy
05:37 PM Tom_L: you think?
05:37 PM Tom_L: what did i say prior...
05:37 PM z999: when a new computer cycle and a fresh project the code worked like a charm!
05:37 PM Tom_L: back in 30
05:37 PM z999: Tom_L you were right the software is a piece of shit
05:38 PM z999: now working on lab 3 that is due tonight
05:38 PM z999: i have till midnight
05:38 PM Tom_L: what's lab3?
05:38 PM z999: i figured out activity 1 to lab 3 now working on activity 2
05:38 PM Tom_L: back in a little bit.
05:38 PM z999: ok
05:54 PM z999: i did the setup
05:54 PM z999: i do not know how to code it though
05:54 PM z999: i circuit setup to the arduino with a push button. I am suppose to code it so that the button can turn the led on
05:54 PM z999: any ideas?
05:54 PM z999: in asm
06:03 PM z999: cbi ddrb, 0
06:03 PM z999: sbi ddrb, 4
06:03 PM z999: Again: sbic pinb, 0
06:03 PM z999: rjmp over
06:03 PM z999: cbi portb, 4
06:03 PM z999: rjmp again
06:03 PM z999: over: sbi portb, 4
06:03 PM z999: rjmp again
06:03 PM z999: found this little code in the book but not working
06:16 PM Tom_L: set a pin to input and read it
06:17 PM Tom_L: ahh, sbi and cbi are macros
06:17 PM Tom_L: iirc
06:18 PM Tom_L: you want to do it slick, use an interrupt on the input pin and wait for it
06:18 PM Tom_L: waste of an interrupt but who cares
06:22 PM Tom_L: it's either not working or it's working faster than you can see it
06:22 PM Tom_L: you need some delay in there somewhere
06:25 PM Tom_L: https://stackoverflow.com/questions/39361410/creating-a-toggle-switch-in-avr-assembly
06:30 PM z999: Tom_L it is because of the resistors
06:30 PM z999: i dont have enough juice
06:30 PM z999: i need a 220 which i do not have the moment
06:30 PM Tom_L: for what?
06:30 PM Tom_L: what do you have?
06:30 PM z999: https://imgur.com/a/c1KiB
06:31 PM z999: 1k and 100ohms
06:31 PM z999: not enough to get it going
06:31 PM Tom_L: not so
06:31 PM Tom_L: is the led backwards?
06:31 PM Tom_L: light it with 5v and verify the circuit
06:32 PM Tom_L: 1k is a safe value
06:32 PM z999: ok it is a portb
06:32 PM Tom_L: it will still light the led
06:32 PM z999: it is on number 8 and 9
06:32 PM Tom_L: you coded pin 4
06:32 PM Tom_L: and 0
06:32 PM Tom_L: PORTB PIN0 and PORTB PIN4
06:33 PM Tom_L: number 8 and 9 means nothing to me
07:13 PM z999: how do i know which pin is 8 or 9
07:16 PM z999: https://www.arduino.cc/en/Reference/Board
07:16 PM Tom_L: you're asking an ardweenie question now
07:17 PM z999: well i will have to do it with the tutor tomorrow
07:17 PM z999: darnit
07:17 PM Tom_L: they are labelled
07:17 PM z999: i couldnt do it today because i didn't bring the arduino and supplies with me
07:18 PM z999: ok i will just have to take the 2percent deduction
07:18 PM Tom_L: you have an ohm meter?
07:18 PM z999: i have a multimeter
07:19 PM Tom_L: does it have a beep test?
07:19 PM Tom_L: for diodes etc
07:19 PM z999: no
07:19 PM Tom_L: set it to ohms then
07:20 PM Tom_L: with the arduino unplugged, put a lead on pin 9 and run the other lead across the 328 chip until you find which one it is
07:20 PM Tom_L: then check the 328 datasheet pinout and you will know what pin it is
07:20 PM Tom_L: i hate arduino too btw
07:22 PM Tom_L: https://www.arduino.cc/en/Hacking/PinMapping168
07:22 PM Tom_L: there
07:22 PM Tom_L: .
07:22 PM Tom_L: pin 9 is PORTB PIN1
07:22 PM Tom_L: pin 8 is PORTB PIN0
07:23 PM Tom_L: print that diagram and keep it
07:23 PM Tom_L: it says 168 but the 328 is the same pinout
07:26 PM z999: oooh thanks
07:26 PM z999: let me try it
07:29 PM z999: the push button doesnt work
07:29 PM z999: start:
07:29 PM z999: cbi ddrb, 1
07:29 PM z999: sbi ddrb, 0
07:29 PM z999: Again: sbic pinb, 1
07:29 PM z999: rjmp over
07:29 PM z999: cbi portb, 0
07:29 PM z999: rjmp again
07:29 PM z999: over: sbi portb, 0
07:29 PM z999: rjmp again
07:29 PM Tom_L: how do you know it doesn't work?
07:29 PM z999: i press the push button and the led does not come on
07:29 PM Tom_L: there is no delay in there it's gonna go by so fast you'll never see it
07:30 PM z999: oh i see
07:30 PM Tom_L: run it in sim and you might see different results on the pins
07:30 PM Tom_L: i don't remember how you set an input high but you probably can in sim
07:31 PM Tom_L: then the output should also toggle if you did it right
07:50 PM Tom_L: https://stackoverflow.com/questions/39361410/creating-a-toggle-switch-in-avr-assembly
07:50 PM Tom_L: z999, read that.. it's probably the same assignment
07:50 PM nuxil: nohit, a bit late reply but all the basic ones.
07:51 PM Tom_L: better than a nibble or byte late
07:51 PM nuxil: :)
08:01 PM z999: thanks tom
08:02 PM nuxil: did you get your long deay worknig now ?
08:02 PM nuxil: *delay
08:03 PM Tom_L: yeah, change the outter 255 number for larger delay changes
08:04 PM Tom_L: change the inner 255 for smaller changes
08:04 PM Tom_L: counter2 counter1
08:04 PM Tom_L: or whatever they were
08:04 PM z999: yes nuxil
08:04 PM z999: completed activity 3
08:04 PM nuxil: good for you?
08:04 PM z999: too
08:04 PM z999: turned in lab 2
08:04 PM z999: working on lab 3
08:04 PM Tom_L: late.
08:05 PM z999: yes turned it in late
08:05 PM Tom_L: you should ask sooner next time
08:05 PM nuxil: now question is. did you understand anything of this :D
08:05 PM Tom_L: i somewhat think she may have
08:05 PM z999: figured out activity 1 for lab 3 will work on activity 2 later
08:05 PM z999: it will be late
08:05 PM z999: due tonight at midnight
08:06 PM Tom_L: use PST and you're good
08:06 PM Tom_L: give you a couple more hours anyway :)
08:07 PM z999: lol
08:07 PM z999: she has a moodle website
08:07 PM z999: and it times it when you upload assignments
08:08 PM z999: then there is lab 4 due thursday
08:08 PM z999: she just bombarded us with labs
08:08 PM z999: one after another
08:08 PM Tom_L: what's it supposed to do?
08:08 PM z999: lab 4 was the segment 7 display
08:09 PM Tom_L: apparently you should know asm prior to taking her class
08:09 PM z999: you had to display the digits 0-9 continously
08:09 PM Tom_L: don't forget delay
08:09 PM Tom_L: it's your friend
08:09 PM z999: no this is suppose to be an introduction course
08:10 PM z999: yeah that was my mistake
08:10 PM Tom_L: i did the digit counter on a fpga
08:10 PM z999: i wrote the code without the delays
08:10 PM z999: it went to fast and wouldnt display the digits one by one
08:10 PM Tom_L: sure it did
08:10 PM Tom_L: you just can't see that fast
08:10 PM Tom_L: 25/sec is about what a human can process
08:11 PM nuxil: no.
08:11 PM nuxil: at 25fsp it looks continiouse. need a bit lower
08:11 PM Tom_L: well that's more or less what i meant
08:12 PM nuxil: but its also something thats highly individual. some ppls say they see frames at 25. some say they dont.
08:12 PM nuxil: i dont belive they who say they do.
08:12 PM Tom_L: if you were mux'ing a display you'd want it a bit faster than that
08:13 PM _ami_: one n00b question regarding scope: the channels in a scope are isolated? i could probe both sides of opto-coupler circuit together using 2 channels of scope?
08:14 PM nuxil: isolated ? what you mean, i think they use same common.
08:15 PM _ami_: the earth main gnd is the reference gnd in scope probes so basically it does not matter.
08:15 PM _ami_: hmm, got it. one of the brain farts.
08:17 PM nuxil: did you get it already ?
08:17 PM nuxil: you cant that. unless it has shiped with a blackbird or something :p
08:21 PM _ami_: i was talking about how to measure two isolated ckts using scopes e.g. opto-coupler.
08:27 PM _ami_: this guy is obsessed with stm32s :)
08:27 PM _ami_: http://ja2gqp.blogspot.kr/
08:29 PM nuxil: hehe, (kr) is the short for our currency (kroner) :p
08:30 PM nuxil: _ami_, i cant tell. no idea what it says there. i just see a bunch of header file and some weird signs i dont understand.
08:31 PM _ami_: its in japanese.
08:32 PM _ami_: install a firefox plugin named s3 translator which i use to read non-english articles.
08:32 PM nuxil: i dont use FF
08:32 PM nuxil: it sucks
08:32 PM nuxil: it used to rule
08:32 PM nuxil: now it suck
08:32 PM _ami_: the project he does is amazing
08:32 PM day__ is now known as day
08:33 PM nuxil: what is it?
08:33 PM _ami_: so you are chrome fan boys now?
08:34 PM nuxil: im not a fanboy of any browser. i use the one i find best to use. i used to be FF. now i use chrome.
08:35 PM nuxil: and im not one of thouse who is a forever fanboy of 1 browser.
08:36 PM nuxil: hell there was one point i even liked opera :p
08:36 PM nuxil: 0.=
08:36 PM _ami_: FF is not bad. i like the socks proxy support in FF which i think chrome still does not support when i checked last time.
08:36 PM _ami_: so yeah, chrom is not good enough for me.
08:36 PM _ami_: chrome*
08:41 PM day__ is now known as day
09:00 PM nuxil: so i got my usb microscope today. i bought it on ebay for less than 10bucks. im kind of impressed with it for the prize i payed for it.
09:02 PM _ami_: nuxil: which one?
09:02 PM _ami_: link?
09:02 PM nuxil: https://i.gyazo.com/464306f8d7cd3adde626f60123816733.jpg https://i.gyazo.com/6c0ba1af943b57ca8199b73df1a9e478.jpg https://i.gyazo.com/8d34d454566f3b8d110db461c3486116.jpg
09:02 PM nuxil: there some pics. the dots in that squar is less than 0.1 mm each.
09:03 PM _ami_: only work on windows?
09:03 PM _ami_: no linux driver?
09:03 PM nuxil: idk
09:03 PM _ami_: you bought it for doing smd work?
09:03 PM nuxil: that camera. https://www.ebay.com/itm/2MP-1000X-8-LED-USB-Digital-Microscope-Endoscope-Zoom-Camera-Magnifier-Stand/221893827976?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
09:04 PM nuxil: but it wasnt so expensive when i bought it
09:04 PM nuxil: yea i want to do some smd work in the future.
09:05 PM nuxil: but im kind of a troughholl fan :p
09:05 PM nuxil: dip's ftw :)
09:07 PM nuxil: _ami_, the 1st usb microscope i ordered i got scammed. but luckely ebay fixed that and game me money back. seller is also banned on ebay now :D
09:07 PM nuxil: so i had to reorder from some other dude on ebay
09:07 PM _ami_: aha!
09:07 PM _ami_: lucky you!
09:07 PM _ami_: :)
09:07 PM nuxil: yea
09:07 PM _ami_: was it a fake product?
09:08 PM nuxil: never got it.
09:08 PM _ami_: ah, they do that sometimes
09:08 PM nuxil: and i sent message to the seller. he gave same answer in all 3 replys.
09:08 PM _ami_: :P typical replies - copy and paste!
09:08 PM nuxil: so i contaced the ebay support telling them something fishy was up
09:10 PM _ami_: good.
09:11 PM _ami_: i got scammed from Ali on my first order.
09:12 PM _ami_: but luckily i got my money back
09:12 PM _ami_: same issue like you. i never recieved the product.
09:13 PM _ami_: but after that, i never had issue with aliexpress. i did get my money back if some parts are missing or defective.
09:13 PM _ami_: i think aliexpress is much better in this area as compare to ebay.
09:14 PM nuxil: That usb microscope i ordered was 1 of the 1st things i bought on ebay.
09:14 PM _ami_: i am now Platinum Member @ali so i get some small benefits like faster processing
09:14 PM nuxil: so i learned 1 thing from that experiance. check out the seller and his store before buying :D
09:16 PM _ami_: on dispute orders
09:16 PM _ami_: yeah, >99% ratings atleast
09:16 PM nuxil: yea
10:44 PM spybert_ is now known as spybert
10:48 PM rue_shop3: chrome is junk
10:49 PM rue_shop3: _ami_, if your in canada you might have to wait 7 mo for your parts, I'm in canada and do. Canada post..
10:50 PM rue_shop3: ebay or ali, seller SHOULD have over 85%, some people are just jerks and leave bad feedback nomatter what
10:50 PM rue_shop3: I think I'm one down from ya
10:51 PM _ami_: rue_shop3: i get my pkgs in <15 days. sometimes in 10days too from the day of order.
10:51 PM rue_shop3: latley I'v run into a bunch of sellers who just have an autoreply on email
10:51 PM rue_shop3: yea, if your stuff is sorted by the Burnaby canada post facility like me, your screwed
10:52 PM rue_shop3: they sit on shipments for up to 6 or 7 months
10:52 PM _ami_: wow, its worse than brazilian customs.
10:54 PM rue_shop3: and sometimes not at all
10:54 PM rue_shop3: I'v recieved some packages in like 7 days
10:54 PM _ami_: rue_shop3: even its registered post?
10:54 PM rue_shop3: right now they are running about 4 months
10:55 PM rue_shop3: $15 shipping for a $2 item?
10:55 PM _ami_: 4 months is a lot.. i wonder how you plan your projects in case of parts are reaching to you in > 4 months.
10:55 PM _ami_: no, China registered post (< 2$)
10:56 PM _ami_: with tracking id.
10:56 PM rue_shop3: no, canada post does not treat regular and registered any differently
10:56 PM _ami_: ah
10:56 PM rue_shop3: and they WILL NOT track ANY packages from china
10:56 PM rue_shop3: cause, it shows that they aren't processing them
10:56 PM _ami_: damn
10:57 PM rue_shop3: aliexpress shipping sends them to alberta and reships them to try to avoid it
10:57 PM rue_shop3: its THE BURNABY SORT FACILITY
10:57 PM rue_shop3: specifically
10:57 PM _ami_: can't you complain this to Govt?
10:58 PM rue_shop3: hah yea, I can just complain to a hyperdepartmentalized buck passing organization
10:58 PM rue_shop3: besides, canada post is a private business
10:59 PM rue_shop3: they pay the govt for the monopoly
10:59 PM _ami_: :/
10:59 PM rue_shop3: which is why canada post packages do not go thru customs
10:59 PM rue_shop3: which means they dont collect the $50 "customs saw it" fee
10:59 PM _ami_: i thought privatization is a good thing.. but it does not seem to be a good idea in this case.
11:00 PM rue_shop3: nor has the privitization of ANYTHING
11:00 PM _ami_: 50$ is too less
11:00 PM rue_shop3: like our phone carrier
11:00 PM rue_shop3: or the transport
11:00 PM rue_shop3: and the medical system
11:00 PM _ami_: here its 150$ (S. korea)
11:00 PM _ami_: limit
11:01 PM _ami_: i think it is increased to 200$ now
11:01 PM rue_shop3: mouser sent me two parts in two boxes shipped seperatly,
11:01 PM rue_shop3: boy did I tear one HELL of a strip off them
11:02 PM rue_shop3: $100 for $75 (one set of areospace connectors)
11:02 PM * _ami_ was fond of N. america
11:03 PM rue_shop3: mostly I stock stuff
11:03 PM rue_shop3: but I run lots of projects at once
11:03 PM rue_shop3: so, they can sit a few months and whatever
11:04 PM _ami_: :)
11:29 PM day__ is now known as day