#avr Logs

Jan 24 2020

#avr Calendar

01:03 AM rue_mohr: vmt, dont tell me you only just learned that about java?
01:08 AM rue_mohr: like, the memory consumption and lack of stability of all java things should have been a giveaway
05:10 AM nuxil: vmt, wooot?? "right on par right there with python" ,, python is not shit. slow but anything but shit.
05:18 AM nuxil: java on the other hand. who uses it these days. it was used alot in emmbeded stuff. but where is it now? only place you really see java today is on android phones. :p
05:20 AM damjan: java is still big in the enterprise software
05:20 AM damjan: twitter moved to scala too
05:26 AM nuxil: lets roll back 15 years. you would see the damn java icon on almost every gadgets, printers etc. today you rarly see it anymore.
05:26 AM djph: nuxil: all over the place in certain IT shops. I hate it
05:26 AM nuxil: yes big companies still use java. google etc. but they also python. ruby rust go and whatnot.
05:28 AM nuxil: djph, stay away from thouse "certian" shops :p
05:29 AM djph: nuxil: unfortunately, one of them is my employer
05:29 AM djph: :|
05:30 AM nuxil: heh.
05:46 AM djph: it wouldn't be so bad if the kids writing it had more than a pair of braincells between them
06:17 AM bedah: hi.. got a fuse problem. hardware: board with atmega1284p, programmer: avrispmkII. right now the atmega1284p is using lfuse c0 (external clock), crystal oscialltor is running. i want to change lfuse to external crystal or intenal oscillator, but avrdude will not change the lfuse to e2 or 42
06:18 AM bedah: some pastebin: https://pastebin.com/iDBv20iC
06:20 AM bedah: reading the fuses with avrdude says: 'avrdude: safemode: Fuses OK (E:FF, H:D9, L:C0)'
06:20 AM djph: OK ...
06:20 AM djph: lessee...
06:25 AM djph: your port looks wrong, bedah
06:26 AM bedah: hm. i can read out the atmega1284p, and another one can be flashed. but this one does not like to have his lfuse changed
06:27 AM bedah: running on linux btw..
06:27 AM nuxil: i have the same issue on my arduino (atmega328p), and i found out its because of the bootloader. arduinoisp i got on it. weird tho
06:28 AM nuxil: i can flash it. but not change fuses. get same messages as you do,
06:28 AM bedah: i've got the orginal avr isp from atmel. old, but working
06:29 AM bedah: hmm..
06:29 AM djph: bedah: yeah, I figured that given the /usr/bin/ path. Usually I'd expect to see /dev/ttyUSB0 or /dev/ttyACM0 as the port though
06:30 AM djph: hmm, the fuses do imply there's a bootloader on that board ...
06:30 AM djph: s/board/chip/
06:30 AM nuxil: djph, but hes getting response from avrdude with usb. maybe usb is symlinked to /dev/ttyxxx
06:30 AM bedah: '-Pusb' is enough for avrispmk2 on linux, has worked since ever
06:31 AM djph: nuxil: eh, maybe. or it's something else talking back to him :)
06:31 AM bedah: hehe
06:33 AM nuxil: dosent hurt to try and /dev/xxx instead of usb
06:35 AM bedah: not really.. there is no /dev/ttyxxx from the programmer
06:35 AM bedah: three ttyUSB from the docking station, one from the ftdi-clone
06:36 AM bedah: and.. other AVRs on similar PCBs are working fine - i've checked that out
06:37 AM nuxil: hmm. but usb. how can avrdude know usb is for the programmer. i mean, usb is a loose term, im sure you got a usb keyboard, usb mouse etc
06:37 AM skz81: try 'dmesg -w' and unplug / replug the programmer
06:37 AM bedah: i just uploaded new code, but i cannot change this one fuse from external clock to internal or anything
06:38 AM skz81: you'll see how the kernel names it
06:39 AM bedah: https://pastebin.com/WNuUXyR8 unplug and replug - all fine :)
06:43 AM bedah: but lfuse refuses to be changed :(
06:47 AM nuxil: lockbit ?
06:54 AM nuxil: i belive there are some lockbit settings that prevents fuses from changing. check the datasheet.
06:54 AM nuxil: i dont remember if it also prevent flashing. really need to check ds,
06:55 AM bedah: flashing is working, spi programming is enabled
06:55 AM bedah: hm datasheet. k.
07:01 AM mouseghost: anyone did spi sd card :e?
07:01 AM twnqx: is that different from regular spi flash`
07:01 AM twnqx: ?
07:04 AM mouseghost: im not sure
07:04 AM nuxil: mouseghost, http://elm-chan.org/fsw/ff/00index_e.html
07:04 AM Fuchikoma: bedah: Are you using avrdude in interactive/terminal mode?
07:09 AM bedah: in terminal, it's interactive somehow..
07:09 AM bedah: "/usr/bin/avrdude -pm1284p -cavrispmkII -Pusb -U lfuse:w:0xE2:m" i what i want to do
07:10 AM nuxil: mouseghost, in the link i gave you. download the file "FatFs sample projects for various platforms" down on the page. it has an avr example
07:10 AM Fuchikoma: There's an actual -t switch that puts avrdude in terminal mode
07:11 AM mouseghost: oh, thanks
07:11 AM nuxil: mouseghost, also. you can take the arduino sd lib and rewrie it to C :p
07:11 AM mouseghost: thats how i wanted to handle crc7 lol
07:13 AM bedah: oh i got a terminal ._.
07:13 AM bedah: avrdude> _
07:15 AM Fuchikoma: Yeah. try command -?
07:16 AM Fuchikoma: Or maybe just ? without the dash in front I forget
07:20 AM bedah: https://pastebin.com/d1e3h9AZ
07:20 AM bedah: still reading 0xc0
07:20 AM bedah: maybe the chip is broken
07:21 AM Fuchikoma: try "part" to get more info
07:22 AM bedah: https://pastebin.com/mxj637rj
07:23 AM Fuchikoma: hrm
07:24 AM Fuchikoma: dump lfuse
07:25 AM bedah: avrdude: stk500isp_read_byte(): Sending read memory command: 0000 c0
07:25 AM bedah: and 'w lfuse 0 0xE2' says:
07:25 AM bedah: avrdude: stk500isp_read_byte(): Sending read memory command: avrdude (write): error writing 0xe2 at 0x00000 cell=0xc0
07:26 AM Fuchikoma: Well at least it's consistent
07:26 AM nuxil: time to hvsp :p
07:27 AM Fuchikoma: lesse 0xC0 for lfuse would be...
07:27 AM bedah: yes. but got no high voltage programmer
07:27 AM bedah: c0 is external clock
07:28 AM Fuchikoma: Divide clock by 8 + clock output
07:28 AM Fuchikoma: and the low nybble does indeed mean external clock
07:29 AM Fuchikoma: And you want to use the internal 128khz resonator it seems?
07:30 AM bedah: first i want to change to the internal rc oscillator, then attach a normal crystal
07:30 AM bedah: right now i'm using a 14.xx Mhz oscillator from the spare part bin
07:31 AM bedah: hm. i guess i will not waste any more time with it :/
07:31 AM Fuchikoma: Ah sorry I misread the table, yeah 0x02 would be the internal calibrated clock
07:31 AM bedah: lazy me uses http://www.engbedded.com/fusecalc/
07:31 AM bedah: :)
07:32 AM bedah: i will hard-wire the crystal oscillator onto the pcb, not beautiful, but will work for now
07:33 AM bedah: thanks anyway for all of your help :)
07:34 AM bedah: now i need to fix some stuff for something completly different..
08:28 AM mouseghost: ok so i inited sd card but i get 0x3f response after which i get 0x01
08:35 AM rue_bed: card might not support the mode your using
08:35 AM rue_bed: check the size table and type against the chart
08:36 AM rue_bed: it might also not support the initialization for the access method
08:36 AM rue_bed: most people dont know that sd cards are evil
08:38 AM mouseghost: b-but i just do spi thing >.<
08:38 AM nuxil: yea. they are evil in the way that they tend to corrupt your data for no reason :p esp cheap ones
08:39 AM mouseghost: hm
08:39 AM mouseghost: tho i suspect this 0x3f is because MISO is down before it
08:41 AM captain_morgan20 is now known as captain_morgan
08:42 AM mouseghost: like literally, am i supposed to ignore this 0x3f or what :|
08:42 AM nuxil: are you using your own code?
08:43 AM nuxil: if you are. try using a sd lib and see how it works.
08:45 AM mouseghost: WRRRR
08:48 AM nuxil: mouseghost, is this for your temp logger ?
08:48 AM mouseghost: yes
08:50 AM nuxil: how often do you log?
08:51 AM nuxil: cant you just use the internal EEPROM, log at set interval and when its full transfere the content of the rom to a pc or some other device over uart.
08:52 AM mouseghost: internal eeprom is like 512B
08:52 AM mouseghost: duh
08:52 AM mouseghost: isnt it
08:53 AM nuxil: depends. what chip.
08:59 AM nuxil: mouseghost, so question is how often do you log. if you log like once a hour and your temp value takes 2 bytes. you get 512 hours of logging
08:59 AM mouseghost: hm like every minute or second or half a minute
08:59 AM nuxil: assuming your using atmega328
08:59 AM mouseghost: im on atmega8a
09:01 AM nuxil: oh. oldshcool
09:12 AM Fuchikoma: Using internal EEPROM might not be the best idea anyway
09:13 AM Fuchikoma: Tesla got in trouble for that IIRC
09:13 AM nuxil: dont tell me your one of thouuse tesla car fanboys :p
09:14 AM Fuchikoma: I'm only reminded of an article I saw once
09:15 AM Fuchikoma: https://insideevs.com/news/376037/tesla-mcu-emmc-memory-issue/
09:16 AM Fuchikoma: Basically they record all their logging data to flash memory, but it wasn't really designed for that and the flash memory wears out and borks
09:16 AM nuxil: i have a habbit of play this song to tesla boys :p https://www.youtube.com/watch?v=qJBtqAM85zg&list=RDqJBtqAM85zg&start_radio=1
09:16 AM nuxil: Fuchikoma, ah yes i read about that too not so long ago
09:20 AM Fuchikoma: Point being that the EEPROM inside atmel chips is rated to 100K write cycles, which is a lot but maybe nto as much as you think
09:21 AM Fuchikoma: Especially in logging applications where you're constantly writing
09:21 AM nuxil: iirc its only 10k for eeprom. 100k for the flash
09:21 AM nuxil: or was it the other way around
09:22 AM * nuxil looks in datasheet
09:22 AM nuxil: yes other way around.
09:22 AM Fuchikoma: 10K flash/100K EEPROM
09:22 AM Fuchikoma: heh
09:25 AM rue_mohr: there might be a SD interface that abstracts out all the crap, or use something like a CF card, they just work
09:25 AM Fuchikoma: It Just Works (tm)
09:26 AM Fuchikoma: I vaugely remember this project from some time ago... why was using an SD card library dismissed?
09:26 AM rue_mohr: they usually have the same issues
09:26 AM rue_mohr: lots of the cards do not respond properly to init sequences
09:26 AM mouseghost: where do i even get sd card specs smh
09:27 AM rue_mohr: everyone made their own
09:27 AM rue_mohr: I was there in 2002 when people were first trying to use them
09:27 AM nuxil: datasheet should provide all info you need.
09:27 AM Fuchikoma: rue has that thousand-yard stare
09:27 AM mouseghost: got some city sandisk datasheet
09:27 AM mouseghost: got some city sd assoc. 1.01v datasheet
09:28 AM mouseghost: they dont even have bookmarks
09:28 AM mouseghost: smh
09:29 AM rue_mohr: lots of the cards need to be reset at some point in the init to keep working
09:30 AM rue_mohr: I remember everyone avoiding cards larger than 2G, but there was a fuzzy grey line
09:30 AM rue_mohr: just like dram, I decided to just avoid it
09:32 AM mouseghost: lol ive got 2G
09:32 AM mouseghost: tho the one i got specifically for it was 32G
09:32 AM mouseghost: :|
09:33 AM mouseghost: that was the cheapest one
09:33 AM mouseghost: smh
09:33 AM mouseghost: i couldve bough used ones now that i think of it
09:33 AM nuxil: do NEVER buy used sdcards.
09:34 AM nuxil: you dont know how many write cycles they been though
09:34 AM nuxil: they dont last forever you know.
09:34 AM mouseghost: :v
09:36 AM nuxil: i already needed to change sdcards a couple of times i used on my PI2. exessive write to swap caused it to wear out. :\
09:38 AM mouseghost: "copying text was denied" thank you sd association
09:38 AM nuxil: ?
09:38 AM mouseghost: nuxil, in that sd card association ref copying is denied apparently
09:38 AM nuxil: screenshots :p
09:40 AM mouseghost: nuxil, https://a.uguu.se/AUonf0ItSSX5.png
09:40 AM nuxil: yes.. thats what i meant. take a bunch of screenshots.
09:41 AM nuxil: or use press F12 "in chrome" and find the script preventing copying and comment it out
10:06 AM mouseghost: idk that sd card doesnt send its CSD
10:07 AM Fuchikoma: I presume you've checked this card in another device to be sure it's working properly?
10:13 AM mouseghost: yeah yeah of course
10:13 AM mouseghost: well maybe i initialize in an improper way
10:38 AM mouseghost: i read OCR yay
01:15 PM grafi_: any thoughts about platformio?
01:20 PM nuxil: nop.. i dont use ide. text editor and makefiles is what i use.
01:21 PM nuxil: it looks fancy though
01:22 PM grafi_: I've no experience with vscode, but the platformio concept looks pretty versatile (obviously)
01:29 PM nuxil: looking more at it. looks like bloatware to me :p trying to be all in one tool. and verry few apps manage to be that
01:32 PM grafi_: my initial thoughts as well
02:06 PM mouseghost: hm
02:06 PM mouseghost: ive tried it and couldnt use it
02:06 PM mouseghost: i use makefiles
02:23 PM mouseghost: ok so my sd card ir refusing to work aaaaaaaaaaaaa
02:27 PM nuxil: are you using your own implementation ?
02:28 PM nuxil: or a lib
02:35 PM mouseghost: my own
02:35 PM mouseghost: trying to
02:36 PM mouseghost: but its based on example in fatfs
02:36 PM nuxil: well. dont reinvent the wheel. get a working lib and use it.
02:36 PM nuxil: oki.
02:39 PM mouseghost: nuuh
02:47 PM nuxil: why not?
05:06 PM nuxil: anyone got experiance buying stuff from alibaba?
05:07 PM nuxil: im surfing for lcd screens. and i came across several 4k screens for only 10$
05:07 PM nuxil: https://www.alibaba.com/product-detail/3D-printing-4k-lcd-with-HDMI_62017762244.html?spm=a2700.details.deiletai6.5.8b895f49DJvFlE
05:07 PM nuxil: too good to be true???
05:16 PM nohit: show me an actaul seller
05:17 PM nuxil: didnt i just do that?
05:18 PM nuxil: also this one. seems more correct in terms of pricing https://www.alibaba.com/product-detail/Factory-Original-Sharp-IPS-LS055R1SX03-5_62316415568.html?spm=a2700.7724857.normalList.1.152e7915rQGHpd
05:19 PM nohit: US$5,99 - US$60,00 / Piece
05:19 PM nuxil: i never bought stuff from alibaba. im a bit skeptical to this chinees stuff
05:20 PM nuxil: yea. 60$ for lcd with backlight removed
05:21 PM nuxil: just what i need
05:30 PM nohit: https://www.buydisplay.com/
05:33 PM nuxil: hmm. mostly low res screens
05:35 PM nuxil: i need a high dpi. in small format. 2k or better seems to be reccomended for my purpose.
07:37 PM day__ is now known as day
08:05 PM vmt: python is garbage
08:12 PM djph: nuxil: aww
08:15 PM djph: nuxil: the difficulty you're having in finding LCDs for your photo-lithography
08:16 PM djph: or, whatever development process you were talking about
08:16 PM nuxil: alibaba seems to be full of them. but as said. im skeptical to this chinees stuff
08:17 PM djph: mouser/digikey?
08:19 PM nuxil: i looked at digi a bit. cant really find high res screens. seems like mobil screens are the best choice.
08:19 PM nuxil: with a mipi|dsi to hdmi adapter
08:23 PM djph: hmm
08:23 PM djph: I dunno enough about LCDs to help :(
08:24 PM nuxil: i need this https://hackaday.com/2014/08/19/a-mipi-dsi-display-shieldhdmi-adapter/
08:25 PM nuxil: he got a big fat fpga on that thing
08:26 PM djph: yeh
08:26 PM djph: what kind of res do you need, exactly?
08:30 PM nuxil: open for debate. highest possible though. but lets say i want a resolution so i can do trace width of 0.2mm minimum.
08:31 PM nuxil: umm. maybe lower. 0.2 isnt that small
08:31 PM djph: well, lessee, 2.54 mm = 0.100" == 100 DPI
08:31 PM djph: er, 10 DPI
08:31 PM djph: because I can math
08:32 PM djph: 0.254 mm = 0.01" = 100 DPUI
08:32 PM djph: so like 320x240 would be close enough (640x480 or better is better, yeah?)
08:33 PM nuxil: hmm
08:34 PM djph: or am I way off on my math a few drinks in?
08:34 PM day__ is now known as day
08:44 PM nuxil: hmm. can you just say. 0.01" = 100dpi? dosent that also depends on the physical size of the screen, unreaslistical example.. having a 50" at 640x480 would give a real shitty dpi.
08:45 PM nuxil: vs a 5" 640x480
08:47 PM djph: nuxil: good point
08:51 PM nuxil: https://www.calculatorsoup.com/calculators/technology/ppi-calculator.php :D
08:53 PM djph: shutup, you :P I'm getting more booze
08:54 PM nuxil: hehe
09:30 PM nuxil: djph, get some for me aswell :p
09:46 PM nuxil: man i hate inches
09:46 PM PoppaVic: scratch it
09:50 PM nuxil: hmm i wounder how much ppmm (pixel per millimeter) i need for this project. i have some old 24" i did math on, and if its correct it dosent look promesing :p
09:50 PM nuxil: 24" @ 1920x1080
09:51 PM nuxil: diagonal_pixels = sqrt(1920^2 + 1080^2) = 2202.91
09:51 PM nuxil: ppi = diagonal_pixels / diagona_linches
09:51 PM nuxil: ppi = 2202.91 / 24" = 91.79
09:51 PM nuxil: - convert to pixels per cm -
09:51 PM nuxil: ppcm = 91.79 / 2.54 = 36.1377
09:51 PM nuxil: - convert to pixels per mm
09:51 PM nuxil: ppmm = 36.1377 / 10 = 3.6137
09:51 PM nuxil: lol..
09:53 PM nuxil: so if i want "big" trace width of 0.5 i only got 1.8 pixels.
10:01 PM nuxil: measly 13 pixels per mm^2
11:24 PM day__ is now known as day