#avr Logs

Jan 14 2018

#avr Calendar

05:55 AM nuxil: lots of microkernels, mmm.
05:58 AM nuxil: OS Redox, why would someone go to the effort of porting a kernel written in C to Rust?
06:30 AM polprog: maybe they believe taht work dignifies
06:34 AM _ami_: its nice that people are sending patches for FASTUSBasp. :)
06:34 AM _ami_: https://github.com/amitesh-singh/FASTUSBasp/pull/3
06:36 AM polprog: i should research alternative ways to program avrs in case my dragon breaks (knock on wood), for example with a BP
06:39 AM nuxil: just make a stk200 :p
06:40 AM polprog: the kind of a programmer you can make stripping a cat 5 cable wires with your teeth and stuffing them into a parport... that's what they will use to program avrs when the world ends !
06:40 AM nuxil: like my variant on my PI works fine, tested with atiny85, atiny13a, atmega324 :p
06:41 AM polprog: hmm, could i avoid getting an stlink? http://www.willdonnelly.net/blog/bus-pirate-serial-wire/
06:43 AM nuxil: hey. as i said. get a pi. and you build the debugging wariant you need. pi got a 40 pin heder you can use.
06:44 AM nuxil: and just ssh into the box and do the stuff :)
06:44 AM polprog: ikr, i have 3 pies
06:45 AM polprog: i might even set up a DHCP server for them on a separate nic in my workshop box (out of space on current ethernet switch and id like to avoid putting the hub bcak in)
06:45 AM nuxil: nice
06:46 AM polprog: so i would have a special Pi comms NIC. or maybe even use the onboard NIC as well to make a virtual switch (i have the similar setup on the VM server, theres one real NIC, a virtual bridge, and virtual NICs plug into the bridge)
06:47 AM polprog: so the VMS get DHCP (if they are set to DHCP) from the shit cable router, but are freely accessible from lan
06:47 AM polprog: there is some port forwarding from the VPN IP so i dont have to connect each VM to the VPN
06:48 AM polprog: http://openocd.org/files/poster.pdf holy crap does that mean i can program MOST mcus from parport?
06:48 AM polprog: i need this lol
06:48 AM polprog: inluding arms and flash devices
06:49 AM nuxil: http://sysprogs.com/VisualKernel/tutorials/raspberry/jtagsetup/ :)
06:50 AM * polprog whips up a small bodged adapter for his GPIO header and smacks a second NIC into his pentium box
06:50 AM polprog: nice
06:50 AM polprog: very nice, thanks very much
06:50 AM nuxil: np
06:53 AM polprog: https://cdn-learn.adafruit.com/downloads/pdf/programming-microcontrollers-using-openocd-on-raspberry-pi.pdf
06:54 AM polprog: looks promising
06:54 AM nuxil: :)
06:55 AM _ami_: meh! newer versions of avrdude has support for programming avrs via SPI interface.
06:55 AM nuxil: i like using the PI as the programmer. just buy a case to it. and drill a squar hole wher the header is. make your own programmer board with a header and stick it in.
06:55 AM nuxil: its small and portable.
06:55 AM polprog: hmm openocd doesnt seem to support avr. (avrdude on a pi does tho). looks like i only have to get a blue pill
06:55 AM nuxil: take it anywhere and have full tool chain with me.
06:56 AM polprog: well i wonder what's more powerful, pentium 4 or a PI
06:56 AM _ami_: https://learn.adafruit.com/program-an-avr-or-arduino-using-raspberry-pi-gpio-pins/configuration
07:05 AM nuxil: polprog, Pentium 4?
07:05 AM nuxil: which one?
07:05 AM nuxil: they came in so many variants
07:06 AM _ami_: p4 won't be power efficient for sure like pi
07:06 AM polprog: id have to check the model, but generally
07:06 AM _ami_: you can run pi all the time without worrying about bills. :)
07:06 AM nuxil: yea
07:06 AM polprog: haha
07:34 AM polymorph: [13:46] <polprog> http://openocd.org/files/poster.pdf holy crap does that mean i can program MOST mcus from parport? - yes lol and i still use parallel port and avrdude to program avrs http://www.nongnu.org/avrdude/
07:47 AM polymorph: [13:54] <polprog> well i wonder what's more powerful, pentium 4 or a PI - P3 was the best cpu, nom it is AMULET since 2001
07:47 AM polymorph: *now
08:27 AM polprog: AMULET?
08:27 AM polprog: hmm sounds interesting
08:28 AM * polprog will read something about it
09:21 AM lemm1ngs is now known as lemmings
09:51 AM polymorph: piece of cake (abs((_line2d_.p2.y-_line2d_.p1.y)*_P_.x-(_line2d_.p2.x-_line2d_.p1.x)*_P_.y+(_line2d_.p2.x*_line2d_.p1.y)-(_line2d_.p2.y*_line2d_.p1.x)))/sqrt(sqr(_line2d_.p2.y-_line2d_.p1.y)+sqr(_line2d_.p2.x-_line2d_.p1.x))
10:08 AM Thrashbarg: polymorph: I ... what?
10:09 AM polprog: polymorph: have you tried https://stackoverflow.com/a/5602143/3908500 ?
10:10 AM Thrashbarg: hehehe
10:11 AM polymorph: polprog: ya tried
10:11 AM polprog: i like pointers to functions
10:11 AM polymorph: selecting the address pointer of the fastest functions at start
10:12 AM polymorph: for example software rasterization
10:13 AM polymorph: polprog: your next project is to load from disk an alternate function and set it as a replacement for another one while running
10:14 AM polymorph: (minix3 can do that)
10:46 AM polymorph: lol, here is how to prove that the people teaching this line Slope (or Gradient) are dumb https://www.mathsisfun.com/algebra/line-equation-2points.html
12:05 PM polymorph: What makes more sense? Milling incrementally with 32 bit coordinates, or absolute with 64 bit coordinates? 64 bit is slower on an 8 bit cpu...
01:24 PM polprog: polymorph: not sure if technically possible on avrs unless reloading in bootloader mode (needs to be flashed, avr is harvard arch, you cant execute from ram)
01:29 PM Emil: polymorph: 64bit absolute
01:29 PM Emil: though
01:29 PM Emil: I don't really see
01:29 PM Emil: how you can exhaust the 32 bit coordinate space
01:34 PM Emil: polprog: also dat stackoverlow
01:34 PM Emil: I love that technique
02:52 PM polprog: This is the kind of technique you use if you wanna quit your job but you still have a month left in contract
02:54 PM Aslak3: Hmm?
02:55 PM polprog: Aslak: https://stackoverflow.com/a/5602143/3908500
03:44 PM polymorph: #define magic volatile static inline __attribute__((always_inline))
03:45 PM polymorph: magic void() :)
03:47 PM polymorph: Emil: i am calculating stuff and figured that i need greater precision to calculate than step to be accurate.
03:48 PM polymorph: Emil: rounding errors will accumulate over time
03:51 PM polymorph: Emil: my goal would be to have the thing go on a route for days then arrive to the starting location with precision
04:01 PM polprog: the proper rounding error handling is to redirect them to your bank account
04:02 PM polprog: just make sure your boss takes your colleagues stapler and read the memo on the TPS reports
06:18 PM Ameisen: trying to figure out, also, the fastest way to get the fractional component of a float if the value is between 0 and 1.25
06:18 PM Ameisen: actually, the value is guaranteed between 0.75 and 1.25
07:40 PM furon: Anyone familiar with the binutils linker scripts?
07:42 PM * Casper pokes the linker scripts with a 50 foot pole...
07:42 PM Casper: not gonna touch that, yet
07:55 PM nuxil: Ameisen, at what bit does the mantissa start? just mask out everything else and you have your fraction.
07:56 PM polymorph: Ameisen: try fixedpoint
07:57 PM polymorph: avr does not have fpu anyway
07:57 PM nuxil: duh. right ^^
08:00 PM furon: If the SRAM of an ATmega32u4 starts at 0x100, why does the linker script say 0x60? Shouldn't that mean the external I/O register are overwritten when the .data section is copied into SRAM?
08:02 PM nuxil: read section SRam Data memory :p
08:02 PM nuxil: for my M324 -> "For the Extended I/O space from 0x60
08:02 PM nuxil: - 0xFF in SRAM, only the ST/STS/STD and LD/LDS/LDD instructions can be used."
08:03 PM furon: Right, but why would the linker put initialized data in the I/O register space?
08:06 PM Ameisen: fixed point is going to be a pain to convert this to
08:08 PM polymorph: Ameisen: if performance and size does not matter then there is frac() and trunc() function
08:13 PM furon: When I dump the headers of my ELF file, I see the VMA for .data is 0x800100. So what changes 0x800060 to 0x800100 during the linking process?
08:15 PM nuxil: wish i could help. but idk.
08:23 PM Tom_L: idk either but the U4 has a bootloader that may affect it somehow
08:24 PM Tom_L: and if you're loading the program using ISP you may well overwrite it
08:29 PM nuxil: i setup my pin40 (adc0) as a analoge input. i set the input to it at 1/2 VCC. now how can i make it trigger on changes then read the value instead of having a isr running all the time.
08:29 PM nuxil: i read that i can set ADCSRA |= (1 ADATE); to enable auto trigger.
08:29 PM nuxil: but that will only trigger on positive edges
08:30 PM nuxil: and i can have negative ones. "going from 2.5 til 1.5"
08:34 PM nuxil: ideas?
08:51 PM nuxil: nm
08:51 PM furon: So I found out what's going on with the linker. GCC passes -Tdata=0x800100 to avr-ld behind the scenes. If you just link using avr-ld, you get a .data section at 0x800060 instead.
11:42 PM day__ is now known as day