#avr Logs

Jan 21 2018

#avr Calendar

05:15 AM polprog: Emil: glad you liked silicon cowboys!
05:18 AM polprog: Emil: maybe i should change mynick to esper one (gorplop) so you dont mix me up with polygon :P
05:18 AM polprog: i tried some on chip debugging.. unless you have something huuge that cannot be really debugged by blinking a led or over uart (say, you need to look at a big block of ram) then i think it can come in handy (i used avarice+ddd)
09:07 AM nux_ is now known as nuxil
10:45 AM polygon: hey
10:53 AM nuxil: hi
10:53 AM nuxil: sup
11:07 AM MrFahrenheit: any germans looking for some cheap high end test gear? http://www.go-dove.com/en/events?cmd=details&event=561326&utm_medium=social&utm_source=facebook&utm_campaign=561326
11:09 AM nuxil: im not german. but i already have a bid on a fluke 287 rolling
11:09 AM Emil: polygon: god damn it :D
11:09 AM Emil: polygon: polymorph, ...
11:10 AM Emil: at least irssi knows to prefer the last autocompleted nick
11:10 AM Emil: polprog: but yeah it was great
11:14 AM polprog: super serial: https://puu.sh/z6uwH/04c8f39120.jpg
11:14 AM Emil: :D
11:14 AM polprog: termination doesnt help
11:14 AM Emil: Would you
11:14 AM Emil: happen to have
11:14 AM Emil: some capacitance on that line
11:15 AM polprog: this is onboard comport
11:15 AM nuxil: so. i want to reprisent my adc input value 0-1024 as a float string. as in example: char foo[] = {"2", ".", "5", "0"}. so i start write my own ftoa function which was a huge waste of time. then i look into sprintf/snprintf which seems to be the way to go. wronte 2 test functions in VS, and noticed somehitng i need explanation on.
11:15 AM polprog: the cable is pretty long, 3 M
11:15 AM nuxil: https://pastebin.com/3fL0zVKA
11:15 AM Emil: nuxil: NO
11:15 AM nuxil: why does arr2 (1st example) print out hole array.
11:15 AM Emil: nuxil: writing your own ftoa is better than snprintf :D
11:15 AM nuxil: and arr1 show size of 4
11:15 AM Emil: polprog: is it shielded?
11:15 AM nuxil: Emil, i just need to show on lcd display current voltage.
11:15 AM polprog: Emil: feels like its not
11:15 AM Emil: polprog: or is it just a pair? Not even twisted
11:15 AM Emil: polprog: lulz
11:16 AM Emil: polprog: explains everthing
11:16 AM Emil: what's the div time?
11:16 AM polprog: i just bought the cable... didnt open it
11:16 AM polprog: 500us
11:16 AM Emil: or rather what's your baudrate
11:16 AM polprog: default baudrate, i just "yes > /dev/ttyS1"
11:17 AM Emil: that can be anything
11:17 AM polprog: yeah
11:17 AM polprog: i just needed _some_ signal
11:17 AM polprog: im trying to trouble shoot why this max232 board wont work
11:17 AM nuxil: Emil, why ?
11:20 AM nuxil: does sprintf auto resize the array if its setup with malloc ?
11:21 AM polprog: it has no way to know that the array was made with malloc, it probably just null terminates the string
11:21 AM polprog: if it fits
11:24 AM Emil: nuxil: including snprintf results in a huge code size increase
11:24 AM nuxil: Emil, yea around 1500bytes extra :p
11:24 AM Emil: not to mention that it's not exactly efficient.
11:24 AM Emil: If you really just need a ftoa then that should be pretty easy
11:25 AM polprog: isnt there ftoa already
11:25 AM nuxil: yes
11:25 AM nuxil: i belive there is a light weight version too
11:25 AM Emil: And you must reserve space for the null terminating character
11:25 AM nuxil: dtoa or something
11:25 AM polprog: dtoa would be doube to array
11:25 AM Emil: Which is good
11:26 AM polprog: arent you a fan of a fixed point on AVRs :P
11:29 AM nuxil: wait what ? dota is good ?
11:31 AM polprog: dtoa
11:31 AM polprog: dota, i dont know, never played
11:31 AM polprog: ;)
11:31 AM nuxil: lol.. typo
11:32 AM Emil: polprog: me? I am
11:32 AM Emil: yeah
11:32 AM polprog: huh so the problem with my max232 board was that RX and TX was swapped... or not. My cable is nullmodem. but swapping 232 io lines helped and it now rocks
11:32 AM Emil: But handling 8-bytes fixed point is actually rather heavy
11:33 AM Emil: and you can still overflow
11:33 AM Emil: floats and doubles just werk
11:33 AM Emil: but
11:33 AM Emil: here's the thing
11:33 AM Emil: you can easily transform 0-1023 to a voltage display
11:33 AM polprog: yeah
11:34 AM Emil: without any silly ftoa things
11:34 AM nuxil: im listening.
11:34 AM polprog: Float.parseFloat() ;)
11:34 AM Emil: lol
11:34 AM polprog: i wonder if BASICstamp supported floats in it's basic dialect
11:37 AM Emil: nuxil: comeon, you know your max voltage. Just do (read*MAXV)/MAXV for the first whole part and then optimise on.
11:37 AM nuxil: Emil, im curiouse. how can i show voltage of adc input without doing float a float opration? vcc/1024*adc_val? i dont want a fixpoint table size of 2^10 :p
11:41 AM nuxil: i just need to convert the int adc_val .. to a char arrays with desimal that looks like a float. you say sprintf is bad. ftoa is bad. im confused :p
11:42 AM polprog: why do you need a string array to store floats o_o
11:42 AM polprog: operate on floats as long as you can
11:42 AM nuxil: so it can be shown on my display
11:43 AM nuxil: i dont need to store floats. i need to store something that looks like a float :p
11:44 AM polprog: why cant you use ftoa
11:45 AM nuxil: why cant i just use sprint? one command that also allows me to trunctate the precition.?
11:46 AM nuxil: i will try an compare sizes. ftoa vs sprintf :p
11:48 AM _abc_: beep. Anyone here and awake?
11:48 AM _abc_: http://www.avrfreaks.net/forum/differences-between-atmega8888pa-etc I am writing some code to be compatible with v-usb
11:48 AM _abc_: there are the processor definitions to deal with, it is hard hard.
11:49 AM _abc_: Mchip broke all the application note links while rebranding the Atmel website and putting it in it's own data warehousing system.
11:49 AM Emil: nuxil: you can use snprintf just fine
11:50 AM Emil: But snprintf is bad
11:50 AM Emil: I never said ftoa is bad
11:50 AM nuxil: not bad.. but silly :p
11:50 AM Emil: I said you can easily turn your measurement into a char array without using floats
11:51 AM Emil: so you don't need ftoa or anything like that
12:29 PM Thrashbarg_ is now known as Thrashbarg
12:56 PM polygon: polprog: sooooooo
12:56 PM polprog: yes?
01:06 PM polygon: what are you summoning?
01:07 PM polprog: meaning?
01:07 PM polprog: wait you are polygin
01:07 PM polprog: polygon*
01:07 PM polprog: lol
01:09 PM polprog: random thought: scotch tape should be bottles of scotch packed in a tape on a reel
01:10 PM * polprog would buy
01:11 PM learath: lol
01:11 PM learath: Sold.
01:16 PM polygon: polprog: http://www.dictionary.com/browse/summon
01:17 PM polprog: i know the word :P
01:17 PM polprog: if you are asking what im building
01:17 PM polprog: im making my rapi rig for programming micros
01:18 PM nuxil: :) good boy :p
01:18 PM nuxil: i had a moment of brain fart.
01:18 PM nuxil: thought you where speaking to yourself :p
01:19 PM polprog: theres too much pol.* here
01:19 PM nuxil: yup
01:19 PM polprog: ahh, ive done it on another network already...
01:19 PM polprog is now known as gorplop
01:23 PM nuxil is now known as polprog
01:23 PM polprog: :D
01:23 PM polprog is now known as nuxil
01:23 PM gorplop: it got confused for too long lookingat that lol
01:23 PM gorplop: wonder if nickserv here tracks nick changes
01:23 PM polygon: polygon: hmm i would rather a tine notebook for programming that has >8 hours battery life
01:23 PM gorplop is now known as polprog
01:23 PM polprog: nah nickserv is not tracking those
01:23 PM polygon: see? now im talking to myself
01:23 PM polprog: haha
01:23 PM nuxil: this is a schizo channel :p
01:27 PM nuxil: polprog, so, how far u come with your pi? still in design state or?
01:27 PM polprog: im trying to install openocd
01:27 PM nuxil: ok
01:27 PM polprog: there isnt much to design there really
01:28 PM polprog: maybe some connector with cables labeled for spi/i2c/jtag
01:28 PM polprog: but i wanna see it working first
01:28 PM nuxil: so. you just gonna use 3v?
01:29 PM polprog: hmm, for now yes
01:29 PM polprog: maybe throw some mosfet limiters to interface with 5v
01:30 PM nuxil: nah get a none inverting schmitt trigger or other chip design to do logic lvl conversion.
01:30 PM polprog: ordering bluepills now
01:30 PM polprog: nuxil: good idea
01:31 PM polprog: i think i saw some buffer chips
01:32 PM polprog: done
01:32 PM polprog: priority mail, they will probably arrive on wednesday
01:33 PM nuxil: i just use this on my board. had nothing else laying around. http://www4.ujaen.es/~gnofuen/Hoja%20caracteristicas%207486.pdf . its a hex inverter. but works well.
01:35 PM nuxil: arg. wrong one. its a nte7486 i use.
01:38 PM nuxil: anywho. time to get some more coffee and do more display coding :)
01:39 PM polprog: have fun
01:39 PM polprog: ill put the compile process on and be back in a sec
02:12 PM polprog: i like this setup
02:13 PM polprog: got a bridge device between two ethernet cards, one cable goes to the switch, another behind the table so i can plug the raspi to lan
02:13 PM polprog: picocom + screen = ^A^A^A^A to jump between two windows in terminal :P
02:16 PM polprog: datasheet directory rsync'd over lan
02:16 PM polprog: sweet
02:16 PM polprog: hope compiling openocd wont be painful
02:56 PM Aslak3_ is now known as Aslak3
02:58 PM MrFahrenheit: I just learned that you could run a 3kW heater for 5 days on the energy it takes to process one bitcoin transaction
02:58 PM MrFahrenheit: https://digiconomist.net/bitcoin-energy-consumption
02:58 PM nuxil: lol
02:59 PM polprog: you can also run a miner and produce some heat alongside :P
03:01 PM nuxil: im not touching anything bitcoin related. to late into the game now for to earn something on this "scam". :p
03:06 PM MrFahrenheit: I tried it in 2011 and decided it wasn't worth it
03:08 PM MrFahrenheit: I think they were worth less than $1 back then
03:23 PM polprog: damn its still compiling, i wanna sleep
03:23 PM polprog: oh its done
03:32 PM polprog: goodnight
04:05 PM kline- is now known as kline
05:23 PM rue_: I made a wallet and couln't get $100 to put in it, that was before it split
05:25 PM Casper: rue_: poor you, next time make a better one, and spend less to make it?
05:26 PM rue_: er, no, making the wallet was free
05:26 PM rue_: I could not put any money in it
05:26 PM rue_: there was nowhere to get it
05:26 PM Casper: oh...
05:26 PM Casper: then... get a job? :D
05:27 PM rue_: you still dont understand
05:27 PM rue_: there was nowhere to convert $100 into bitcoin in a bitcoin wallet
05:27 PM Casper: oh
05:27 PM rue_: I had the wallet, I had the $100
05:29 PM Casper: I'm actually trying to recover a wallet at work, it is supposed to contain 800$
05:29 PM Casper: on a faulty hd
05:29 PM Casper: chance is that I won't be able to recover it until the hd is fully recovered
05:30 PM Casper: and that will take many months
05:52 PM MrFahrenheit: yeah, I tried to buy bitcoin in 2012 and no one wanted to accept any payment method I was willing to use
08:57 PM nuxil: anyone away?
09:04 PM nuxil: so. C and arrays. the good the bad the ugly? any thoughts ?
09:05 PM nuxil: i just learnt that doing buffer[size] is bad in many ways. since it just sets aside memory with junk in it.
09:05 PM nuxil: while char *buffer = ( char*)malloc(size * sizeof(char)); does a nice thing and fill everything with NULL's
09:14 PM nuxil: are ther any performance gain just doing buffer[size] = {NULL} vs setting it up using malloc ?
09:16 PM Casper: uninitialised memory will contain whatever is in ram. Initialised memory is better, but require a loop to fill the memory space with whatever data you want, like zero
09:16 PM Casper: so there is a code size and time cost to initialise
09:17 PM nuxil: yea.
09:17 PM nuxil: but does buffer[size] just use malloc in some sort of way?
09:17 PM nuxil: err
09:17 PM nuxil: buffer[100] = {NULL}
09:18 PM Casper: malloc is to be avoided usually, afaik it use relativelly lots of space and some ram
09:18 PM Emil: took an hours to write :D https://emil.fi/d/partialsearch.c
09:18 PM Emil: someone asked in ##c hao do i do tis
09:19 PM nuxil: ok.
09:19 PM Emil: and I quickly checked their result
09:19 PM Emil: and was like ima take this challenge
09:19 PM nuxil: Emil, dont do others homework :p
09:19 PM Emil: https://www.hackerrank.com/challenges/ctci-contacts/problem
09:19 PM Emil: https://pastebin.com/qjRQHCL0
09:19 PM Emil: The fucker left before :D
09:22 PM nuxil: :D
09:23 PM Emil: Like I said
09:23 PM Emil: it took an hour
09:23 PM Emil: and I said nothing while writing it
10:10 PM polygon: polprog: 74LVC125 (nxp) is 5V tolerant
11:25 PM _ami_: Emil, preparing for interviews? ;)
11:27 PM polygon: while char *buffer = ( char*)malloc(size * sizeof(char)); does a nice thing and fill everything with NULL's - wrong, this is why they invented calloc()
11:37 PM nuxil: whats wrong?
11:39 PM nuxil: avr-gcc sets it to zero.
11:51 PM day__ is now known as day