#avr Logs

May 17 2018

#avr Calendar

12:12 AM day__ is now known as day
01:09 AM polprog: morning
01:21 AM Emil: nuxil: wot
01:22 AM Emil: PORTD=pgm_read_byte...
01:23 AM Emil: I nedd to add another delay though
01:26 AM nuxil: was refering to https://emil.fi/d/tietokone.c and you said it fills eeprom with 0's , but isnt pgm_read_byte just for reading out flash not eerom. so for eepom you need the eeprom.h header and use eeprom_read_byte/write
01:26 AM nuxil: *eeprom
02:53 AM polprog: nuxil is right, pgm is for progmem
02:56 AM nuxil: which aslo raises a 2nd question.. for what purpose does filling the flash or rom with zeros have?
03:01 AM Haohmaru: who fills it with zeros?
03:01 AM nuxil: tietokone translate to "datamaskin" which translates to computer :p
03:05 AM nuxil: Haohmaru, Emil and his weird ass code with a lot of >> << & on his ports while he iterates downwards though the size of his array stored in the flash.
03:06 AM Haohmaru: bitwise ops are nice!
03:07 AM nuxil: but his code makes no sense unless i missed some parts
03:08 AM nuxil: example on top. const unsigned char d[8192] PROGMEM = {0}; then in while loop. PORTD=pgm_read_byte(&(d[i]));
03:08 AM nuxil: why not just set PORTD = 0; since everything in read from progmem is 0 already
03:09 AM Haohmaru: maybe because it's not 0
03:09 AM nuxil: but that what const unsigned char d[8192] PROGMEM = {0}; suppose to do.
03:09 AM Haohmaru: you can glue an external "binary" file onto that array during link time iirc
03:10 AM nuxil: also why not juse set i to a const of 8192
03:10 AM Haohmaru: or even probably just flash a hex onto that address with avrdude
03:10 AM Haohmaru: i don't see the code
03:11 AM nuxil: scroll up
03:11 AM Haohmaru: >:/
03:11 AM Haohmaru: that's not how it works ;]
03:11 AM nuxil: lol
03:11 AM nuxil: https://emil.fi/d/tietokone.c
03:12 AM Haohmaru: "i" can't be a constant
03:12 AM nuxil: duh ofc it cant
03:12 AM nuxil: silly me
03:13 AM Haohmaru: so what's not clear about teh codez?
03:13 AM polprog: its bit banging the memory contents
03:13 AM Haohmaru: yeah, once, then it stops in an empty infinite loop
03:13 AM nuxil: how it fills eeprom with 0.. thats a bit unclear
03:13 AM polprog: not eeprom
03:13 AM Haohmaru: not eeprom
03:13 AM polprog: theres not even an eeprom in there
03:14 AM nuxil: tell that to Emil :p
03:14 AM Haohmaru: i told you, he can glue data during link time or even flash data onto that place with avrdude
03:14 AM polprog: unless he bamboozled us and theres an eeprom on PORTD
03:14 AM polprog: xD
03:14 AM nuxil: polprog, my point.. maybe i was missing something since the translation of the file is computer
03:15 AM polprog: "tietokone"
03:15 AM nuxil: yea
03:15 AM polprog: allright....
03:15 AM polprog: some day i will learn this
03:16 AM Emil: ...
03:16 AM Emil: bruh
03:16 AM nuxil: Haohmaru, with just using PROGMEM you have to look up where its located in he hex.. better to use the attribute section thingy to spesify the address you want.
03:16 AM Emil: of fucking course there's external fucking eeprom
03:16 AM polprog: lol
03:17 AM polprog: i fucking knew that
03:17 AM polprog: :D
03:17 AM Haohmaru: nuxil not impossible
03:17 AM polprog: paralell eeprom?
03:18 AM Haohmaru: why are we statically analyzing Emil's code?
03:18 AM polprog: you can just use objcopy and link a binary file into the elf
03:18 AM polprog: Haohmaru: got anything better to do?
03:18 AM Haohmaru: he trying to exploit us again
03:18 AM Emil: :D
03:19 AM Emil: Haohmaru: all your mcus are belong to us
03:19 AM polprog: //:(){:|:&}:
03:19 AM Emil: pls
03:19 AM Emil: it says on top
03:20 AM Emil: in the comments
03:20 AM polprog: whoops
03:20 AM polprog: lol
03:20 AM nuxil: but Emil my 2nd question remains.
03:21 AM Emil: nuxil: because it's placeholder
03:21 AM nuxil: thats a big placeholder for a 0
03:22 AM nuxil: &(d[i]) will always be 0 right. so that could just be replaced with a 0 right?
03:23 AM Emil: _placeholder_
03:23 AM Emil: also I wonder what kind of binary gcc generates from this example
03:24 AM Emil: I should check
03:26 AM polprog: just write a linker script and use a symbol that it placed
03:26 AM polprog: its more _elegant_
03:26 AM Emil: or just include "data.h"
03:26 AM Emil: and move d there
03:26 AM polprog: bleh
03:27 AM polprog: -mmcu=m238p -fclusterfuck -O3
03:33 AM nuxil: Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?
03:34 AM nuxil: thats a good quote from Brian Kernighan
03:35 AM Haohmaru: you paste it to #avr and wait for nuxil to analyze it
03:35 AM nuxil: :)
03:36 AM Emil: but really nuxil polprog Haohmaru how did you not figure it out? :D
03:37 AM polprog: i did, excuse me
03:37 AM Haohmaru: Emil figure out what?
03:38 AM polprog: if i paste an infinite recursive function in the channel, will nuxil fall into an inifinite loop trying to analyze it?
03:38 AM nuxil: Emil, you did not mention anything about bitbaning or external eeproms not did you say it was a placeholder.. just that it filled the eeprom with zeros. i said maybe i missed something. your comments gave some clues tho.
03:39 AM Emil: polprog: >2018-05-17 10:18:04 +0300 < polprog> nuxil is right, pgm is for progmem
03:39 AM polprog: christ that timestamp probably takes half of my terminal width
03:39 AM polprog: anyway
03:39 AM Emil: https://emil.fi/m/2018-05-17_11-04-41_Woj0xBgU.png
03:40 AM Emil: it's not too bad
03:40 AM polprog: [09:39] <polprog> unless he bamboozled us and theres an eeprom on PORTD
03:40 AM Emil: On mobile, well, yeah, kinda
03:40 AM Emil: 2018-05-16 15:03:40 +0300 < Emil> Haohmaru: it's an eeprom burner :D
03:40 AM Emil: 2018-05-16 15:03:45 +0300 < Emil>
03:40 AM Emil: 2018-05-16 15:03:47 +0300 < Emil> http://ww1.microchip.com/downloads/en/DeviceDoc/doc0270.pdf
03:40 AM Emil: These lines
03:40 AM polprog: i said probably because of this https://puu.sh/AnJZY/1a959cae66.png
03:40 AM Emil: Also
03:41 AM Emil: I literally linked the eeprom chip :D
03:41 AM polprog: im on mobile, at school, having maths rn :p
03:41 AM Haohmaru: Emil i don't read everything you say
03:41 AM Haohmaru: ;P~
03:41 AM polprog: anything*
03:41 AM nuxil: ^^
03:41 AM polprog: :v
03:45 AM Emil: https://emil.fi/m/photo6046138515164605779.jpg
03:45 AM Emil: polprog
03:45 AM Thrashbarg: what kind of lunatics are you, trying to IRC on a phone :P
03:46 AM nuxil: my thoughts aswell
03:46 AM nuxil: irc junkies :p
03:46 AM Thrashbarg: hehe
03:46 AM Emil: Thrashbarg: juice ssh, it's a ssh terminal
03:46 AM Emil: so I can use it for irc also
03:46 AM Thrashbarg: yeah
03:47 AM Thrashbarg: I've got it on my phone for when I need to access my server if I don't have a laptop handy
03:47 AM Emil: exactly
03:47 AM Emil: also when you need to irc and don't have a laptop available
03:47 AM Emil: >:D
03:48 AM Thrashbarg: I don't need to IRC that badly haha
03:48 AM polprog: Emil: i used to use connectbot to SSH but revolution irc gives me notifications
03:49 AM Haohmaru: https://i.imgur.com/Nuu0tzi.png
03:49 AM Emil: polprog: but that's only irc and also only works on shitnode
03:50 AM Emil: s/shitnode/networks with nickserv
03:50 AM Emil: right?
03:50 AM polprog: Haohmaru: wow mirc wow vertical screen
03:50 AM polprog: Emil: unless you use irssi as a proxy and let irssi deal with nickserv auth
03:50 AM nuxil: np++ & wxformbuilder :D
03:50 AM Emil: polprog: waitwaitwait
03:50 AM polprog: emacs+emacs
03:51 AM Emil: polprog: what's the topology
03:51 AM Thrashbarg: Haohmaru: https://i.ytimg.com/vi/uZ2ZZQglF0k/hqdefault.jpg
03:51 AM polprog: Emil: sec
03:51 AM Emil: Haohmaru: also: why not write that bootloader in C
03:52 AM Emil: or you are and you are also jus analysing the asm?
03:52 AM polprog: Emil: irssi listens on one channel per network and i connect my client to my server, each net on its own port
03:52 AM Emil: Haohmaru: also, is that a Windows fucking XP?
03:53 AM Thrashbarg: haha looks like 7 with the classic non-aero theme
03:53 AM Emil: or 7 you've disabled all glitter on?
03:53 AM polprog: might be 7 with shrunk taskbar and aero off
03:53 AM polprog: looks pretty classic then
03:53 AM Emil: feels very old, out of date and insecure
03:53 AM polprog: lol Thrashbarg
03:53 AM nuxil: Haohmaru, your np++ style it utterly boring :p enable syntax highlighting atleast and a different style, something like mine :p . https://gyazo.com/4096f0b3e64bfcd1cbd654f080c28094
03:53 AM polprog: that icon set eww
03:54 AM polprog: but overall good colora
03:54 AM Emil: https://emil.fi/m/2018-05-17_11-18-51_lDIvgdii.png
03:54 AM polprog: colors*
03:54 AM Emil: the fuck is that
03:54 AM Emil: 5 icons exactly the same
03:55 AM Emil: also wat https://emil.fi/m/2018-05-17_11-20-08_9WajKAR2.png
03:55 AM Emil: https://emil.fi/m/2018-05-17_11-20-17_rRt2jfuz.png
03:55 AM nuxil: from left to rigyht.. 1 usder defined langage.. 2 document map. 3 function list 4 folder as workspace and 5 monotoring. "tail"
03:55 AM nuxil: *arg
03:55 AM polprog: https://puu.sh/zAjMt/5754d15416.png
03:55 AM polprog: joking ofc
03:56 AM polprog: let me find the real pic
03:56 AM Emil: nuxil: you can just use 0b00000000
03:56 AM Emil: nuxil: no need to use hex
03:56 AM nuxil: what are you looking at now ?
03:56 AM polprog: https://puu.sh/zwQqU/e131bfb4e6.png
03:56 AM Emil: that gyazo link
03:58 AM Emil: polprog: don't turn to C++
03:58 AM Emil: that road is nothing but darkness and suffering
03:58 AM Emil: stay on the righteous path of C
03:58 AM polprog: notice how most of it is in assembly
03:58 AM polprog: lol
03:59 AM nohitwork: are all external eeproms accessed like static ram Emil
03:59 AM Emil: nuxil: hm?
03:59 AM polprog: lol just noticed the second pic has main.c but uses cout :D
03:59 AM nuxil: Emil, im not following ?
03:59 AM Emil: nohitwork: *
03:59 AM Emil: nuxil: instead of calculating the hex
03:59 AM Emil: nuxil: you can just use binary
03:59 AM Emil: nohitwork: it depends on your interface
04:00 AM nuxil: ahh yea.. i like i can use dec or octave too. i like hex
04:00 AM Emil: nohitwork: parallel interface is pretty much exactly the same for eeprom and ram
04:00 AM Emil: except ram is a lot faster
04:00 AM Emil: and eeprom is slow as balls
04:00 AM Haohmaru: Emil in C++17 to make it smaller
04:00 AM Haohmaru: ..the bootloader
04:00 AM polprog: octave? why would you need that nuxil
04:00 AM polprog: got some matrices to calculate?
04:00 AM polprog: :P
04:01 AM nuxil: polprog, i dont.. but you can use octave if you like. nothing wrong with it.. if thats what you prefere :p
04:01 AM polprog: you mean octal :D
04:01 AM nuxil: arg
04:01 AM Emil: polprog: also that's disgusting, using ternary to join strings like that :D
04:01 AM nuxil: ofc
04:01 AM Emil: inside asm volatile :D
04:01 AM Emil: but werks so whynot
04:01 AM polprog: Emil: which picture
04:01 AM Emil: latest
04:02 AM Haohmaru: nuxil i hate notepad++, i only use it for the stupid auto-reload thing and it even has a dumb bug then
04:02 AM polprog: lol thats not ternary
04:02 AM polprog: thats asm() syntax
04:02 AM Haohmaru: i mean, i don't *write* in notepad++ hell no
04:02 AM polprog: dont ask, its horrible
04:03 AM Emil: polprog: https://emil.fi/m/2018-05-17_11-28-16_U4aiIi9Z.png the fuck is that
04:04 AM polprog: Emil: rtfm
04:05 AM polprog: :D
04:05 AM polprog: https://www.nongnu.org/avr-libc/user-manual/inline_asm.html
04:06 AM nuxil: Haohmaru, why not :) its nice :p
04:06 AM Emil: my eyes burn
04:06 AM polprog: https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
04:06 AM polprog: yeah i said the syntax is horrible
04:06 AM nuxil: mine too. change the color of your strings
04:07 AM polprog: lol you dont like pink strings?
04:07 AM nuxil: no. no one would unless they are barbi herself
04:08 AM nuxil: :p
04:08 AM Haohmaru: nuxil i write code in an IDE
04:08 AM Haohmaru: notepad++ is silly
04:08 AM polprog: lol
04:09 AM polprog: i like that color scheme
04:09 AM polprog: they stand out
04:09 AM nuxil: polprog, my function list is pink tho :p
04:09 AM nuxil: https://gyazo.com/34d96ade588b7d4ab73f4e0baabf54f9
04:09 AM polprog: hehe
04:10 AM polprog: whats that for? which mcu?
04:10 AM nuxil: that was for a atiny85 what im rewriting a bit for atmega88 since i ran out of ports.
04:10 AM polprog: k
04:11 AM polprog: cya, gotta go
04:11 AM Emil: cya
04:11 AM nuxil: l8r
04:12 AM Haohmaru: vertical screen - moar codez
04:12 AM Haohmaru: terriburu LCD viewing angle tho
04:12 AM Haohmaru: left eye sees darker, right eye sees brighter
04:13 AM nohitwork: Emil yeah i was thinking about flash for some reason. your code makes perfect sense. but...are you practising for "write most un-readable code 2018 competition" or something ?
04:13 AM Emil: nohitwork: haha yeah :D
04:14 AM Emil: nohitwork: Of course when I first wrote it I used abstraction functions like "writeAddres(u16)" and "writeByte(u8)" and "commit()"
04:14 AM Emil: nohitwork: but I on purpose code golfed a bit
04:14 AM Emil: because I wrote it for these students doing a course and they were using Arduishit
04:15 AM Emil: so I made it a bit harder
04:15 AM nuxil: hes taking part https://www.ioccc.org/
04:15 AM Haohmaru: Fartduino?
04:16 AM nuxil: next year :p
04:16 AM Haohmaru: Emil my code was bigger than 8KB (boot sector size) and i hadn't even started coding the actual bootloading functions
04:17 AM Haohmaru: so i had to make it smaller: if i went for C, i'd have to hardcode a pile of constants
04:17 AM Haohmaru: so i went for C++17 and constexpr sh*t
04:18 AM Haohmaru: so no mystical hardcoded constants, same nasty formulas as always, but ran at compile time
04:18 AM Haohmaru: ++benefit;
04:18 AM Haohmaru: --C;
04:19 AM nohitwork: also you are tying CE to ground?
04:19 AM Emil: Haohmaru: why not use define?
04:19 AM Haohmaru: that is "hardcoded"
04:19 AM Emil: nohitwork: heh, yeah
04:19 AM Haohmaru: if i change F_CPU or anything it all goes in the trash
04:19 AM Emil: on m328p you have _precisely_ enough pins to make it work
04:20 AM Emil: nohitwork: It was like 5 minutes of coding
04:20 AM nuxil: lies :p
04:20 AM nohitwork: hmm you need also OE
04:20 AM nuxil: that error stalled you for 3 min :p
04:20 AM Emil: nohitwork: that's only for reading
04:21 AM nohitwork: oh yeah sorry
04:21 AM Emil: I mean
04:21 AM Emil: I'm already feeling the feature creeps
04:21 AM Emil: But I must resist it and let the students do it themselves :D
04:21 AM nohitwork: but you could do a veriry feature
04:21 AM Emil: I know
04:21 AM nohitwork: *verify
04:22 AM Emil: And I should
04:22 AM Emil: or they should
04:22 AM Emil: it's just very simple demonstration code
04:22 AM nohitwork: yeah
04:23 AM Emil: if it was for a bigger atmega (say 2560 or 1280)
04:24 AM Emil: I would have written CE control and verify and serial port control and monitoring and so on
04:24 AM Emil: like I said
04:24 AM Emil: I'm feeling the creeps :D
04:27 AM APic: g/ 131
04:27 AM APic: Sorry
04:31 AM Emil: that's some irc channels
09:18 AM eimiar: hi, i'm just beginning to mess around with avr, any suggestions?
09:19 AM Haohmaru: avoid arduino like teh cancer
09:19 AM eimiar: noted. why?
09:19 AM Haohmaru: caaanceeer
09:20 AM eimiar: lol
09:20 AM eimiar: but what if i'm a medic?
09:20 AM eimiar: wouldn't cancer be part of my job? :D
09:21 AM Haohmaru: u may cure cancer
09:21 AM eimiar: anyway i'm going in the hard way
09:21 AM Haohmaru: u can't cure arduino
09:21 AM eimiar: i salvaged an avr atmega32 from a microwave oven
09:22 AM Haohmaru: my advice: get a newer avrgcc and use C++11 or moar
09:27 AM Emil: eimiar: emil.fi/avr
09:28 AM Emil: eimiar: also C only
09:28 AM Emil: don't even think about touching C++
09:28 AM Haohmaru: don't listen to Emil
09:29 AM Haohmaru: he has sold his soul to.. you know who
09:29 AM Thrashbarg: Never listen to Thrashbarg
09:29 AM Emil: Haohmaru is the devil
09:29 AM Haohmaru: hell no, i'm not
09:29 AM Emil: Well, Vlad the Implaer then
09:29 AM Haohmaru: the Thrashbarg paradox
09:29 AM Emil: Impaler*
09:30 AM Thrashbarg: I'm not really Thrashbarg, I'm just pretending to be
09:30 AM Emil: eimiar: anycase, here's some code example also https://emil.fi/d/streamer.c
09:31 AM eimiar: Emil, it did never cross my mind to code avr in c++ :D
09:32 AM Emil: Haohmaru: Ha, omae wa mou shindeiru!
09:32 AM eimiar: is it a good idea to bitbang on the raspberry pi gpio with avrdude?
09:33 AM rue_mohr: I still say c++ is a bad idea on avr, and I'm sure its got more issues than using C
09:33 AM Emil: eimiar: you mean programming wise?
09:33 AM eimiar: otherwise i have a ftdi breakout board (tumpa-lite)
09:33 AM Emil: programming an avr on raspi?
09:33 AM eimiar: Emil, yes, programming
09:33 AM Emil: Your ftdi will only work if your avr has a (standard) bootloader
09:33 AM eimiar: i don't know if avrdude can do more complex stuff like remote debugging
09:33 AM Emil: order a few usbasps from china
09:34 AM Emil: eimiar but you can use raspberry pi to program avrs just fine
09:34 AM rue_mohr: I wonder if you can find anything else that dosn't work completely right to include
09:34 AM eimiar: then i think it's a good idea to start with that, at least i'll know if the avr i salvaged still works or not
09:35 AM Haohmaru: rue_mohr it's not a bad idea
09:35 AM Haohmaru: it's perfectly valid
09:35 AM Haohmaru: pls
09:35 AM Emil: eimiar: I trust you can use a search engine with the correct keywords to find out how to program an avr on a raspi
09:35 AM eimiar: Emil, already covered that ;)
09:36 AM Emil: Is there something you need us for then? :D
09:36 AM eimiar: no, not much :D
09:36 AM eimiar: not yet
09:36 AM eimiar: just my way of saying "hello world!"
09:36 AM Emil: that's good
09:36 AM Emil: also
09:37 AM Emil: https://emil.fi/d/overhead.cpp
09:39 AM Haohmaru: overhead of what?
09:40 AM Emil: Haohmaru: arduino
09:40 AM Haohmaru: rename that accordingly then
09:40 AM Haohmaru: pls
09:40 AM Emil: eimiar: also the avr arduino boards are okay as minimum development boards
09:40 AM Emil: Haohmaru: do you feel threatened because it's marked as .cpp? >:D
09:41 AM Haohmaru: me? no
09:41 AM Haohmaru: i'd feel sad if i was stuck with C
09:41 AM Haohmaru: (as i am when dealing with pics)
09:42 AM eimiar: "Your favourite search engine is also your friend in looking at pinouts."
09:42 AM eimiar: lol
09:42 AM rue_mohr: I suppose c++ is kinda the same thing as my macros, if you dont know what your doing, yea, it wont work
09:43 AM Haohmaru: what macros?
09:43 AM rue_mohr: ah, you have never read the channel topic, huh
09:44 AM Haohmaru: i'm really proud with this function that tries all combinations of USART settings to find the one that gives closest actual baudrate to the desired and sets it onto the USART
09:44 AM Haohmaru: how will you do that with macros?
09:45 AM rue_mohr: no, I'm just saying that c++ is like the macros, casue if you dont know what your doing, it wont work
09:46 AM Haohmaru: uhm, of course! do you suggest that C would work even if you didn't know what you're doing?
09:46 AM Haohmaru: muhahah
09:46 AM rue_mohr: there are a lot of ways of getting c++ to inadvertantly exhaust the resources on an avr
09:47 AM nohitwork: its .cpp because arduino uses cpp ;)
09:47 AM rue_mohr: if you have never read the topic, you dont know about the baud rate calculator either...
09:47 AM nohitwork: hahahhaah you cant use c++ anymore
09:47 AM rue_mohr: http://wormfood.net/avrbaudcalc.php
09:47 AM Haohmaru: nohitwork okay, i'll find some very poor C code and tell everybody that C is generally bad cuz of that
09:48 AM Haohmaru: rue_mohr i know that, it's not better than my fancy function
09:49 AM Haohmaru: i literally just change the value "19200" to "57600" or whatever, and recompile that sh*t
09:49 AM rue_mohr: oh odes it compiletime, nice
09:49 AM Haohmaru: of course.. it turns into constants
09:49 AM Haohmaru: the function uses nasty 32bit integer math and loops and what not, but it all goes poof
09:50 AM rue_mohr: untill someoe puts a dynamic var is the wrong spot? :)
09:50 AM Haohmaru: it's still gonna work
09:52 AM rue_mohr: so, I think the world might have mostly given up on using bowden systems for 3d printers
09:52 AM Haohmaru: you can write boring C-like code in C++ too, but you can't take advantage of the nice things of C++ while you're stuck in C
09:53 AM thardin: has anyone in here poked with interfacing µSD cards on AVR?
09:53 AM thardin: is there much use having support for interrupts for that?
09:53 AM rue_mohr: you want the SD to interrupt ya when its got data ready?
09:54 AM thardin: maybe. I saw there's a pin for it at least
09:54 AM rue_mohr: are you thinking for DMA transfers?
09:54 AM thardin: nah, no dma
09:54 AM thardin: I might not even go for any µSD in the final design. but it might be good to have there
09:55 AM thardin: not even sure I'll go*
09:59 AM thardin: screw it, I'm not going to micro-optimize this
10:04 AM Emil: rue_mohr: can you unfuck the topic pls?
10:04 AM Emil: rue_mohr: just put "Atmel AVRs" there
10:05 AM Emil: just to spite Microshit
10:05 AM Emil: :D
10:08 AM polprog: "we support only chips made prior to year XXXX"
10:16 AM Emil: a "ai" bot that kick(ban)s you if you ask about microshit :D
10:17 AM Emil: heh
10:17 AM Emil: perhaps I should stop bashing microchip that mucj
10:17 AM Haohmaru: for once i agree with Emil
10:17 AM Emil: imagine if they have spies here
10:18 AM Haohmaru: they have ears here?
10:18 AM Haohmaru: HEY MICROSH*T, PICKIT3 SUUUUUUX
10:18 AM Haohmaru: YA HEAR ME?
10:18 AM Emil: kek
10:19 AM Haohmaru: but it's no use
10:19 AM Haohmaru: even if pickit3 was "fixed", their sh*t doesn't have enough RAM nor C++ support
10:19 AM Haohmaru: meeeh
10:19 AM Haohmaru: ++avr;
10:20 AM Haohmaru: ++xmega;
10:23 AM Emil: thats why you use pic32
10:24 AM Emil: was it LeoNerd or lambda who used those
10:24 AM Haohmaru: lambda
10:24 AM Haohmaru: THT DIP pic32
10:24 AM Haohmaru: i say no
10:25 AM Haohmaru: it still means staring at ugly microchip datasheet
10:25 AM Haohmaru: some (many?) of their datasheets have only ASM examples
10:25 AM Haohmaru: wtf
10:26 AM Haohmaru: what year is this? 1835?
10:26 AM Haohmaru: some time before Edison and the light bulb?
10:28 AM LeoNerd: Emil: I've never PICed
10:28 AM LeoNerd: ... well, except one time at university
10:28 AM LeoNerd: I was young...
10:30 AM Haohmaru: traumatized for life
10:30 AM Haohmaru: :~(
10:34 AM Emil: alas
10:34 AM Emil: our dark make labdra auriage is gone
10:34 AM Emil: and the knowledge of the dark arts with him
10:35 AM Emil: dark mage lambda_aurigae*
10:42 AM polprog: pic e2
10:42 AM polprog: pic 32 lab
10:42 AM polprog: fucj
10:42 AM polprog: fuck
10:42 AM polprog: pic32 is quite interesting as its a 32 bit dip chip
11:03 AM Haohmaru: auto &r = polprog.credibility; --r;
11:16 AM polprog: >auto
11:17 AM polprog: thats for pussies who cant decide what type to use :^)
11:22 AM Haohmaru: i didn't want to expose the truth
11:22 AM Haohmaru: struct polprog { /* stuff */ uint2_t credibility; };
11:23 AM * Haohmaru runs
11:27 AM Thrashbarg: if (x == 1) { /* Run if X equals 1 */ ...; }
11:52 AM polprog: return 0; //returns 0
11:53 AM polprog: x ^= BITMASK&(y<<3+1)|(12&z) //do the thing
11:53 AM polprog: also
11:54 AM polprog: this kind of a shit wire that has a nylon/plastic strand core and super thin wires only, is there any normal way to solder it?
11:54 AM polprog: i was twiddling with separating the plasic core and then burning off the enamel and it barely took solder
12:22 PM Emil: >y>>3+1
12:22 PM Emil: y<<3+1
12:22 PM Emil: I hate gcc
12:23 PM Emil: imho it's obvious that the shift is of higher priority than summation
12:23 PM Emil: but iirc gcc happily does 3+1 and then y<<4
12:31 PM cehteh: http://en.cppreference.com/w/c/language/operator_precedence
12:31 PM cehteh: .. shifts have lower precedence than addition/substraction
12:32 PM cehteh: emil=wrong gcc=right :D
12:39 PM thardin: shrekt
12:49 PM antto: boom, Emil was thrown back into first grade
12:49 PM antto: use ()
12:49 PM antto: (y>>3)+1
01:19 PM polprog: fuck me
01:19 PM polprog: i fixed the headphones
01:23 PM Emil: cehteh: and they should not
01:24 PM Emil: especially because they are just multiplication
01:24 PM Emil: terms should be summed at the very last step
01:25 PM Emil: I'd even put shifts over multiplication
01:59 PM nux_ is now known as nuxil
02:04 PM ravon_: Anyone who is good with gcc internals?
02:13 PM nuxil: Ameisen, :p
02:57 PM antto: ask yer question, or maybe in #gcc
02:57 PM antto: ah, he already did
03:06 PM MrFahrenheit: nuxil, do you have a bed leveling sensor?
03:07 PM nuxil: yes i have a BLTouch sensor. but have not mounted it yet.
03:08 PM MrFahrenheit: a legit one or a clone?
03:08 PM nuxil: legit
03:08 PM nuxil: or who knows :p
03:08 PM nuxil: it suppose to be legit
03:08 PM MrFahrenheit: I ordered a clone yesterday, didn't see a legit one but I heard they're $50
03:08 PM nuxil: yea
03:09 PM Emil: Do you have some sort of fancy beds?
03:09 PM MrFahrenheit: I get why the legit one might be so pricey, I don't get why the clones are still >$20, isn't it just a solenoid and a hall effect sensor in there?
03:10 PM nuxil: yea something like that
03:10 PM MrFahrenheit: my bed is just a mirror on the aluminium heater
03:11 PM nuxil: do you still need gluestick with the mirror?
03:11 PM MrFahrenheit: no
03:11 PM MrFahrenheit: and I was using hairspray :P
03:12 PM MrFahrenheit: it's still not fully flat though
03:13 PM nuxil: that was a problem i had when i took the glass from a old picure frame.
03:14 PM nuxil: so i went and bought a proper 3mm glass from the glass seller
03:17 PM MrFahrenheit: I'm printing a spool holder now, designed it after the TUSH, but with more stability and so it mounts on top of my control box
03:19 PM nuxil: my spool holder is mega simple
03:20 PM nuxil: basically just a pipe
03:20 PM nuxil: :p
03:20 PM MrFahrenheit: same, but it wobbles too much
03:20 PM MrFahrenheit: so I'm making a better one
03:21 PM MrFahrenheit: https://cad.onshape.com/documents/a02305699079f3d29bb15153/w/76986f314c3f1839681c2517/e/3ffbc3e282ffc3cd3021308f
03:22 PM nuxil: look nice.
03:22 PM nuxil: but
03:23 PM nuxil: how does it handle smaller rolls. 60meter rolls ?
03:27 PM MrFahrenheit: the smallest diameter roll it can handle is ~16cm, but if you increase the holder_corner_center_height variable, it could do smaller
03:27 PM MrFahrenheit: not too fussed about it though, I can always just screw the old holder back on if I really need to
03:27 PM nohitzzzz: Emil how about some mass storage device with the eeprom programmer. and some simple file system
03:28 PM nohitzzzz: vinculum for usb host, for usb sticks
03:28 PM nuxil: MrFahrenheit, i have rolls that are 15,5cm, 18cm and 20cm
03:29 PM nohitzzzz: or sd card
03:32 PM nohitzzzz: http://elm-chan.org/fsw/ff/00index_p.html
03:33 PM nuxil: thats a nice link
03:33 PM nuxil: will come in handy someday :p
03:34 PM MrFahrenheit: I thought all my rechargeable batteries were flat cause none could make my wireless mouse move, turns out I pulled the dongle out of the laptop by accident without noticing
03:36 PM * nuxil still uses the good old logitech mx518
03:36 PM MrFahrenheit: my mouse is also a logitech, both are
03:37 PM MrFahrenheit: m325 and m235
03:38 PM nuxil: awww. thats a mouse for baby hands :p
03:39 PM nuxil: this is a mouse for you lappy?
03:40 PM MrFahrenheit: one for the laptop, the other for the desktop, I like using small mice
03:40 PM nuxil: this m325 is kind of small.. https://www.jmccomputers.com.au/wp-content/uploads/2015/05/image005.jpg
03:40 PM MrFahrenheit: I don't rest my hand on them, just my fingers
03:41 PM nuxil: i like big mouses. with small mouses my hand dont rest well so i get paint in my fingers after a while.
03:41 PM nuxil: *pain
03:42 PM MrFahrenheit: I use them like this https://siskomb.files.wordpress.com/2013/05/fingertip-grip.jpg?w=335
03:43 PM MrFahrenheit: I'm guessing you're more like https://siskomb.files.wordpress.com/2013/05/palm-grip.jpg?w=290
03:43 PM nuxil: yea
03:44 PM nuxil: thats how the mx 518 fits in my hand
03:50 PM nuxil: man js is lol and stupid.
03:51 PM nuxil: https://pastebin.com/m0W4zaG5
03:52 PM nuxil: try run that in your browser
03:54 PM nohitzzzz: } ?
03:54 PM eimiar: heyy
03:54 PM nohitzzzz: hey
03:54 PM nuxil: nohitzzzz, did you?
03:54 PM nohitzzzz: yes
03:55 PM eimiar: i'm the same beginner as today
03:55 PM eimiar: so i have tried using a ftdi-232h as programmer with avrdude
03:55 PM nuxil: see the result is 53 on one line 2 on next line-
03:55 PM MrFahrenheit: nuxil, https://www.destroyallsoftware.com/talks/wat
03:56 PM eimiar: i'm trying a simple action which is reading the hfuse byte
03:56 PM eimiar: and i get 4 times the error 871 (program enable command not successful. retrying)
03:56 PM eimiar: avrdude is suggesting to double check connections and try again
03:58 PM nuxil: and you did =
03:58 PM nuxil: ?
03:59 PM nuxil: ftdi-232h programmer?
03:59 PM nuxil: does avrdude support this?
03:59 PM nohitzzzz: maybe use that raspi method
04:00 PM nohitzzzz: nuxil can guide you
04:00 PM * nuxil just uses his raspberry for programming
04:00 PM eimiar: these are my config: https://pastebin.com/QkdWDdyB
04:00 PM eimiar: this is the output: https://pastebin.com/sBhrqGNc
04:00 PM eimiar: and this is the pinout: https://pastebin.com/iW0zvsAm
04:01 PM nuxil: eimiar, http://projects-raspberry.com/programming-the-attiny85-from-raspberry-pi/
04:01 PM eimiar: nuxil, i can try that
04:01 PM nuxil: its not just for atiny85
04:01 PM eimiar: but in the meantime, is there something blatantly wrong with what i did so far?
04:02 PM nuxil: Using Port : /dev/parport0 ?
04:02 PM nuxil: is that correct?
04:03 PM eimiar: well i don't know :|
04:04 PM eimiar: oh of course it shouldn't be
04:04 PM eimiar: well i'm gonna try with raspberry pi
04:05 PM nuxil: https://gyazo.com/fd5bbb22d18a7922a5a582646c0c6275 my programmer :p
04:06 PM nohitzzzz: haha nice
04:06 PM nuxil: dont need no fancy thingamabob to program :p
04:13 PM Emil: nohitzzzz: pls no, the creeps are fucking strong with me
04:14 PM Emil: I already have too little time to do anything so to not do anything I'll just watch animu :D
04:14 PM Emil: Perhaps I should just become a leech and live on guberment aid and program and develop to my heart's desire :3
04:15 PM Emil: eimiar: you can't use a serial programmer for fuses
04:15 PM Emil: at all
04:16 PM eimiar: :<
04:16 PM Emil: I thought you had this figured out
04:16 PM nuxil: Emil, what ?
04:16 PM eimiar: Emil, can i use jtag for fuses?
04:16 PM Emil: eimiar: jtag might werk
04:16 PM Tom_L: overkill but probably
04:16 PM eimiar: but then i might not be able to use avrdude
04:16 PM Tom_L: isp works
04:16 PM Emil: nuxil: serial bootloaders cannot touch or do anything for fuses
04:16 PM Emil: eimiar: yes you can
04:16 PM Emil: but realy
04:17 PM Emil: just use avrdude and isp
04:17 PM Emil: (which is just spi)
04:17 PM eimiar: ah, i thought you were writing it wrong
04:17 PM Tom_L: shhhh.. don't tell anybody
04:17 PM nuxil: or your raspberry thats is spi :p
04:17 PM eimiar: now i connected raspberry pi with avr
04:18 PM eimiar: gpio 0 to 3: reset, sck, miso, mosi
04:18 PM nuxil: Emil, ok. i dont have experiance with any other programmes that my home made one.
04:18 PM Emil: btw what's the words forISP
04:18 PM eimiar: so, this is my conf now: https://pastebin.com/S3Fsu7x8
04:19 PM nuxil: in system programmer ?
04:19 PM Emil: yeah that's probably it'
04:19 PM eimiar: lol "error: no pin has been assigned for AVR RESET"
04:20 PM Emil: eimiar: you need all six pins
04:20 PM Emil: VCC, GND, RST, MOSI, MISO, SCK
04:20 PM eimiar: wait a second, there is a SPI reset?
04:20 PM Emil: bruh
04:20 PM eimiar: ah yes of course VCC and GND are connected
04:20 PM Emil: do you even emil.fi/avr
04:20 PM eimiar: didn't mention that
04:20 PM nuxil: eimiar, follow that guide i pasted. http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/
04:21 PM nuxil: and do it step by step.
04:21 PM nuxil: start off with that blinky as your 1st program.
04:21 PM Emil: https://emil.fi/m/2018-05-17_23-46-02_Ng8VHdk6.png
04:22 PM eimiar: Emil, this is what i have http://ww1.microchip.com/downloads/en/DeviceDoc/doc2503.pdf
04:23 PM eimiar: page 2
04:23 PM nohitzzzz: god damn
04:23 PM eimiar: pins 6 to 11 are connected to rpi
04:24 PM nohitzzzz: emils pic is different device
04:25 PM eimiar: page 5 says AVCC should be externally connected to VCC even if the ADC is not used (which is something i didn't do)
04:25 PM eimiar: nohitzzzz, doesn't matter, they're both AVR
04:26 PM nuxil: hu?
04:27 PM nohitzzzz: sclk to pb7
04:27 PM nohitzzzz: http://ww1.microchip.com/downloads/en/DeviceDoc/doc2503.pdf page 2
04:28 PM nohitzzzz: http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/
04:29 PM nuxil: step 1 is like the most important one on the PI. unless you want to create your own driver and bitbang
04:29 PM nohitzzzz: mosi to pb5
04:29 PM nohitzzzz: miso to pb6
04:30 PM nohitzzzz: gpio22 to reset
04:30 PM nohitzzzz: 3v3 to vcc
04:31 PM eimiar: gonna use spi pinout of rpi and see what happens
04:31 PM nuxil: o.O you must :p
04:31 PM eimiar: 3 connections then, miso mosi and sclk
04:32 PM eimiar: (i don't mention vcc + gnd because i assume them as obvious)
04:32 PM nuxil: yea
04:32 PM nohitzzzz: 19,21,23 GPIO pins on raspi
04:33 PM eimiar: i have rpi b rev.2
04:33 PM eimiar: http://pi4j.com/pins/model-b-rev2.html
04:33 PM nohitzzzz: ok well i gave you the required connections above
04:34 PM eimiar: it's mosi to mosi and miso to miso? not miso to mosi and mosi to miso, right?
04:34 PM nohitzzzz: just use the spi on raspi, what ever version
04:34 PM nohitzzzz: mosi to miso
04:34 PM eimiar: https://upload.wikimedia.org/wikipedia/commons/e/ed/SPI_single_slave.svg
04:35 PM eimiar: are you sure?
04:35 PM nohitzzzz: sorry
04:35 PM eimiar: k
04:35 PM nohitzzzz: mosi to pb5
04:35 PM nohitzzzz: miso to pb6
04:35 PM nohitzzzz: sclk to pb7
04:38 PM * eimiar is powering up the rpi
04:38 PM nuxil: yea when programming its mosi -> mosi -> miso . but normal communication on spi should be miso <- mosi, mosi -> miso
04:38 PM nuxil: err
04:38 PM antto: wat
04:38 PM antto: nuxil, pls
04:39 PM antto: this is not a uart
04:39 PM nuxil: mosi -> mosi & miso -> miso
04:39 PM nuxil: yea thats how you do it on the PI.
04:40 PM antto: mosi means "master out, slave in" and miso respectively is "master in, slave out"
04:40 PM antto: as long as you don't try to wire up two masters together - everything's fine, just connect the dots, don't cross anything
04:41 PM antto: and don't enable (chip-select) two slaves at the same time
04:41 PM nuxil: i know the acronym of mosi, miso.
04:41 PM antto: yeah, you just like to make short circuits ;P~
04:42 PM nohitzzzz: eimiar does it work
04:42 PM eimiar: wait
04:42 PM nuxil: so youre telling me that. http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/ is wrong
04:42 PM eimiar: i can't find config to enabling spi
04:42 PM nohitzzzz: no its not wrong
04:42 PM nohitzzzz: its correct
04:43 PM nuxil: i know it correct cos i have it working :p
04:43 PM eimiar: i'm using raspbian jessie
04:43 PM eimiar: so it's slightly different
04:43 PM nohitzzzz: yes pin 19 MOSI to PB5 MOSI
04:48 PM eimiar: well, something happened
04:48 PM eimiar: because rpi won't boot anymore :D
04:48 PM nohitzzzz: :D
04:48 PM eimiar: i feel like Hal (malcolm in the middle) fixing a lightbulb
04:48 PM eimiar: https://www.youtube.com/watch?v=AbSehcT19u0
04:48 PM eimiar: i think that's it for today...
04:48 PM eimiar: thanks for all the help :)
04:48 PM eimiar: and good night ^^
04:48 PM nohitzzzz: nite
04:56 PM nuxil: he should probably have done a sudo apt-get install raspi-config . since he was missing this or else he would have had to setup spi manualy in the /boot/config.txt file.
04:57 PM nuxil: with dtparam=spi=on
04:58 PM nohitzzzz: i havent ever used raspi for that, i just looked at these 3 http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/ http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-2586-AVR-8-bit-Microcontroller-ATtiny25-ATtiny45-ATtiny85_Datasheet.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/doc2503.pdf
04:59 PM polprog: didnt even know you have to enable spi in boot.txt, mine worked out of the box
04:59 PM nuxil: then your distro came with it enabled by default. not sure if all of them do that
04:59 PM nuxil: or is set on by default
04:59 PM antto: some of these come with rootkits even
05:00 PM antto: some.. or most
05:02 PM polprog: lol
05:03 PM polprog: i fell back on raspis, i still use my b+ if i need it
05:03 PM antto: didn't they use those allwinner cpus?
05:03 PM polprog: heck i even have one model B, without mounting holes
05:03 PM polprog: i think those are broadcom
05:03 PM polprog: i associate allwinners with clones like banana or orange pi
05:05 PM nohitzzzz: how about this https://getchip.com/pages/chippro
05:06 PM MrFahrenheit: nuxil, I was wrong earlier, the spool holder fits my 15.5cm spool just fine with plenty of room to spare
05:07 PM nohitzzzz: its pretty cool that they give you the datasheets, i belive its not the case with raspi
05:08 PM nuxil: nohitzzzz, https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
05:09 PM nohitzzzz: ok
05:09 PM nohitzzzz: i remembered wrong
05:10 PM Emil: eimiar: of course you have to adapt the instructions to your own part
05:10 PM nohitzzzz: i think it wasnt availble when it first launched
05:35 PM Emil: nohitzzzz: CHIPs dead iirc
05:36 PM Emil: unfortunately
05:40 PM nohitzzzz: that's too bad
05:40 PM nohitzzzz: for them
11:40 PM day__ is now known as day