#avr Logs

May 16 2018

#avr Calendar

12:13 AM day__ is now known as day
12:24 AM polprog: Something around that
12:24 AM polprog: yeah
03:14 AM nuxil: This is by far the simplest rotary encoder i used. https://www.elfa.se/Web/Downloads/_t/ds/MRP%201-20_eng_tds.pdf
03:15 AM Emil: nuxil: hmm I should probably implement a very simple packet handling structure
03:15 AM nuxil: All the other rotary encoders i have used have always given pulses out on both "direction" pins for both cw and ccw rotation.
03:15 AM Emil: to guarantee accurate results
03:15 AM Emil: though would be funny to not do that and see if there are problems
03:15 AM nuxil: this one is verry nice that it only pules on one pin at the time. pin 1 for cw and pin3 for ccw
03:16 AM Emil: oh that's cool
03:16 AM nuxil: yea. but it was kind of expensive :p
03:17 AM Emil: no surprise
03:17 AM nuxil: 60kr for 1 :p
03:17 AM Emil: in euros?
03:17 AM Emil: 6€ / piece?
03:17 AM nuxil: norwegian kr.
03:17 AM Emil: yeah 6€
03:17 AM nuxil: imo 60 for 1 component like this is expensive
03:17 AM Emil: it is
03:18 AM Emil: but that's not the worst price I've seen on fancy rotary encoders
03:20 AM nuxil: so.. are you going try do that mandelbrot with uart ?
03:29 AM Emil: yeah why not
04:44 AM Emil: hmm
04:44 AM Emil: I should also write an interrupt driven eeprom reader/writer
04:45 AM Emil: all of the functions in eeprom.h are blocking spinloops
04:45 AM Haohmaru: internal eeprom?
04:45 AM Emil: yeah
04:45 AM Haohmaru: :/
04:45 AM Haohmaru: i've no idea how
04:45 AM Haohmaru: never considered that
04:46 AM Haohmaru: gud luck
05:18 AM nohitwork: nuxil you can get them for 4.26e if you buy 10
05:18 AM nuxil: lol
05:19 AM * nuxil does not need to stock up on rotory encoders
05:19 AM nuxil: :D
05:22 AM nohitwork: new arduino https://www.arrow.com/en/research-and-events/articles/arduino-mkr-the-new-frontier
05:47 AM * LeoNerd is already reading the megaAVR 0-series manual
05:47 AM LeoNerd: I think this is /basically/ a midrange PIC with an AVR CPU core
05:48 AM LeoNerd: All the peripherals are nothing like the older ATmegas
05:49 AM Haohmaru: LeoNerd wat
05:49 AM Haohmaru: url?
05:53 AM LeoNerd: http://ww1.microchip.com/downloads/en/DeviceDoc/40002015A.pdf
06:02 AM LeoNerd: Oooh, this is exciting. Gone are the INT0/INT1/etc.. pins; instead every single pinchange interrupt pin (i.e. all of the GPIOs) can *individually* (not even per port) be set to various interrupt conditions of edges/levels
06:03 AM Thrashbarg: I can hardly contain my excitement
06:04 AM Haohmaru: many of the things i see in there look like xmega
06:06 AM thardin: can't you do that already? or you mean in addition to getting an interrupt for rising edge on INT0 I can also get on the falling edge?
06:06 AM thardin: to separate ISRs
06:06 AM Haohmaru: timer type A and probably B/C, RSTCTRL, CLKCTRL, PORT
06:07 AM Haohmaru: USART too
06:07 AM Haohmaru: maan, the periphs are from xmega
06:09 AM LeoNerd: Ah righty
06:12 AM LeoNerd: So it's *basically* a new xmega chip then?
06:13 AM Haohmaru: it's not microchip peripherals with AVR core, unless xmega peripherals were made by microchip
06:14 AM Haohmaru: the fractional usart baudrate here is slightly different, a 16bit value alone, while on xmega it's 12bit bsel plus 4bit signed bscale
06:14 AM Haohmaru: but it's still "fractional"
06:16 AM Haohmaru: hm, ports are actually a bit amputated
06:16 AM Haohmaru: only pullup, and no output drive topology configuration thing
06:16 AM Haohmaru: meeeh
06:16 AM LeoNerd: OK; so it's really a cut-down xmega
06:17 AM LeoNerd: And yeah, slew-rate limiting per port only
06:17 AM LeoNerd: Also it isn't clear from the description quite the order that things apply in
06:17 AM Haohmaru: order of what things?
06:17 AM LeoNerd: E.g. if you use falling-edge interrupt and INV, does the inversion apply to the interrupt sense?
06:18 AM nuxil: this CCL seems intresting tho.
06:18 AM LeoNerd: Yah
06:18 AM LeoNerd: The newer 'tiny chips had that too
06:19 AM Haohmaru: it all comes from xmega
06:19 AM nuxil: yea the bigger atinys iirc
06:19 AM Haohmaru: xmega are the interesting chips!
06:19 AM Haohmaru: when will u listen
06:19 AM Haohmaru: imma pull your ears if ya don't listen
06:19 AM LeoNerd: Annoyingly, these new chips use yet another new programming interface.. not the SPI-shaped ISP :(
06:20 AM Haohmaru: yes, not PDI either
06:20 AM LeoNerd: Which kills all my existing ISP programmers :(
06:20 AM Haohmaru: the good part is that, like the PDI - it is *dedicated*
06:20 AM LeoNerd: Including my new good one I've not even finished designing/building yet
06:20 AM Haohmaru: so it doesn't cause inconvenience with SPI or some other periph
06:20 AM LeoNerd: I've never really had that issue
06:21 AM LeoNerd: I find that ISP lives fine with other SPI periphs
06:21 AM LeoNerd: Almost any time I'm using an ATmega, it's talking SPI somewhere, so the SPI port becomes a real SPI port. ISP lives fine withj it
06:22 AM Haohmaru: PDI is nice cuz it's just dedicated and only 2 pins
06:22 AM Haohmaru: UPDI is even more minimal, but why didn't they stick to PDI, why introduce yet another one
06:22 AM Haohmaru: meeeh
06:23 AM Haohmaru: i blame Emil for that
06:23 AM nuxil: so its 1pin programer for this chip ?
06:23 AM Haohmaru: PDI is 2 pins, UPDI is "even smaller"
06:23 AM Haohmaru: so it must be 1 pin
06:23 AM nuxil: aww
06:24 AM Haohmaru: next will be NPDI
06:24 AM Haohmaru: nanoPDI aka nullPDI
06:24 AM nuxil: wifi :)
06:24 AM Haohmaru: no pins
06:24 AM Haohmaru: at least the RSTCTRL is not amputated
06:26 AM Haohmaru: 20MHz top, not 32.. a bit meh too
06:27 AM Haohmaru: btw, there are some small xmegas
06:27 AM Haohmaru: if small is what you need
06:28 AM nuxil: i see avrdude has some support for UPDI
06:29 AM Haohmaru: eh? isn't that up to the programmer?
06:29 AM nuxil: http://savannah.nongnu.org/patch/?9482
06:29 AM Haohmaru: or do you mean avrdude in some bit-banging set up?
06:30 AM nuxil: was reading that
06:35 AM LeoNerd: NPDI - just program the chip using powerline modulation on VCC
06:37 AM nuxil: :)
06:39 AM Haohmaru: pls don't give em ideas
06:39 AM Haohmaru: :~(
06:40 AM nuxil: that sounds like a cool idea :p
06:40 AM Haohmaru: >:(
06:41 AM polprog: program the chip via RFID technology
06:41 AM polprog: proprietiary 400 usd programmer imminent
06:42 AM nuxil: that already possible.. need something really new like LeoNerd suggested :p
06:42 AM polprog: piggyback an eprom
06:43 AM Haohmaru: write protection enable -> UV-protection hoodie on the eprom
06:43 AM Haohmaru: like a thug
06:43 AM polprog: yeah, anti tamper measures built in !
06:49 AM Thrashbarg: when the eprom blows up suddenly the room smells like weed
06:54 AM Haohmaru: thug death
07:24 AM Emil: interesting
07:25 AM Haohmaru: wut's interesting?
07:25 AM Emil: https://emil.fi/d/tietokone.c
07:25 AM Emil: gcc is requiring const
07:26 AM Haohmaru: well of course
07:26 AM Emil: it wasn't before
07:26 AM Emil: https://www.nongnu.org/avr-libc/user-manual/group__avr__pgmspace.html https://www.nongnu.org/avr-libc/user-manual/pgmspace.html
07:27 AM Thrashbarg: what error is it throwing?
07:28 AM Emil: Requiring const
07:29 AM Thrashbarg: perhaps it was recently introduced? Did you do an update recently?
07:29 AM Emil: error: variable ‘data’ must be const in order to be put into read-only section by means of ‘__attribute__((progmem))’
07:30 AM Thrashbarg: what version of avr-gcc are you using?
07:30 AM nuxil: that doc is not updated for some time.
07:30 AM nuxil: const needed in 4.9.2 aswell
07:31 AM Emil: I swear on me mum
07:31 AM Thrashbarg: gcc version 5.4.0 (GCC) <-- fails to compile without const
07:31 AM Emil: it was not required in 4.xx
07:31 AM nuxil: its then it must have been introduced in 4.9.2 because its needed there.
07:31 AM Emil: In april 2016 when I coded
07:31 AM Haohmaru: i use 7.3.0
07:31 AM Emil: and used defaults from repo
07:31 AM * Haohmaru feels so 1337
07:32 AM Emil: Haohmaru: regresssiooons
07:32 AM Haohmaru: le waaaat?
07:32 AM Emil: Ameisen: what were the flags to disable the regressions?
07:33 AM nuxil: Emil, so what the problem really ? just trow a const front of it and be done with it.. also dosent it make sense to have the progmem as a constant ??
07:33 AM Emil: const can also be moved to the beginning
07:33 AM Emil: nuxil: yeahbutjustwonderingwhyitisso
07:33 AM Emil: this is again blind coding :D
07:33 AM nuxil: :)
07:33 AM Emil: I don't have the hardware on me right now to test :D
07:34 AM Emil: but can you tell what that is?
07:34 AM nuxil: no.. as the avr devs.. or dig around in some patch log :p
07:34 AM nuxil: *ask
07:35 AM Emil: No I mean the code I wrote
07:35 AM Emil: can you guess what it does
07:36 AM Haohmaru: does it dump the progmem array onto a port?
07:36 AM LeoNerd: Ooooh... the anacomp has an 8bit DAC to compare with
07:36 AM LeoNerd: Fancy. Shame it isn't exposed as an optional pin
07:37 AM nuxil: idk why it fails.. maybe you need to do const unsigned char d[8192] PROGMEM = {0,0,0,0... } :p
07:37 AM nuxil: not sure why you got that error
07:37 AM nuxil: since you have const there
07:37 AM nuxil: *correction.. -> const unsigned char d[] PROGMEM = {0,0,0,0... } but meh.. it cant be that stupid
07:38 AM Emil: nuxil: no I added the const and it werks
07:38 AM Emil: no issue
07:38 AM Emil: LeoNerd: anacomp?
07:38 AM Emil: Haohmaru: it's an eeprom burner :D
07:39 AM Emil: http://ww1.microchip.com/downloads/en/DeviceDoc/doc0270.pdf
07:39 AM twnqx: progmem can only be const indeed. i guess the compiler/linker refuses to put variable stuff (e.g. not marked const) into a read-only section
07:39 AM twnqx: i had some fun with pointers that way
07:39 AM LeoNerd: Emil: AC, the analog comparator
07:39 AM Emil: LeoNerd: in what part?
07:39 AM Emil: chip
07:39 AM LeoNerd: The megaAVR 0-series.. the new ones
07:39 AM Haohmaru: Emil have you updated the binutils or avrlibc?
07:40 AM LeoNerd: ATmega{32,48}0{8,9}
07:40 AM Emil: LeoNerd: but most are SAR
07:40 AM Haohmaru: cuz this might be related to the ld script sh*tz
07:40 AM Emil: LeoNerd: so they all have the DAC
07:40 AM LeoNerd: As per MCP's new scheme
07:40 AM Emil: Haohmaru: no issue anymore
07:41 AM LeoNerd: Emil: The ADCs are usually delta-sigma. I'm talking about the analog comparator
07:42 AM Emil: Eh?
07:42 AM Emil: Like all are successive approximation
07:43 AM Emil: ah you mean yeah the analog comparator can compare against 256 different values
07:43 AM Emil: cool
07:43 AM LeoNerd: Yus
07:43 AM Emil: >ATMEGA3208 - 8-bit PIC Microcontrollers
07:43 AM Emil: dying inside
07:43 AM Haohmaru: no, it's not a pic
07:44 AM Haohmaru: only the datasheet looks like a PIC datasheet (which is equivalently bad)
07:44 AM Emil: LeoNerd: lulz they only have 256 bytes of eeprom
07:44 AM LeoNerd: From most accounts, it looks like an ATmega/xmega hybrid
07:44 AM Haohmaru: it's a truncated xmega
07:44 AM Haohmaru: running slower and on 5V
07:45 AM Haohmaru: with a vomit-style datasheet
07:45 AM Haohmaru: so it's still better than any pic
07:45 AM Emil: that brings to mind
07:45 AM Emil: I should really try to save the old avr datasheets
07:45 AM LeoNerd: What's wrong with the data sheet? It looks fine to me
07:45 AM Haohmaru: atmel xmega datasheets are better
07:45 AM Haohmaru: atmel atmega datasheets are better
07:46 AM Emil: LeoNerd: the colours' all wrong
07:46 AM LeoNerd: Heh
07:46 AM Emil: but really
07:46 AM Emil: it's harder to read the new datasheets
07:46 AM Haohmaru: there's no chip illustration with the pinout, just that f*cking aweful gray table
07:46 AM Emil: the old atmel version was so much more readable
07:46 AM Haohmaru: i hate it
07:47 AM nuxil: Emil, hmm yes that looks like youre working on mandelbrot.
07:47 AM LeoNerd: UPDI looks interesting; I bet any USB-UART bridge with a resistor/diode 1wire mod would be able to talk it
07:47 AM Haohmaru: at least they haven't added blank pages for "notes"
07:47 AM LeoNerd: They do appear to have actually documented it; unlike previous debugWire
07:48 AM Haohmaru: They - you mean atmel
07:48 AM nuxil: Emil, am i right ?
07:54 AM Emil: nuxil: no
07:54 AM Tom_L: Emil, i've got them all on a cd if you want them sometime
07:54 AM nuxil: fancy light show on port b,c d then ?
07:54 AM Tom_L: back when you could get them that way
07:54 AM Emil: Tom_L: I do!
07:55 AM Tom_L: can't right now but i'll post them on my server
07:55 AM Emil: nice
07:55 AM Emil: nuxil: as it is on my site, it burns 0 through the whole eeprom
07:55 AM Emil: nuxil: but you of course replace the data with actual data
07:56 AM Tom_L: oh wait, it's already there
07:57 AM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/avr/tech-lib/
07:57 AM Tom_L: data sheets and tech notes
07:57 AM Emil: _win_rar
07:58 AM Emil: and if they are 2013 that means they are not _that_ out of date on errata
07:58 AM Tom_L: that was the last before they stopped doing that
07:58 AM Tom_L: anyway, i'm off
07:58 AM nuxil: 6.7 gb techlim. mmm
07:58 AM nuxil: *lib
07:58 AM Emil: Tom_L: downloading
07:58 AM Emil: Tom_L: cya : )
07:59 AM Tom_L: 7016384 k
07:59 AM Tom_L: 7016834*
12:36 PM polprog: Emil: /r/programmingcirclejerk
12:41 PM thardin: good old pcj
12:43 PM polprog: the most annoying thing about imgur is that when you open a direct link to an image in a mobile browser it redirects you to the page where you cant zoom because all the bullshit floating divs get huge as well
12:44 PM polprog: it drives me mad every time, i have to check the computer mode in FF, and then uncheck it because then google thinks im on a computer and keeps nagging me with its new EULA or whatever the hell
12:44 PM thardin: web 2.0 basically
12:45 PM thardin: make the web static again!
12:47 PM Emil: polprog: what about that sub?
12:48 PM polprog: nah, just thought you may like it
12:48 PM Emil: Did I say something pcj worthy? :D
12:48 PM Emil: ah
12:48 PM polprog: <span visibility="hidden">all the time</span>
12:48 PM Emil: >:D
12:48 PM Emil: I take that as a compliment
12:48 PM polprog: :P
12:52 PM thardin: it's jerk or be jerked
12:58 PM polprog: sigh; tar -zxf
01:03 PM pingo: Does anyone know any similar .NET libs that support many protocols to get data from various industrial controllers? I have found this one https://openautomationsoftware.com/products/hmi-scada-for-net/net-iot-data-connector/ https://media-cdn.list.ly/production/434279/2433036/2433036-open-automation-software-oas_600px.png?ver=4735783013
03:02 PM Emil: polprog: just tar xf
03:05 PM polprog: tar xd
03:26 PM Emil: hrrrr
03:26 PM Emil: Shivers
03:26 PM Emil: XD brings back so much cringe
03:27 PM Emil: ÄKS DEE
03:34 PM thardin: :DDD
05:12 PM MrFahrenheit: yanny or laurel?
08:26 PM * nuxil yawns and sips some coffee
08:27 PM nuxil: pingo, better off asking that in C# "Csharp" channel.
08:32 PM nuxil: Emil> nuxil: as it is on my site, it burns 0 through the whole eeprom
08:32 PM nuxil: hu? care to explain that ?
08:33 PM nuxil: to me it looks like you fill a variable stored in flash with zeros. not the eeprom.
10:43 PM * nuxil sips some more coffee
10:43 PM nuxil: to day is our national day.
10:48 PM nuxil: and this year the damn kids will not wake me up, we have a tradition here on this island that the kids who graduate from highschool sits in the crate of a dumper and blows in horns and hits on iron barrels. in essensial makeing alot of noise at 6am wakeing everyone up :p
10:49 PM nuxil: while the trucks/dumpers drives around on the island wakeing up people