#avr Logs

Jan 04 2018

#avr Calendar

01:07 AM _ami_: interesting: https://www.marketwatch.com/story/intel-ceo-sold-millions-in-stock-after-company-was-informed-of-vulnerability-before-disclosure-2018-01-03 :)
01:20 AM Casper: I wonder if that ceo will be acused of fraud
01:20 AM Casper: he used inside information....
01:21 AM Casper: which is normally not allowed
04:17 AM skz81: Hello peoplezz !! Glad to see you after such a long time. And happy new year !
04:28 AM _ami_: Casper, its a high possibility
04:28 AM _ami_: skz81, hey man. long time, no see.
04:44 AM anonnumberanon: in asm i want to use a counter that is 16 bit and decrement it, i only know -dec- which is used for an 8-bit register, what to do?
04:45 AM Thrashbarg: sbiw r,1
04:50 AM anonnumberanon: thanks Thrashbarg will this fire the Zero flag for later use with a branch instruction like BRNE?
04:50 AM Thrashbarg: I don't think so
04:51 AM Thrashbarg: no wait it does
06:23 AM nuxil: huh,, dec/inc only works on 8 bit registers?
06:24 AM nuxil: have you tried using it on 16bit register "r26"
06:37 AM nuxil: anonnumberanon, Get hold of the "AtmelInstructions" pdf file if you dont have it, its verry handy when doing asm. it describes each instructions is details.
06:37 AM nuxil: its also full of small example simpets.
06:39 AM polprog: i think theres instruction set pdf on my papers mirror
06:40 AM nuxil: mornings polprog.
06:40 AM nuxil: how you doing.
06:40 AM polprog: thats tge instruction set manual: http://polprog.net/papiery/avr/
06:40 AM polprog: good
06:40 AM polprog: interesting day
06:40 AM polprog: field trip to a pcb factory
06:40 AM polprog: :)
06:40 AM nuxil: cool :)
06:41 AM nuxil: did you take any pictures while there ? :p
06:42 AM polprog: nope
06:42 AM polprog: cant
06:43 AM nuxil: heh. ok.
06:43 AM polprog: shame
06:44 AM polprog: yeah
06:44 AM nuxil: is it the same factory as you ordered your pcb's from ?
06:44 AM polprog: no, a different one
06:53 AM Ashleeee is now known as Ashlee
06:53 AM Ashlee is now known as Ashleee
06:55 AM nuxil: i want to make my own pcb's
06:56 AM polprog: download kicad, learn it, watch some general pcb design tutorials, make pcbs
06:56 AM polprog: :P
06:57 AM nuxil: i made my own pcb's before. but thats like 15years ago :p
06:59 AM polprog: haha
06:59 AM nuxil: i see people use this natriumsuflate stuff these days. back in the days we used ferric-chloride. and that shit is hard to get.. need to import it.
06:59 AM polprog: i use natrium sulphate
06:59 AM polprog: but i need to check phototransfer,
06:59 AM polprog: my toner transfer fails all the time
07:00 AM polprog: its too much hassle
07:00 AM polprog: id rather print the negative on tracing paper and get a uv lightbox
07:00 AM polprog: or even put them outside in sunlight
07:01 AM nuxil: you should reprint the layout 2-3 times on same transparant paper
07:01 AM polprog: i know
07:01 AM polprog: disable eco option crap as well
07:02 AM nuxil: <polprog> id rather print the negative on tracing paper and get a uv lightbox
07:02 AM nuxil: im a bit outdated on this process. but thats how we used to do it before.
07:02 AM nuxil: are there new methods used now ?
07:02 AM polprog: i never can get toner transfer right
07:03 AM polprog: methods used now is send them to oshpark so they are clean and tidy
07:03 AM nuxil: lol
07:03 AM polprog: but i dont feel like waiting, even a week (local fab i use)
07:03 AM polprog: sometimes i want a proto/breakout thats one sided and i need it fast
07:04 AM polprog: i have some regular one sided copper clad, im thinking about getting a spraycan of uv laquer
07:05 AM polprog: (i also have NV goggles so i can do it in dark in my bathroom lol)
07:05 AM nuxil: https://www.ebay.co.uk/itm/50pcs-F5-5mm-Round-Ultra-Violet-LED-UV-Light-390-395nm-Purple-Lamp/191752521080?epid=567451626&hash=item2ca5574578:g:KeEAAOSwAKxWYQ6j
07:05 AM nuxil: 50 uv leds for like 1 pound :p
07:06 AM nuxil: hmm. maybe i should make myself a uv box :p
07:07 AM nuxil: not sure if 390-395 nm wave length is anyusefull tho.
07:07 AM polprog: was thinking about repurposing a scanner (i have a thick old one), by retrofitting a UV tube or getting one of those uv boxes for pedicure
07:07 AM polprog: manicure*
07:07 AM polprog: yeah id have to check with the laquer datasheet
07:08 AM nuxil: I dont remember if it was type uv A,B or C that was best.
07:09 AM nuxil: need to google that shit up-.
07:09 AM polprog: shorter wavelenghts were better iirc
07:09 AM polprog: but im no expert
07:09 AM polprog: damn my phone is dying
07:10 AM polprog: gotta go
07:10 AM nuxil: dont make it suffer. get tha axe and do a quick end of its suffering :p
07:10 AM polprog: im thinking about it
07:11 AM polprog: i mean getting new phone
07:11 AM polprog: this will be kept as backup
07:11 AM polprog: nee battery broke the flatflex cable it was on, i put the old battery back a month ago, this old one cuts sim at 30%
07:12 AM nuxil: i dropped my samsung phone in the concreet floot and broke the display. so now i have a old shitty HTC im using.
07:12 AM nuxil: and these new phones are like insanly expensive. on the price of a PC.
07:13 AM polprog: i either get a new battery (las one i bough has bulged while at work and i had to urgently fin a torx driver to remove it
07:13 AM polprog: they dont make new ones for this phone (nexus 4)
07:13 AM nuxil: hell i can get a desent PC for arounf 7000 N.Kr and these new iphones and samsungs costs like 8000-10000K N.kr.
07:13 AM polprog: im thinking about getting a nexus 6p (no simlock)
07:14 AM polprog: gtg
07:14 AM nuxil: cya
07:24 AM nuxil: omfg. part i ordered from elfa came today. everything in there except my 5 opamps ic's. i go and check what this. and seems like they got out of stock before my order was prosessed.
07:25 AM nuxil: and they will not be in stock for 3 weeks. so that means my DDS project is delayed more 3weeks :\
07:26 AM nuxil: oh well this gives me about 3 weeks to code a menu for it :p
07:26 AM nuxil: *display menu
08:08 AM MrFahrenheit: nuxil, I ordered some dds generators 2 months ago, so yeah
08:09 AM MrFahrenheit: AD9851
09:00 AM Guest57544 is now known as A001
09:02 AM nuxil: MrFahrenheit, hu? still havent arrived ?
09:02 AM * nuxil been cleaning his lab!
09:08 AM nuxil: MrFahrenheit, btw, im not using a dedicated dac chip. im using a atmega with a r2r network as a dac.
09:18 AM MrFahrenheit: that works if you have a fixed frequency, I found that generators that do that tend to experience distortion at random frequencies
09:20 AM MrFahrenheit: for high frequency outputs anyway
09:29 AM nuxil: well im not sure how it suppose to distort?
09:29 AM nuxil: the resistors i picked are like 99.99% matching in my r2r network.
09:30 AM MrFahrenheit: well this generator I have generates a perfect 16MHz wave, but a really dirty 17MHz one
09:30 AM nuxil: i got a crystal that can be set at 20Mhz. my atmega324p-20u supports it. i got a 24bit phase accumulator.
09:31 AM LeoNerd: That's DDS for you :)
09:31 AM nuxil: the inline asm code does 10loops. so the formular to calc resolution is simple. #define RESOLUTION F_CPU / CYCLES_PER_LOOP /‭ 2^24
09:31 AM nuxil: so for 1khz i do. Accumulator = 1000 / resolution and feed that to the asm loop.
09:32 AM MrFahrenheit: the AD9851 works up to 180MHz
09:32 AM LeoNerd: For square wave generation at >1MHz, I'd suggest an Si5351
09:32 AM nuxil: i have no need to go so highh.
09:32 AM MrFahrenheit: no, the clock goes up to 180MHz, you really don't want to use it for more than ~50MHzish
09:33 AM nuxil: i still have no need for 50Mhz :p
09:34 AM MrFahrenheit: well I was planing on getting 40 out of it
09:34 AM nuxil: my scope can only go 20mhz :p
09:34 AM MrFahrenheit: what were you aiming for
09:34 AM Emil: LeoNerd: how strong is the drive?
09:34 AM nuxil: MrFahrenheit, around 60k hz is good enuf for me.
09:35 AM LeoNerd: Emil: Dunno.. I'd suggest "not a lot" - logic-level. Fine for driving clocks in digital logic
09:35 AM MrFahrenheit: nuxil, ah, well that'll work no problem then
09:35 AM Emil: That's some 333 steps per cycle
09:36 AM nuxil: ofc there will be some noise.
09:36 AM Emil: cycles per cycle
09:36 AM nuxil: opamps have internal noise they generate.
09:36 AM Emil: but you have to change it
09:36 AM Emil: so I'd say more ike 30 steps per cycle
09:37 AM Emil: hmm
09:37 AM Emil: yeah
09:37 AM Emil: Around that
12:17 PM pepijndevos: All Atmel datasheets seem to return an error. Does anyone know what's up?
12:18 PM Emil: pepijndevos: microshit probably fucking around
12:20 PM pepijndevos: Hm, if you go via the Microchip site and search for them there, they work. So they just broke all the links.
12:25 PM nohit_: the original avr datasheets are now lost
12:26 PM nohit_: execept the ones people have downloaded
01:57 PM MrFahrenheit: intel seems to claim they have a fix for both bugs and are rolling out updates
02:03 PM Aslak3: CERT claims you need to throw away your CPU. I tend to believe CERT more then intel
02:06 PM Aslak3: In summary: fast CPUs can only be implemented by including hacks which jeapodise the system integrity
02:07 PM kl0wn: not sure everyone can afford to throw away their cpu
02:22 PM HighInBC: the fix reduces effective cpu speed dramatically
02:22 PM HighInBC: I think intel owes me money
02:23 PM learath: it depends heavily on workload
02:31 PM andre_ is now known as Guest61158
02:36 PM Tom_L: what chips are affected?
02:40 PM cehteh: almost all
02:41 PM cehteh: there are 2 papers with different attacks, one only prooven to affect intel, the other intel, amd and arm
02:42 PM cehteh: i'd expect similar attacks affecting all other cpu's which do out of order processing to appear soon :D
02:55 PM Guest61158 is now known as AndrevS
03:38 PM jragon is now known as Jippo
04:06 PM Aslak3: does avr have branch prediction? i assume its not vulerable to any of this
04:06 PM LoRez: it doesn't run other people's code, you're always root
04:26 PM Emil: Aslak3: LULZ
04:26 PM Aslak3: ;)
04:31 PM nuxil: what if you run linux on a avr ? :p
04:35 PM cehteh: Aslak3: avr's are in-order one instruction staged
04:35 PM Aslak3: excellent
04:36 PM Aslak3: no cache so no need for speculative execution
04:42 PM AndrevS: linux on avr? Well... you'll need avr32 for that. But the AP7000 series has been stopped and Linux dropped support a few versions ago.
04:43 PM AndrevS: I've a grasshopper board laying around somewhere
04:45 PM cehteh: AndrevS: there was this linux on atmega thing .. with arm emulator :D
04:45 PM cehteh: i wonder if the emulator has similar bugs, prolly not, but for sure it has plenty other loopholes and being that slow makes it unattractive for hacking anyway
04:45 PM AndrevS: Ah yeah... I remember that... it connected a 30 pin memory module, right?
04:46 PM cehteh: yes
04:47 PM AndrevS: But I'd say emulation doesn't really count. I mean, any turing complete machine can emulate any turing complete machine.
04:48 PM * dev1990 https://lwn.net/SubscriberLink/742702/e23889188fce9f7f/ nice lecture
07:47 PM enh: Hi
07:47 PM enh: Good night
08:04 PM Emil: Good night
08:09 PM enh: Lambda_aurigae did not return yet?
08:12 PM anonnumberanon: <nuxil> huh,, dec/inc only works on 8 bit registers?
08:12 PM anonnumberanon: <nuxil> have you tried using it on 16bit register "r26"
08:12 PM anonnumberanon: no haven't tried, will try now
08:12 PM anonnumberanon: not sure yet how i can figure out a test
08:13 PM anonnumberanon: i thought r26 was a byte
08:18 PM anonnumberanon: yeah thanks for the link polprog
08:18 PM anonnumberanon: hopefully its better than atmel/microship's website
08:23 PM nuxil: let me know if it works. im curiouse p
08:25 PM anonnumberanon: polprog, no info on decrementing a 16-bit on the instuctions pdf
08:25 PM anonnumberanon: like on the website
08:25 PM anonnumberanon: yeah nuxil ill devise a plan, maybe add a watch for r26 and decrement it and see what happens in atmel studio
08:31 PM anonnumberanon: nuxil,
08:31 PM anonnumberanon: ldi r26, 2500
08:31 PM anonnumberanon: Operand(s) out of range in 'ldi r26,0x9c4'
08:43 PM nuxil: what chip are you using ?
08:46 PM anonnumberanon: atmega328p
08:47 PM nuxil: does datasheet says its a general purpose 16bit register ?
08:48 PM nuxil: maytbe you need to do high and lowbyte thingy, idk. im noob at asm :p
09:08 PM anonnumberanon: yeah but that could be too much work when there is an easier way, don't know yet
09:09 PM anonnumberanon: doing that adds 2 or 3 instructions to my program and that would blow my requirements
09:47 PM nuxil: why do you need 16bit ?
09:49 PM nuxil: ADIW?
09:50 PM nuxil: adiw zl,1
09:52 PM nuxil: anonnumberanon, http://www.avrfreaks.net/comment/400001#comment-400001 check that out. :)
09:56 PM anonnumberanon: oh that's right i was gonna check out sbiw
09:58 PM anonnumberanon: need 16 bit cause my counter can take a value of 2000 so 8 bit won't cover that of course
09:58 PM nuxil: ic.
10:00 PM nuxil: https://gyazo.com/661fee1c96585df49be523ec3c48b76d
10:00 PM nuxil: project starting to take shape :p
10:02 PM nuxil: its my raspberry PI on top of my DDS box. im just using it to program the chip. dont want to take it in/out each time i want to test new update on code :p
10:03 PM nuxil: my camera is shit btw, so not best quality on pic :\
10:03 PM _ami_: nuxil, cool.
10:04 PM _ami_: you could use a esp8266 to program it over wifi. ;)
10:04 PM nuxil: haha :p
10:04 PM nuxil: that be something :=
10:04 PM nuxil: )
10:04 PM _ami_: i think there is already a project somewhere which does that.
10:05 PM nuxil: i bet.
10:06 PM _ami_: http://www.instructables.com/id/Wireless-AVR-Programmer-WiFi/
10:07 PM nuxil: hmm. hmm, dont give me crazy ideas now :p
10:07 PM _ami_: https://github.com/esp8266/Arduino/tree/master/libraries/ESP8266AVRISP
10:07 PM _ami_: well, it seems pretty easy to setup :)
10:08 PM nuxil: yea
10:09 PM _ami_: all my point is, u could use a 2$ wifi device to program avr instead of 40$ raspi ;)
10:09 PM nuxil: make my keypad wifi :p so i can setup freq, signaltype. p/p value, etc on a webserver :p
10:09 PM _ami_: let raspi do some other nice things :d
10:10 PM nuxil: isnt programming avr's a nice thing :p
10:12 PM nuxil: its already wifi in a way. i ssh into my raspberry and do programming.
10:12 PM nuxil: you cant see the Wi-Pi dongle on my pic since its on the back side :p
10:14 PM _ami_: With some python or shell script magic, you could automate the flash process.
10:15 PM _ami_: make flashtorpi -> copy the binary from your pc to rpi and then program avr
10:15 PM _ami_: you could autoamte this
10:15 PM nuxil: make clean && make && sudo make install :p
10:15 PM nuxil: dont need no python scipt :p
10:15 PM anonnumberanon: what else can i use than registers for storing values?
10:16 PM _ami_: no no, you did not get my poiny.
10:16 PM _ami_: instead of writing code on your rpi via ssh, you could just program and compile the code at your PC
10:16 PM _ami_: and use rpi just to program avr remotely.
10:17 PM nuxil: im not writing the code on my PI via ssh. it has SMB setup, so i just use notepad++ :p
10:17 PM nuxil: i only need to ssh in to make the install.
10:17 PM _ami_: hmm.
10:19 PM nuxil: but yea i get you point.
10:19 PM nuxil: but i have no avr tool installed on this pc. not sure if i want to install some either.
10:20 PM nuxil: anonnumberanon, the flash?
10:20 PM anonnumberanon: ok
10:21 PM _ami_: anonnumberanon, doing asm?
10:21 PM _ami_: u could use stack as well.
10:21 PM _ami_: or data/bss sectio
10:21 PM _ami_: section
10:22 PM nuxil: anonnumberanon, are you writing pure asm or C inline asm ?
10:23 PM anonnumberanon: nuxil, yes it will be inline because i have a lot of C stuff that does not need to be in asm
10:24 PM anonnumberanon: i need 68 values to store before i do the asm code and accessible with asm for speed
10:24 PM anonnumberanon: in the least amount of cycles possible
10:30 PM anonnumberanon: 19 cycles so far on a target of 16... :(
10:31 PM _ami_: wow, 19 cycles
10:32 PM _ami_: Just to learn ASM better, i plan to implement a software i2c slave implementation on attiny13a
10:33 PM anonnumberanon: i could overclock the chip a bit and get 24 cycles target so my code would fit, but wanna see if I can't do it in 16 first..
10:35 PM nuxil: i have and idea. https://pastebin.com/eEKzsMXF
10:35 PM nuxil: thats presudo code
10:36 PM nuxil: andin there you can just inc r18, 1
10:36 PM nuxil: before add
10:37 PM anonnumberanon: for me nuxil ?
10:37 PM nuxil: yes
10:37 PM anonnumberanon: but there are only 32 registers and i need 68 values
10:38 PM nuxil: lpm then. and store some on the flash using progmem. idk.
10:42 PM nuxil: https://scienceprog.com/avr-dds-signal-generator-v20/ check this out. it the same project im doing but with my own tiwst
10:42 PM nuxil: check out the asm code
10:42 PM nuxil: and the signal tables how they are stored.
10:43 PM nuxil: +the make file :p which spesify the section the tables are stored. using progmem it becomes a "bit random".
10:47 PM Thrashbarg: was fiddling around with a sort of Direct Analog Synthesis method a while back... https://photos.app.goo.gl/vL6U2QQCklYP12i63
10:47 PM Thrashbarg: one op-amp and a heap of capacitors to store voltages
10:48 PM nuxil: cool :=
10:48 PM nuxil: :)
10:48 PM Thrashbarg: lol
10:56 PM Thrashbarg: I wanted to prove a point to myself. The method itself combines the slowness of digital circuitry with the lack of precision of analog circuitry
11:06 PM anonnumberanon: lpm is a lot of cycles is there better?
11:07 PM anonnumberanon: when i do the_int = 3; in C what storage is that stored in?
11:07 PM nuxil: lpm is 3 cycles
11:08 PM anonnumberanon: i knoe
11:08 PM anonnumberanon: and i need to fetch 3 values so that's 9 cycles, more than half of my available cycles
11:08 PM Thrashbarg: use RAM
11:08 PM Thrashbarg: ?
11:08 PM anonnumberanon: how
11:09 PM Thrashbarg: ah you're using inline assembler....
11:09 PM Thrashbarg: hrm
11:12 PM nuxil: elpm?
11:13 PM nuxil: RAMPX, RAMPY, RAMPZ
11:14 PM Thrashbarg: need to get a spare bit of RAM to play with and have the compiler point to it or something
11:14 PM Thrashbarg: can you can tell I've not done this before?
11:15 PM nuxil: i havent :p
11:15 PM nuxil: so i cant :p
11:15 PM nuxil: lol
11:17 PM anonnumberanon: so 9 cycles to bring in 3 bytes
11:17 PM anonnumberanon: need 4 to 5 cycles instead
11:17 PM anonnumberanon: huuu,mmmmm';l
11:18 PM anonnumberanon: 4
11:21 PM Thrashbarg: anonnumberanon: perhaps make an array in the function 68 entries long, and load the address of the array to a register pair?
11:21 PM Thrashbarg: https://arduino.stackexchange.com/questions/9490/storing-in-a-global-variable-using-inline-assembly
11:21 PM anonnumberanon: lets see :)
11:36 PM anonnumberanon: increment address, load the value pointed to into port, send port <-- do these three times == 9 cycles, still too slow
11:41 PM anonnumberanon: maybe i was wrong on right above
11:46 PM day__ is now known as day
11:50 PM nuxil: how about using a 16bit timer ?
11:51 PM nuxil: something like https://pastebin.com/tSKtFn2g
11:54 PM anonnumberanon: nah interrupts are very cycle-consuming
11:54 PM anonnumberanon: i triefd already