#avr Logs

Jul 28 2017

#avr Calendar

12:10 AM day_ is now known as daey
12:30 AM rue_more: I wonder how sas compares to sata
12:30 AM rue_more: I thought they were prettymuch the same now
12:34 AM Casper: imo, the difference is made up
12:34 AM Casper: sas drives are more reliable because the mechanics side is more robust...
12:35 AM Casper: they also talk about a lower error rate on sas, but nothing to back it up, beside that the software on the drive itself have more features enabled
12:37 AM gjm_ is now known as gjm
12:55 AM polprog: Lambda_Aurigae: nah, thinkpad t420, it a bit more portable than a server
12:55 AM polprog: i could use a server though
02:13 AM Emil: I have been thinking about building a nice silent server
02:13 AM Emil: Mostly for file storage
02:14 AM Casper: then don't buy a real server :D
02:15 AM Haohmaru: get an olinuxino ;P~
02:15 AM Haohmaru: one of those which you can slap a harddisk onto
02:19 AM Casper: does anyone have some simple circuit to optimise a NTC thermistor across a temperature range? I need to sense 0-10 °C
03:37 AM Emil: I already have a Dell G5 380
03:37 AM Emil: or what was the name
03:38 AM Emil: it raises the temperature inside my flat by several degrees
03:38 AM Emil: and is loud as fuck
03:38 AM Emil: Casper: optimise?
03:38 AM Casper: yeah, greater resolution
03:38 AM Emil: Ah
03:38 AM Emil: Well
03:39 AM Emil: Get an external adc and an opamp that maximises gain to that area
03:39 AM Emil: And get an opamp that shifts the zero point
03:39 AM Casper: I'ld like to keep it simple
03:40 AM Emil: that is simple
03:40 AM Emil: You need a shift and amplify circuit
03:40 AM Emil: If you are okay with the avr adc
03:40 AM Casper: I guess I should really do the math first
03:40 AM Emil: then a shift and amplify circuit is enougj
03:40 AM Casper: last time... I'm sure I ended up finding the resolution a bit low...
03:42 AM Emil: https://electronics.stackexchange.com/questions/30719/analog-voltage-level-conversion-level-shift
03:44 AM Casper: will check that out... for now, bed time
03:44 AM Casper: 4:13am...
03:44 AM Casper: nite
03:52 AM Emil: :D
03:52 AM Emil: It's 11:21
04:02 AM Haohmaru: Emil, you are correct
04:04 AM Emil: Haohmaru: on what?
04:04 AM Emil: But I mean
04:04 AM Emil: Yes I generally am :D
04:05 AM Haohmaru: >:/
04:06 AM Emil: Now now, that's no way to express your feelings
04:07 AM Emil: But really
04:07 AM Emil: I dont know what you are referring to
04:07 AM Haohmaru: you don't?
04:07 AM Haohmaru: good
04:08 AM * Haohmaru emits information eclipse
04:08 AM Emil: Well
04:09 AM Emil: Thus I can always so I'm correct
04:09 AM Emil: Just tell me :D
04:09 AM Haohmaru: no.
04:09 AM * Haohmaru increases the tension..
04:41 AM Emil: Quality argument :/
06:18 AM Lambda_Aurigae: Emil, HP DL-380...have two of them at work...HP DL-380 G7 actually...
06:19 AM Emil: Gib one to me :3
06:19 AM Emil: Yeah DL-380 G5
06:19 AM Emil: G7
06:19 AM Lambda_Aurigae: this Dell Poweredge T420 is nice and quiet compared to the HP
06:19 AM Emil: I want that
06:19 AM Lambda_Aurigae: a little loud when first starting up but then the fans slow down and it's no louder than my previous desktop.
06:19 AM Lambda_Aurigae: a little larger than my previous desktop but not too much.
06:20 AM Lambda_Aurigae: am using the DL380 boxes at the office...but they are the oldest servers we have in the rack.
06:34 AM Lambda_Aurigae: I was pleasantly surprised at the speed of this t420 server...and how quiet it is overall.
06:34 AM Lambda_Aurigae: runs KSP nicely.
06:34 AM Lambda_Aurigae: at least, once I added the pcie x16 video card.
06:37 AM Tom_L: what card did you use?
06:48 AM noHitW_work: if you gonna do just file storing, isnt raspi enough?
06:48 AM noHitW_work: that's silent
06:49 AM Trieste_ is now known as Trieste
06:58 AM Lambda_Aurigae: Tom_L, a 3 or 4 year old 1GB nvidia card.
06:58 AM Lambda_Aurigae: it's newer than the server.
06:58 AM Emil: noHitW_work: lolno
06:58 AM Emil: >raspi
06:58 AM Emil: >a real servwe
06:58 AM Emil: top kekw
06:59 AM Lambda_Aurigae: runs KSP at fantastic detail level nicely.
06:59 AM Haohmaru: ksp?
06:59 AM Lambda_Aurigae: kerbal space program
07:00 AM Lambda_Aurigae: 3D rocket launching and orbital mechanics simulation game thingie.
07:01 AM Lambda_Aurigae: rue_more, I find that dual channel sas is sweet for lots of file i/o....specially input and output at the same-ish time...
07:01 AM Lambda_Aurigae: 8 channel sas would be nicer but that's waaaay expensive.
07:03 AM Lambda_Aurigae: although new SSDs would probably be just as good if not better.
07:03 AM Lambda_Aurigae: but,,,this was free!
07:29 AM Jartza_ is now known as Jartza
09:19 AM rue_more: indeed
09:30 AM Lambda_Aurigae: however, I see one can get SAS SSDs now too...if one has a few children to sell for medical experiments to pay for them.
09:32 AM Lambda_Aurigae: http://hackaday.com/2017/07/28/north-carolina-hackerspace-destroyed-by-fire-members-vow-to-rebuild/ NOOOOOOOOOOOOOOO!
11:44 AM Emil: Hmm
11:44 AM Emil: What happens if you write a fuse to a reserved value?
11:45 AM Emil: I have been under the impression that nothing changes
11:45 AM Emil: Lambda_Aurigae: you know that place?
11:54 AM NoHitWonder__: i noticed that my i2c driver for stm32f4's relies on the STM32Cube HAL
11:55 AM NoHitWonder__: and i started to change it so it needs only the CMSIS header file
11:56 AM NoHitWonder__: and that gave me the idea that im gonna write my own library
12:00 PM NoHitWonder__: the reason i made the driver in the first place was that cube hal didnt have functions to do combined i2c messages(repeated Start). but it was kinda silly that the driver needs the driver its trying to replace :D
12:00 PM polprog: how can you make an i2c driver without repeated start???
12:00 PM polprog: Emil: https://www.youtube.com/watch?v=JNis__K8uBg
12:01 PM polprog: nearly al of i2c things more advanced than a 2ch ADC use repeated Start
12:02 PM NoHitWonder__: you should ask ST
12:15 PM NoHitWonder__: in i2c libraries there are usually functions like i2c_write_register() which is stupid in my opinion
12:16 PM polprog: i never managed to comfortably use such functions, i guess the lowest level is implementing a whole transaction procedure
12:17 PM LeoNerd: repeated start is prettymuch essential
12:17 PM polprog: because things like i2c_start() would just be additional overhead (unless they are macros)
12:17 PM LeoNerd: Though a lot of I²C slaves will actually be OK without it
12:17 PM polprog: yeah,
12:17 PM LeoNerd: I only noticed because sometimes chips aren't, and then you miss it
12:17 PM NoHitWonder__: i made write, read and write_read functions, that's all you need
12:27 PM NoHitWonder__: hi enh
12:31 PM NoHitWonder__: i2c_write_register() is a crippled version of i2c_write_read() since you cant decide the amount of data you write before reading
12:36 PM NoHitWonder__: not many i2c devices need that tho, usually you just write one byte and then read. but mlx90393 did, that's why i wrote the driver.
12:37 PM LeoNerd: In an I²C library I generally just provide a write_then_read operation, which takes two {string pointer + size_t length} pairs
12:38 PM LeoNerd: If either length is 0, it'll skip that operation
12:38 PM NoHitWonder__: yes
12:38 PM LeoNerd: anything fancier like register operations is generally specific to a particular chip
12:38 PM NoHitWonder__: yes you can do those in the driver of that spesific chip
12:38 PM NoHitWonder__: not in general i2c driver
12:39 PM LeoNerd: Though I might consider adding some simple "8bit register number, 8 or 16 bit value" read/write pairs sometime
12:39 PM LeoNerd: The tree-shaker is good at omitting those if not required
12:39 PM * LeoNerd hugs -ffunction-sections -flot
12:39 PM LeoNerd: -flto
12:40 PM polprog: function-sections? it puts each function into separate section?
12:40 PM LeoNerd: Yes
12:41 PM LeoNerd: Those two flags put every function in its own section and defers all the optimisations to link time. The combination of the two means that functions you don't call never get added to the final hex file
12:41 PM polprog: kewl
12:41 PM LeoNerd: Useful for saving flash. It means you can just provide lots of handy util functions but if nobody calls them they don't cost anything
12:41 PM LeoNerd: -flto in addition is helpful for being able to inline functions into other functions at callsites, even across .c file boundaries
12:42 PM LeoNerd: So it's quite safe now to provide tiny C functions that just read/write bits from some SFR, because they get inline at calltime into probably a single instruction
12:42 PM polprog: TIL
12:43 PM polprog: i never have time to browse all those gcc options
12:43 PM polprog: maybe sometime at work
12:43 PM polprog: :P
12:43 PM LeoNerd: Another thing it's really good at is inlining constants across functions
12:43 PM LeoNerd: So if you have e.g. a setup-style function that has lots of conditions in it, but invoke it only once on startup, passing in constants, then the entire setup code gets folded inline and optimised out. it can be very efficiently done
12:45 PM NoHitWonder__: polprog i opened that link and now its playing Ronald Jenkees - Snap
12:45 PM polprog: summing up that i2c discussion, i thing the best way is to write per-chip handlers and use macros or that -flto for simple stuff like i2c_start or i2c_tx_byte
12:45 PM polprog: NoHitWonder__: what do you mean
12:46 PM NoHitWonder__: i forgot the music, it has played some good tunes
12:46 PM NoHitWonder__: autoplay in youtube
12:46 PM polprog: never heard of Ronald Jenkees
12:46 PM NoHitWonder__: me neither
12:47 PM NoHitWonder__: but this sounds good
12:49 PM NoHitWonder__: kinda trip-hopish
12:50 PM NoHitWonder__: nice pianos
12:50 PM polprog: im listening to Invaders must die album
12:50 PM NoHitWonder__: damn i used to listen that album a lot
12:50 PM NoHitWonder__: i went to see Prodigy when they were in helsinki
12:50 PM NoHitWonder__: 2005
12:51 PM polprog: hmm
12:52 PM polprog: can i connect a regular sata disk to an eSATA port?
12:53 PM LeoNerd: eSATA is just SATA, electrically. It's just a different physical shape to accomodate power + data in one go
12:54 PM polprog: so i need an esata<->sata cable?
12:58 PM Tom_L: there are just too damn many 'ata's around anymore...
12:58 PM bss36504: Anybody have a part # for those through-board female 0.1" spaced connectors? Basically like the traditional female header we all know and love, but SMD and the male pins go through the board the female part is installed in.
01:00 PM polprog: harwin makes those
01:00 PM polprog: or TE connectivity if you want it cheaper
01:00 PM polprog: harwin is for sure in Mouser
01:00 PM bss36504: thanks polprog
01:01 PM bss36504: I found that the appropriate name for these is "dual entry" headers. Think I found some on mouser.
01:03 PM polprog: care to throw a link? i cant think of such a connector... is it like a normal smd pin header?
01:04 PM MrFahrenheit: when I load a file with simavr it says it loaded the .data section, but it's always just a bunch of 0xff bytes, anyone know about this?
01:04 PM polprog: i'd love to actually run something on simavr :P
01:04 PM polprog: despite me trying a couple times
01:05 PM polprog: you load a hex file or compiled one?
01:05 PM MrFahrenheit: the elf
01:06 PM MrFahrenheit: well, I'm gonna compile it and see if I can figure out what's wrong
01:07 PM LeoNerd: Emil: I found some! http://www.gtelec.com/index.php?option=com_virtuemart&view=detailswithsku&virtuemart_product_sku=ATMEGA328PB-AU - shipping from Israel if you wanted
01:09 PM NoHitWonder__: damn i need those too
01:09 PM * LeoNerd has some ;)
01:09 PM LeoNerd: I ordered a bunch as some sellers were running out but others still had
01:09 PM MrFahrenheit: hm, the latest git version has the same issue, I'm gonna sprinkle some printfs in their code, that always helps
01:10 PM LeoNerd: https://www.iodparts.com/part/atmel/atmega328pb-au -- some in New Jersey, too
01:10 PM NoHitWonder__: seems expensive
01:10 PM LeoNerd: Yeah, not cheap. But at this point it's really a sellers' market for 328PBs
01:11 PM LeoNerd: I sent some out for GBP5/chip recently
01:11 PM MrFahrenheit: how many do you need?
01:11 PM NoHitWonder__: http://www.mouser.fi/ProductDetail/Microchip-Technology-Atmel/ATMEGA328PB-AUR/?qs=sGAEpiMZZMvc81WFyF5EdpVB%2fWiMQBO4WCziYJxjeMM%3d
01:11 PM NoHitWonder__: 1,31 eruos
01:11 PM LeoNerd: None in stock
01:11 PM NoHitWonder__: not the (exact) same chip tho
01:12 PM LeoNerd: Yeah it is
01:12 PM LeoNerd: ATmega328PB-AU(R)
01:12 PM polprog: they are 1.10$ in digikey in qfn
01:12 PM polprog: https://elecena.pl/search?q=atmega328pb&from=dropdown
01:12 PM LeoNerd: Don't let the R confuse you - the R or not is just them being in a reel
01:12 PM polprog: nice site, searched world wide vendors as well as polish
01:12 PM LeoNerd: The -AU package is TQFP32
01:13 PM bss36504: polprog: https://gct.co/board-to-board-connector/list?pitch=2.54mm&entrytype=Dual%20entry
01:13 PM NoHitWonder__: oh
01:13 PM polprog: ah those short female pin headers :P
01:14 PM NoHitWonder__: why is the not reel one 1euro more expensive
01:14 PM LeoNerd: Perhaps gotta pay someone to take it out of the reel and put it in a box? I don't know ;)
01:14 PM NoHitWonder__: this http://www.mouser.fi/ProductDetail/Microchip-Technology-Atmel/ATMEGA328PB-AU/?qs=sGAEpiMZZMvc81WFyF5EdrSRAEYMYvHlMc95YQj%2fArE%3d
01:14 PM bss36504: polprog: Well not just short, the holes are on the bottom too. You leave a cutout in your PCB (or holes I suppose) to allow pins to go up through the board also
01:14 PM polprog: TIL
01:15 PM * polprog makes pancakes
01:38 PM Emil: LeoNerd: My 26 shipped from the UK today : )
01:38 PM Emil: Should be delivered on Monday
01:39 PM Emil: But it's fucking hilarious this whole situation:DD
01:39 PM polprog: my lappy shouls be on monday too
01:41 PM LeoNerd: Your 26 ?
01:41 PM LeoNerd: Oh.. 26 chips?
01:41 PM Emil: LeoNerd: you think I'm daft enough to link on IRC about a source for products that's out of stock prettt much everywhere? :D
01:41 PM LeoNerd: Hah.. well quite
01:41 PM Emil: Microshit direct had 228
01:41 PM Emil: I bought 26
01:42 PM bss36504: Emil: Which chip?
01:42 PM Emil: Then linked here and to a few more channels
01:42 PM Emil: A couple of hours later the stock was gonw there, too :D
01:42 PM Emil: bss36504: -MU
01:43 PM Emil: bss36504: ATMEGA328PB-MU
01:43 PM polprog: mouser has 0, wow
01:43 PM Emil: The 105C VQFN one
01:43 PM polprog: mwf i'm using m8 and it's everywhere
01:43 PM Emil: polprog: we went over this convo like 2 weeks ago :D
01:43 PM polprog: i dont recall that :P
01:43 PM Emil: mouser, digikey, arrow, farnell
01:43 PM Emil: Every
01:43 PM Emil: single
01:43 PM Emil: one
01:44 PM Emil: our of stock
01:44 PM Emil: on PBs
01:44 PM polprog: i wonder why
01:44 PM Emil: Someone is making huge purchases
01:44 PM Emil: or they had silicon issues
01:44 PM Emil: I bet on the first one
01:45 PM polprog: Mike mentioned in one of his vids that he once cleared major distributors from SIM card connectors :P i think it was while making his snowflake project
01:45 PM Emil: Yeah and hackday cleared the global stock on some leds for a badge, too
01:45 PM polprog: heh
01:45 PM Emil: But those are different
01:45 PM Emil: They were sold in a single place to begin with
01:46 PM Emil: Here we are talking about an version out of stock
01:46 PM xentrac: maybe Microchip just wants you to switch to PICs
01:46 PM Emil: everywhere :D
01:46 PM Emil: xentrac: Yeah I call dibs on a conspiracy
01:46 PM Emil: It almost made me fall, too
01:47 PM Emil: But it's arms next for me
01:47 PM polprog: if pics wouldnt have that sick paging thing i'd happily try them
01:47 PM xentrac: I don't think you need a conspiracy; one dude at Microchip could have made the call
01:47 PM Emil: I just need to decide on vendor
01:47 PM polprog: Emil: all i wanted, all i needed, is here, in my ARMs :P
01:47 PM xentrac: atmel's very unnecessary; they can only do hARM
01:47 PM Emil: polprog: not sure if just a joke or you actually transitioned
01:47 PM polprog: no, a joke
01:48 PM Emil: :/
01:48 PM polprog: but i will probably try arms,
01:48 PM Emil: xentrac: off with your head
01:48 PM Emil: blasphemy has no place here
01:48 PM Emil: But yeah
01:48 PM xentrac: it's a reference to https://www.youtube.com/watch?v=aGSKrC7dGcY
01:48 PM Emil: Which arm vendor to sell my soul to
01:49 PM * polprog is meanwhile putting together a 4004 board to run gentoo on while secretly compiling fortran on a 3d printed babbage machine
01:49 PM xentrac: have you thought about ICEsticks and the J1A, Emil?
01:50 PM polprog: a guy i who works next desk is messing with arms
01:50 PM Emil: xentrac: matey, I'm not going to fpgas when I need ucs :D
01:50 PM bss36504: Emil: Seems like STM32 is quite hip these days. I've been using Freescale/NXP/Qualcomm/... Kinetis L processors for the class I teach. They're not bad
01:50 PM Emil: bss36504: how's the toolchain?
01:50 PM xentrac: Emil: if you can get FPGAs, why settle for uCs?
01:50 PM polprog: yesterday i had to explain him how &= ~(1 <<n) works cos he has CS background rather than low level
01:51 PM Emil: xentrac: more expensive, more power hungry, IP is a mess
01:51 PM Emil: xentrac: but I wilö try those icesticks
01:51 PM Emil: I should buy one
01:51 PM xentrac: I haven't tried them myself but they have me drooling
01:51 PM xentrac: no IP mess
01:51 PM bss36504: Emil: Eclipse-y, but generally not too terrible, and that's coming from a guy who hates eclipse. I don't fiddle with command line stuff, but It's just ARM GCC and OpenSDA, so I imagine it should work just fine.
01:51 PM polprog: but i can see that in the arm toolset by ST under windows you can click all the config out and it generates the register manipulation code for ya
01:51 PM Emil: polprog: CS backgeound should know
01:51 PM xentrac: polprog: it's a shame C doesn't have an operator for BIC
01:51 PM xentrac: or NIMP or whatever
01:51 PM Emil: polprog: he's just stupid or a good guy
01:52 PM polprog: he sure know more in algorhitm programming than me
01:52 PM Emil: xentrac: BIC?
01:52 PM Emil: NIMP?
01:52 PM xentrac: &=~
01:52 PM polprog: the most advanced algorhitm i ever wrote in C was quicksort-level
01:52 PM Emil: bss36504: hmm
01:53 PM xentrac: some processors have an instruction for &=~ called BIC; it's also negated implication, and it's also known as "abjunction"
01:53 PM Emil: bss36504: what libs do you use?
01:54 PM Emil: Is the code all borked
01:55 PM bss36504: for what? The base libraries provided are not terrible. Quite a bit different from atmels stuff so a bit of a shock if you're transistioning. The main complaint I have about the Kinetis L (and possibly other ARMs from Freescale) is the separation of PORT and GPIO register sets. You set up pin muxing in GPIO regiseters, enable certain stuff, then us
01:55 PM bss36504: e the PORT registers to control other shit. All just to get an IO working
01:55 PM polprog: how many lines of C to light up a led?
01:56 PM bss36504: But fortunately the base libraries from freescale have all the SFR addresses quite nicely laid out, plus there are also structs that help a bit
01:56 PM polprog: with all that IO crossovers and stuff
01:56 PM polprog: muxers etc
01:56 PM bss36504: polprog: idk offhand, One to enable clock and muxing, another to configure the Pin-control reg, another to write to the port-data-out reg
01:56 PM polprog: not as bad as i imagined :D
01:56 PM polprog: enable clock meaning IO clock?
01:57 PM bss36504: No, its really not that bad.
01:57 PM bss36504: yeah
01:57 PM polprog: i had to read a datasheed of some atmel arm
01:57 PM polprog: looks nice
01:57 PM bss36504: my main complaint about some stuff being in PORTx and other stuff in GPIOx is a) hard to write macros that will effectively work to metacode stuff for you, and b) the information is in two chapters in the datasheet
01:57 PM polprog: can you imagine somebody wanted to put it in a tiny con cell powered gizmo?
01:58 PM polprog: coin cell*
01:58 PM bss36504: But, my understanding is you fiddle with one M0+ you've got them all pretty much figured out. Just different wrappers and naming conventions from the MCU vendors
01:58 PM polprog: gotta get one i guess
01:58 PM bss36504: Freescale has some interesting timers and their I2C module is complicated
01:58 PM xentrac: bss36504: the current Arduinos are STM32-based, no?
01:59 PM bss36504: xentrac: No clue, I don't follow arduino
01:59 PM bss36504: I think for the leonardo they used an Atmel SAMD21
01:59 PM bss36504: which is an M0+. That was the first Arduino ARM AFAIK
02:00 PM bss36504: now that "-duino" has become a suffix all on its own, it's hard to keep up with all the official stuff. On top of the confusion, I just dont care lol
02:00 PM polprog: yeah
02:00 PM polprog: anything that uses that HAL is called a *duino
02:00 PM xentrac: yeah
02:01 PM xentrac: it's too bad it's kind of a shitty HAL
02:01 PM polprog: back then it at least used to be pinout compatible
02:01 PM polprog: it's a HAL designed for 8 year old children, what do you expect
02:01 PM xentrac: I mean I'm not down with all the Arduino hate we often see here; I think Arduino is awesome
02:01 PM polprog: lol, the pancake swollen like a li-ion battery
02:01 PM xentrac: haha
02:01 PM polprog: it's not bad but it's not ideal
02:02 PM xentrac: it's ridiculously dynamic
02:02 PM polprog: it's good to learn children about electronics
02:02 PM xentrac: or artists
02:02 PM polprog: yeah
02:02 PM xentrac: I observed a class given by the local university's robotics club to six adult artists
02:02 PM polprog: i guess someday i will be giving classes on EE
02:03 PM xentrac: they gave each student a robot which was an Arduino in a 3-D printed chassis connected to a couple of PWM-controlled motors and some sensors
02:03 PM xentrac: and within four hours the students were running a race between their working line-follower robots
02:03 PM xentrac: at the beginning of the class they didn't know what a variable or a for loop were
02:03 PM xentrac: that was fucking awesome
02:03 PM polprog: lol
02:04 PM polprog: that's the beauty of the system
02:04 PM polprog: anybody can do it
02:04 PM xentrac: yeah! and that's really exciting
02:05 PM xentrac: and there's a huge body of libraries out there for it
02:05 PM xentrac: but it kind of sucks that you have no multithreading and painfully slow digitalWrite and no memory protection and no static analysis
02:05 PM polprog: static analysis?
02:05 PM xentrac: I mean you can't tell ahead of time if someone calls digitalWrite with pin number 69
02:05 PM polprog: ah
02:05 PM polprog: that
02:05 PM xentrac: you don't get an error message
02:06 PM xentrac: and you can only set one pin at a time
02:06 PM bss36504: Well yeah, maybe if they upgraded their "environment"
02:06 PM polprog: do you get that in regular C? i never actually tried PORTx |= (1<<9);
02:06 PM bss36504: I find if you have even the slightest bit of experience with other MCU options, you quickly slam into the glass ceiling presented by -duinos
02:07 PM xentrac: in regular C if you say PORTQ = 37 you get an error that there is no PORTQ
02:07 PM polprog: well, yeah, because it isnt one
02:07 PM xentrac: but yeah PORTB |= 1<<9 just silently fails
02:08 PM polprog: but it's enough to make a line follower
02:08 PM bss36504: The thing is, in arduino land there is no reason they couldnt detect problems with static analysis
02:08 PM bss36504: s/with/using
02:11 PM LeoNerd: I'd imagine with the appropriate warning options you could at least get PORTB |= 1<<9; to warn
02:11 PM xentrac: Maybe; I don't think GCC has those warning options, but it's conceivable?
02:12 PM xentrac: bss36504: Arduino is also enough to script lower-level libraries implemented with interrupt handlers and timers
02:13 PM xentrac: although it doesn't provide any kind of framework for those libraries to allocate non-memory resources to avoid conflicts, either at compile-time or run-time
02:13 PM bss36504: Yeah it's basically scripting.
02:14 PM JanC is now known as Guest48595
02:14 PM bss36504: I just don't like it. I'd rather code it myself or have a nice portable C library, but even those are becoming scarce on the internet
02:14 PM xentrac: yeah, because writing your library for Arduino is a lot easier :)
02:14 PM bss36504: Every mo'fuckin time I look for a library in pure C, all I find is Arduino and MBED nonsense.
02:14 PM xentrac: yup!
02:15 PM bss36504: It's incredibly frustrating.
02:15 PM xentrac: it'd be interesting to have a scripting layer that used an actual interpreter so you could get the error-checking and debugging and code density benefits of bytecode
02:16 PM bss36504: So I end up writing a lot of stuff myself, which also has it's flaws because while i am good at coding, I often overlook some of the nuances of a nice polished lib. Or, i get lazy and don't implement everything at once, and then it just gets messy as I tack on new features
02:16 PM xentrac: yeah
02:16 PM bss36504: Woah, don't get crazy. The arduino folks would have to hire some actual software engineers
02:16 PM xentrac: They wouldn't have to do it; we could do it
02:16 PM bss36504: Instead of just shitting out new hardware all the time
02:16 PM bss36504: I'd rather not :P
02:16 PM xentrac: :P
02:17 PM bss36504: How about they just improve their IDE?
02:17 PM bss36504: That's how many checks are implemented. Look at a Java IDE, they use static code analysis to warn you of things that would be bad to do but arent necessarily compilation errors.
02:18 PM xentrac: does the Arduino IDE have auto-indentation yet?
02:18 PM MrFahrenheit: figured out why simavr was breaking, turns out the mmcu data section must be relocated outside the data section or the whole thing breaks
02:19 PM xentrac: MrFahrenheit: haha, really?
02:19 PM xentrac: that's kind of bogus
02:19 PM xentrac: or error highlighting? it would be great to highlight the line in the source code where the compilation error is
02:19 PM MrFahrenheit: and I found the answer to that on a mailing list
02:19 PM polprog: woohoo
02:19 PM MrFahrenheit: https://groups.google.com/d/msg/simavr/iEDUsoI8cEQ/rq-ksbJTCQAJ
02:19 PM polprog: do you know if that happens when loading a hex file too?
02:21 PM MrFahrenheit: well I assume so, cause it didn't work with a hex file either, let me check now
02:22 PM MrFahrenheit: yeah, it works now
02:23 PM MrFahrenheit: I think they expect you to use their makefile which has that buried in it somewhere https://github.com/buserror/simavr/blob/5868219894fe3fc15cb165608de5a35711064114/Makefile.common#L164
02:28 PM xentrac: oh, that's more reasonable then
02:29 PM xentrac: what are you simulating?
02:31 PM Emil: REGISTER |= (1<<9); is silently optimised swsy
02:31 PM Emil: away*
02:31 PM Emil: Even gcc is not stupid enough to leave it there
02:32 PM Emil: Unless you fuck with the compile flags
02:36 PM MrFahrenheit: xentrac, just messing about, I want to make an ir transmitter that uses interrupts so I didn't feel like debugging that on a real avr
02:37 PM MrFahrenheit: software usb will also be involved, but unfortunately simavr doesn't seem to support that, although it might be able to since it supports hardware usb
02:38 PM polprog: Emil: -O0, the asm output would be interesting
02:38 PM polprog: lemme try that
02:39 PM xentrac: Emil: GCC is smart enough to optimize it; the question is whether we can get GCC to be smart enough to tell you that it's stupid
02:40 PM MrFahrenheit: here's gtkwave with the output of a pulse distance encoded sequence https://i.imgur.com/k0h4frk.png
02:40 PM xentrac: I mean it's totally reasonable to |= something with a quantity that turns out to be 0 (at least to the relevant width)
02:40 PM xentrac: the issue is that in this case that quantity will always be 0 to the relevant width, but only because of the truncation, which is clearly a bug
02:40 PM xentrac: truncation is not always a bug either
03:58 PM Gerritjan: can somebody tell me how the PCA9586 16 x 12 bit pwm is working because i did read the manual of the adafruit and i can connect 5v with 2A on it but the servos uses between 500mA - 900mA so the servos doesnt getting enough ma or am i dooing someting wrong?
04:15 PM Gerritjan: because when i have some servo`s connected it shockes to the default setting but when i add them 1 at a time the servo goes with no problem to the default setting
04:26 PM polprog: Gerritjan: the servo will take as much current as it needs, the PCA chip is rated 2A as you said (i didnt check that) then it means it can give up to 2A
04:27 PM Gerritjan: oke so it will shock to the position alway with this hat?
04:27 PM polprog: but if the servo takes 500mA its ok
04:27 PM polprog: im not sire what you mean by "it shokes to default setting"
04:28 PM polprog: what?
04:28 PM Gerritjan: shockes euhm every sec turn a little bit to the default state
04:30 PM Gerritjan: to 0 degree
04:30 PM Gerritjan: thats what i mean to default state
04:30 PM xentrac: "shockes"?
04:30 PM Gerritjan: yea turn every sec a little bit
04:30 PM xentrac: in English "shock" means something like "surprise" or "do violence to"
04:31 PM xentrac: but it's usually a transitive verb
04:31 PM Gerritjan: how do you call t if its turn a little bit
04:31 PM Gerritjan: sorry for my english :(
04:31 PM xentrac: no worries! learning foreign languages is hard
04:32 PM xentrac: if it were a stepper motor I would say "steps"
04:32 PM xentrac: so maybe just "turns" or "rotates"
04:32 PM xentrac: it rotates to the default setting?
04:32 PM Gerritjan: yes
04:33 PM Gerritjan: but i dont know what im dooing wrong because i did read that its 5v 2A and i have that but it doest run to the 0 degree
04:33 PM polprog: i think you have a regular stepper motor
04:34 PM polprog: and my connecting one servo you just connect two cables right?
04:34 PM polprog: thats why it doesnt go smooth
04:34 PM Gerritjan: 3
04:34 PM Gerritjan: v+ gnd pmw
04:34 PM Gerritjan: mg996r
04:35 PM Gerritjan: and that uses like 500mA - 900mA
04:35 PM Gerritjan: servo
04:35 PM polprog: ok, so its a real servo
04:36 PM Gerritjan: yes
04:36 PM Gerritjan: polprog: and it happens when i turn on the power
04:37 PM polprog: are you using an arduino?
04:37 PM Gerritjan: euhm rpi
04:38 PM LeoNerd: Sudden random thought: arduino boards put a 16MHz xtal on a 328P chip. I just tend to copy that on my 328PB boards. But I notice the 328PB can go up to 20MHz. I wonder if I should put 20 on now...
04:38 PM Gerritjan: c++ or C# uwp
04:38 PM LeoNerd: Can anyone think of any downsides to using a 20, software compatibility aside?
04:38 PM polprog: LeoNerd: more power consumption
04:39 PM polprog: goodnight btw
04:39 PM LeoNerd: Hmm.. more power yes, but at least for a development board that shouldn't be a problem. Maybe for end products though. Hmm
04:44 PM xentrac: LeoNerd: generally the whole atmega88, atmega168, atmega328 line can do 20Mhz
04:44 PM xentrac: MHz
04:44 PM LeoNerd: Sure... it *can*, I'm just wondering if I *should*
04:44 PM xentrac: I don't know why Arduino chose 16MHz, but maybe it was using an AVR that was only rated for 16MHz originally
04:44 PM LeoNerd: Originally the mega8
04:44 PM xentrac: weird
04:44 PM LeoNerd: Which only did 16, so that's why they stop there
04:45 PM xentrac: oh! not the 88?
04:45 PM xentrac: anywya, then they stuck with it to avoid throwing off timing for existing library code
04:45 PM xentrac: afaik
04:45 PM LeoNerd: Yah; I know why /they/ did. I'm just wondering if I should follow suit
04:45 PM xentrac: sorry!
04:46 PM xentrac: aside from library compatibility, the only "should" issues I can think of have to do with EMI design (and ground bounce and whatnot) and power consumption
04:46 PM xentrac: it always seemed kind of dumb to me that they stuck with 16
04:46 PM LeoNerd: I think for a development board power consumption isn't a primary concern
04:47 PM xentrac: Gerritjan: if you're generating PWM in software on a Raspberry Pi, you should probably expect it to not work very well
04:47 PM LeoNerd: Hrm.. though presumably you'd want to test on production frequency anyway. hrm
04:47 PM xentrac: because, I assume, you're doing it under Linux, which is not a real-time operating system, and in any case can be arbitrarily delayed by the GPU firmware accessing memory
04:48 PM xentrac: since the GPU and CPU share access to the same memory, which is not dual-ported IIRC
04:48 PM LeoNerd: Wow.. yah.. RPi is really not a realtime system
04:48 PM Gerritjan: oke so its better to do rpi -> avr/arm -> servo?
04:48 PM xentrac: yeah, probably
04:48 PM xentrac: the rpi is ARM though
04:48 PM xentrac: the issue isn't that it's ARM
04:49 PM Gerritjan: no but i have a stm32F446RE here and some avr boards
04:49 PM xentrac: the issue is that the software you normally run on it isn't capable of predictable timing
04:49 PM xentrac: in part because it's a pretty complicated system-on-a-chip integrating CPU, GPU, and gobs of RAM in one package
04:50 PM Gerritjan: but the 2a is enough for the servo`s
04:50 PM Gerritjan: oke :D i will use a board between it because the rpi gets informatioin from the laptop or phone
04:51 PM pepijndevos: Could you write a program that is able to single-step through AVR code? My understanding is that x86 has a special interrupt for doing that.
04:51 PM xentrac: pepijndevos: Lambda_Aurigae was talking about using a pushbutton and a 556 to do that the other day :)
04:51 PM xentrac: the AVR has some debugging features but they aren't very well documented
04:52 PM xentrac: Gerritjan: yeah, a "5V 2A" power supply is generally a voltage source, not a current source; if a 5V servo is pulling 900mA out of it, that's because that's all it needs
04:53 PM Gerritjan: but got 16 servos
04:53 PM pepijndevos: xentrac, like, not in the datasheet? How can I find out more about this?
04:53 PM xentrac: yeah, the datasheet doesn't document debugWire
04:53 PM xentrac: oh, so you'll probably need a 16A power supply, not a 2A power supply?
04:53 PM xentrac: or like 8 2A supplies
04:54 PM Gerritjan: but can i connect a 120wattt power supply on it will that be enough
04:54 PM xentrac: pepijndevos: on von Neumann machines, a typical trick for single-stepping without hardware support is to overwrite the next instruction with an invalid or otherwise interrupt-generating instruction
04:54 PM xentrac: or even a jump to the debugger
04:54 PM xentrac: but you can't use that trick on a Harvard machine like the AVR
04:55 PM xentrac: Gerritjan: 5V · 900mA = 4.5W; 16 · 4.5W = 72W; so, in theory, sure
04:55 PM pepijndevos: xentrac, so was Lambda_Aurigae using the 556 to toggle the reset pin, or are there some undocumented register to poke?
04:55 PM LeoNerd: That's what debugWire is for :)
04:55 PM xentrac: LeoNerd: is there documentation for debugWire somewhere that I haven't found?
04:55 PM Gerritjan: did not know the formule :S
04:56 PM xentrac: pepijndevos: no, he was using it in single-shot mode to generate the clock
04:56 PM LeoNerd: xentrac: there's the notes that RikusW + I have ;)
04:56 PM xentrac: every time he pressed the button to trigger the 556, it would generate another clock pulse
04:56 PM xentrac: LeoNerd: oooh this sounds interesting!
04:56 PM LeoNerd: It is not fully reverse-engineered or decoded, but parts of it are known
04:57 PM pepijndevos: xentrac, yea, Hardvard machine makes it harder. There is no way to change code, or jump to RAM, is there?
04:57 PM xentrac: you can't jump to RAM, and changing code is doable (clearly!) but not byte-by-byte
04:57 PM xentrac: or word-by-word
04:58 PM pepijndevos: You could just have a set_trace function to inspect things, but from there on you can't really single-step.
04:58 PM xentrac: LeoNerd: all I'm finding is http://pingx.net/freenode/avr/2015/9/15/1
04:59 PM Gerritjan: xentrac: https://www.aliexpress.com/item/DC-DC-ATX-PSU-12V-250W-Pico-ATX-Switch-Pico-PSU-24pin-MINI-ITX-DC-to/32815416032.html?spm=2114.search0104.8.18.bZpxdJ can i use this 1?
04:59 PM xentrac: pepijndevos: there's a whole spectrum of things you can do; MrFahrenheit was talking earlier about getting simavr working
04:59 PM Gerritjan: because the max peak 5v = 10a
04:59 PM LeoNerd: xentrac: Ah I'm not sure we have much stuff accessible online for it
04:59 PM noHitW_work: Gerritjan do you have this board https://www.adafruit.com/product/815
04:59 PM Gerritjan: yes
05:00 PM xentrac: Gerritjan: I can't tell; the description on that item seems self-contradictory, since it says "12V" and also "ATX PC power supply" and also "DC to Car"
05:00 PM xentrac: and the photo looks like it receives power from an ATX PC power supply, not produces it
05:01 PM pepijndevos: xentrac, like, emulate the AVR on the AVR? I was actually thinking a simple interpreter might do the job.
05:01 PM Gerritjan: hmmm oke euhm but for testing a ATX power supply 500W or will it blow up
05:01 PM noHitW_work: yeah i have used that with this car https://www.sunfounder.com/rpi-car.html but i used raspian, so you are using windows10 IOT?
05:01 PM xentrac: pepijndevos: simavr won't run on an AVR, but you can run it under Linux
05:02 PM xentrac: pepijndevos: a difficulty with trying to emulate an AVR on an AVR is that the RAM is much smaller than the program memory
05:02 PM Gerritjan: noHitW_work: yes
05:02 PM Gerritjan: but gooing to use avr i think
05:02 PM xentrac: pepijndevos: also usually when you are using an AVR it is because you care a lot about timing and integration with external peripherals
05:03 PM pepijndevos: xentrac, can the AVR at least read the program memory somehow? Like, copy bytes to ram.
05:03 PM xentrac: LeoNerd: I'd be interested! I have a pile of AVRs from 2006 to experiment on
05:03 PM Emil: polprog: did you try -O0?
05:03 PM xentrac: pepijndevos: yes, that's easy, and there are a bunch of functions in avr-libc that do that
05:03 PM Emil: polprog: it should turn into something like
05:03 PM Gerritjan: noHitW_work: im creating this https://www.aliexpress.com/item/Free-shipping-New-17-DOF-Human-Robot-Aluminium-Robot-kit-contains-17-pieces-of-servos/842557332.html?spm=2114.search0104.3.8.FPHLQ2&ws_ab_test=searchweb0_0,
05:03 PM Gerritjan: searchweb201602_1_10152_10065_10151_10068_10209_10084_10083_10119_10080_10304_10307_10082_10081_10301_10177_10110_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10210_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051,searchweb201603_2,ppcSwitch_5&btsid=0ed24e1a-503f-4ffb-8f00-7909c30e5d64&algo_expid=1faa3b54-3414-4b74-a80b-d0df2f3f75dd-1&algo_pvid=1faa3b54-3414-4b74-
05:03 PM Gerritjan: a80b-d0df2f3f75dd
05:03 PM xentrac: pepijndevos: there's a RDPGM instruction to "read program memory"
05:04 PM pepijndevos: LeoNerd, I'm also interested if you have anything about debug wire.
05:04 PM xentrac: (you can also write program memory but you have to erase it first)
05:04 PM noHitW_work: nice
05:04 PM Emil: load, shift, shift, shift, shift, shift, ..., in, or, out
05:05 PM Gerritjan: but now i need the power
05:05 PM LeoNerd: xentrac, pepijndevos: OK... how would you like it supplied? It's a text file really
05:05 PM noHitW_work: Gerritjan i have an avr board that connects straight to raspi io connector
05:05 PM xentrac: gist.github.com?
05:06 PM pepijndevos: xentrac, I'm thinking you could make a really inefficient AVR interpreter that just reads PC+1 and jumps to a routine that basically executes that op and returns.
05:06 PM Gerritjan: nice but what im thinking now s can a 500 atx power supply handle the pca9586 hat?
05:06 PM Gerritjan: 500W
05:06 PM Gerritjan: ow will the hat blow up
05:07 PM renn0xtk9: folks i a m trying to make a USB device with ATMEGA 328p and V-USB . The schematic here (from V-USB website) should apply to ATMEG 328 p too no ? https://www.obdev.at/Images/vusb/circuit-zoomed.gif
05:07 PM xentrac: the hat will not blow up from a voltage source being connected to it unless the voltage is too high or way too low
05:07 PM LeoNerd: xentrac, pepijndevos: http://paste.debian.net/978698/
05:07 PM xentrac: so it's possible you could use the wrong pin of the power supply
05:07 PM renn0xtk9: (when compile and plug it won't list in lsusb)
05:07 PM xentrac: but otherwise you should be fine
05:07 PM noHitW_work: this http://www.exp-tech.de/gertduino-add-on-board-for-raspberry-pi
05:07 PM xentrac: also some of the pins of an ATX power supply usually can't supply much current, like the 12V lines
05:07 PM xentrac: yay debian.net!
05:08 PM Gerritjan: oke i will use the multimeter first
05:08 PM xentrac: oh wow, this is awesome, LeoNerd!
05:08 PM pepijndevos: LeoNerd, thanks!
05:08 PM LeoNerd: I keep meaning to write up a real program to drive it but so far I've never really found the need, to be honest
05:09 PM xentrac: it might be handy to try to find undocumented instructions :)
05:09 PM LeoNerd: I personally find debugging a lot easier / smoother / better by just serial printing to (V)UART, or wiggling spare IO lines, or whatever
05:09 PM xentrac: or to reverse-engineer existing systems
05:09 PM xentrac: but yeah, printf debugging very often beats using a debugger
05:10 PM xentrac: I constantly berated a coworker who kept saying "debug" when he meant "use a debugger"
05:10 PM xentrac: in retrospect I was probably too impatient about things like that
05:13 PM xentrac: I've hosted the dW document at http://canonical.org/~kragen/debugwire
05:14 PM xentrac: since the debian paste expires tomorrow!
05:14 PM LeoNerd: Yah.. to be honest I could juts have stuck it on my website
05:14 PM LeoNerd: or I think RikusW has it somewhere too
05:14 PM LeoNerd: But more places can't hurt
05:14 PM xentrac: probably a git repository would be best, so that we can make changes and track them
05:15 PM xentrac: but that's a little more work than just scp
05:15 PM xentrac: yeah, http://www.ruemohr.org/docs/debugwire.html might be RikusW's copy
05:15 PM xentrac: but that's lacking the 2012 update
05:15 PM Gerritjan: xentrac: https://www.aliexpress.com/item/Ultrathin-5V-30A-Power-Supply-150w-Led-Driver-5v-150w-Indoor-switch-power-supply-110-220V/32656222394.html?spm=2114.search0104.3.37.Nyaokj&ws_ab_test=searchweb0_0,
05:15 PM Gerritjan: searchweb201602_1_10152_10065_10151_10068_10209_10084_10083_10119_10080_10304_10307_10082_10081_10301_10177_10110_10137_10111_10060_10112_10113_10155_10114_10154_10056_10055_10054_10310_10312_10059_100031_10099_10078_10079_10210_10103_10073_10102_10120_10052_10053_10142_10107_10050_10051-10120,searchweb201603_2,ppcSwitch_5&btsid=f7181641-00ff-43ee-a553-b3f4c4b811ab&algo_expid=05075021-f333-4c73-adcd-d2fc674ba1e2-4&algo_pvid=05075021-f333-
05:15 PM Gerritjan: 4c73-adcd-d2fc674ba1e2
05:16 PM Gerritjan: i think that the good 1
05:17 PM xentrac: Gerritjan: maybe you should use a URL shortener; aliexpress is being unfriendly with link lengths
05:17 PM Gerritjan: oke sorry
05:17 PM xentrac: not your fault really
05:18 PM Gerritjan: but its that a good 1?
05:18 PM xentrac: I don't know
05:18 PM xentrac: because the link broke :)
05:19 PM xentrac: LeoNerd: https://en.wikipedia.org/wiki/DebugWIRE and http://hackaday.com/2016/04/07/reverse-engineering-debugwire/ also have some information
05:19 PM LeoNerd: Mmm
05:19 PM Gerritjan: http://tinyurl.com/ya27lhu8
05:22 PM xentrac: I just added those links to the bottom of http://canonical.org/~kragen/debugwire
05:23 PM LeoNerd: xentrac: the latter has nothing
05:23 PM xentrac: LeoNerd: my page appears empty to you?
05:24 PM xentrac: Gerritjan: the specs on that supply sound good, assuming you have 220 volts AC input
05:24 PM LeoNerd: xentrac: No, I mean the Hackaday page has nothing of interest
05:25 PM xentrac: oh, it has a link to an article about how to use the Dragon and commentary by the author of the Wikipedia page
05:26 PM pepijndevos: Wikipedia actually links to someone who implemented it https://github.com/dcwbrown/dwire-debug
05:26 PM xentrac: yeah
05:28 PM xentrac: that person also commented on the hackaday page, linking their project
05:28 PM xentrac: RikusW also commented there
05:29 PM xentrac: possibly other people will comment there in the future, too
05:54 PM renn0xtk9: Anyone with knowledge with AVR-USB? I was trying to do this example from V-USB but I can't get anything to pop -up in lsusb
05:54 PM renn0xtk9: https://pastebin.com/UqbmF7NQ
07:38 PM enh: hi
07:39 PM enh: my nickname shrunk!
07:39 PM enh: Or I lost some letters of it somewhere. Who knows?
07:47 PM noHitW_work: hi
07:59 PM xentrac: it happens
10:19 PM Tom_shop is now known as Tom_shop3
10:21 PM Tom_shop3 is now known as Tom_shop
11:21 PM JanC_ is now known as JanC