#avr Logs

Aug 20 2017

#avr Calendar

12:25 AM day_ is now known as daey
12:49 AM HighInBC: freakin lasers
01:28 AM dgriffi2: frikkin sharks
01:29 AM Casper: give sharks laser, then make a movie
04:32 AM renn0xtk9: anybody with experience in i2c communicatoins? i got problem making a slave with atmega 328P
05:07 AM renn0xtk9: it is not entering the twint ISR :S
05:09 AM polprog: did you set all the registers you need?
05:10 AM polprog: or are you sure that it's not the master's dault
05:10 AM polprog: fault*
05:11 AM renn0xtk9: I think register should be good that are my init function https://pastebin.com/ibbRGZCP
05:13 AM renn0xtk9: on master side, when I send with this function, it https://pastebin.com/WcK8ZQDg and in my understanding it should trigger ISR on the slave isde
06:11 AM Emil: renn0xtk9: just addr<<1; does absolutely nothing
06:11 AM Emil: renn0xtk9: comeone
06:11 AM Emil: renn0xtk9: you need to assign
06:12 AM Emil: renn0xtk9: either addr<<=1; or addr=addr<<1;
07:10 AM polprog: gas iron's acting up again
07:11 AM Emil: Casper: actually no
07:11 AM Emil: Casper: pupil dilation only increases chances of hitting the eye
07:11 AM Emil: Casper: but the beam still requires enough energy
07:12 AM Emil: Casper: per area
07:12 AM Emil: intensity*
09:55 AM day_ is now known as daey
11:20 AM enh: anybody here?
11:38 AM LeoNerd: Probably
11:47 AM martinux is now known as martinus
12:00 PM lemm|ngs is now known as lemmings
01:06 PM Emil: enh: nah
01:06 PM Emil: enh: we are never here
01:06 PM Emil: enh: also pls
01:06 PM Emil: enh: use a server :D
01:21 PM Emil: http://make.girls.moe/#/
01:21 PM Emil: Have you seen this :D
01:37 PM renn0xtk9: I make an I2c slave with an atmega
01:37 PM renn0xtk9: it respond to general call (on address 0
01:37 PM Emil: renn0xtk9: nice :)(
01:37 PM Emil: :)*
01:37 PM renn0xtk9: but no to its own address ..
01:37 PM renn0xtk9: weird
01:41 PM renn0xtk9: if a function accept uint8_t as argument and I pass "0x02" is there a chance that the argument is overflowing (because eventhough it does not, 2 digit hexadecimal theoretically could ) ?
01:49 PM Emil: renn0xtk9: i2c addresses are 7 bit
01:49 PM Emil: msb first
01:50 PM Emil: But after that
01:50 PM Emil: comes one bit
01:50 PM Emil: which significates read or write
01:51 PM Emil: So your device needs to handle both read and write
01:51 PM Emil: Now iirc on the hardware side the address is not shifted automatically so what you give the device as slave address is the original 7 bit address
01:51 PM Emil: If you are doing it with hardware
01:52 PM renn0xtk9: yes basically what is happening is that when its own address is called it is not acknoledging by holding the scl down as it should (and does when address=0x0)
01:53 PM Emil: Did you configure it to do ack?
01:53 PM renn0xtk9: I do it with hardware like with that function https://pastebin.com/u16R1brw
01:54 PM renn0xtk9: the address argument here is 0x02 and it get shifted before being saved in TWAR
01:54 PM Emil: Iirc don't
01:54 PM Emil: You give it the unshifted one
01:55 PM renn0xtk9: TWEA is set to 1 so it should acknowledge from what i understand from the datsheet
01:55 PM Emil: Do not shift
01:56 PM Emil: Oh
01:56 PM Emil: sorry
01:56 PM Emil: yes
01:56 PM Emil: shift
01:56 PM * Lambda_Aurigae implements TwWI
01:56 PM Lambda_Aurigae: Twelve Wire Interconnect
01:57 PM renn0xtk9: ^^ already got problems with 2 ^^
01:57 PM Lambda_Aurigae: or TeWI
01:57 PM Lambda_Aurigae: Ten Wire Interface.
01:57 PM Lambda_Aurigae: as I have some 2x5 headers already.
01:57 PM Emil: Three Wire Interface
01:58 PM Lambda_Aurigae: that's SPI
01:58 PM polprog: one wire interface.. oh, wait
01:58 PM Lambda_Aurigae: 1-wire exists.
01:58 PM Emil: Tone wire interface
01:58 PM Emil: Lambda_Aurigae: it's not 1 wire
01:58 PM Emil: Hurrru
01:58 PM Lambda_Aurigae: not really..still requires 2.
01:58 PM Emil: Duurrr
01:58 PM Emil: :D
01:58 PM Emil: But
01:58 PM Lambda_Aurigae: and twi requires three
01:58 PM Lambda_Aurigae: spi requires 4
01:58 PM renn0xtk9: is there any trick I can make a kind of waiting function without using delay ? I want to bomb the slave with all possible address to see if it get at least one. Issue is on the master I have the V-usb library and if i use delay between two i2c shoot the timer of V-usb enter in action and reset the whole thing...
01:58 PM Lambda_Aurigae: if you include ground.
01:58 PM Emil: Plus all the cs ad shite
01:59 PM polprog: differetnial signals need only 2 :D
01:59 PM LeoNerd: Lambda_Aurigae: DDWI; Duodecimal Wire Interconnect. :)
01:59 PM Emil: polprog: and extrapolating
01:59 PM Emil: polprog: you _can_ make a real 1-wire interface
01:59 PM polprog: it's called iButton
01:59 PM Lambda_Aurigae: 0-wire interface!
01:59 PM Emil: It's not even particularly complex
01:59 PM Lambda_Aurigae: done that with a pair of AVRs once.
01:59 PM Lambda_Aurigae: range of about 5cm
01:59 PM Emil: Is radiowaves how many wires?
02:00 PM Emil: Lambda_Aurigae: wat
02:00 PM Lambda_Aurigae: did RF tx and rx with avr and a few passives.
02:00 PM Emil: Nice
02:00 PM Lambda_Aurigae: AM
02:00 PM polprog: cool :D
02:00 PM Emil: Did you use adc?
02:00 PM Lambda_Aurigae: was slow and very low power.
02:01 PM Lambda_Aurigae: I did not use an adc.
02:01 PM Emil: Lambda_Aurigae: hmmmmmm
02:01 PM Emil: Then your coupling was pretty efficient
02:01 PM Emil: Even for 5cm range
02:01 PM Emil: But yeah
02:01 PM Emil: I should actually try to do a real 1-wire system
02:02 PM Emil: Could be pretty great as a learning experience
02:02 PM Emil: Imposing some limitations on devices is probably needed, though
02:02 PM polprog: a servo pulling a literal wire
02:02 PM Emil: polprog: lol
02:03 PM Lambda_Aurigae: rf output was just pulsing a pin and using a cap to make something more rounded from the square wave.
02:03 PM Emil: and differential signals are actually just 1 reference and we detect if voltage is over or under
02:03 PM polprog: i wanna get into basic RF
02:03 PM polprog: that could be a good learning experience, if i made uart over AM
02:03 PM polprog: for example
02:03 PM Lambda_Aurigae: reception was done with an LC circuit.
02:03 PM Emil: polprog: yeah sure
02:03 PM Emil: polprog: you can do it with, let's say
02:03 PM Emil: polprog: two transistors transmit side
02:04 PM Emil: polprog: and a comparator receive side
02:04 PM Emil: perhaps with a low pass filter
02:04 PM polprog: RF is still voodoo for me
02:04 PM Emil: polprog: RF is not voodoo
02:04 PM Lambda_Aurigae: renn0xtk9, waiting all depends on how your code is setup.
02:04 PM Emil: polprog: RF design is
02:04 PM polprog: i guess i should finish reading the art of electronics
02:04 PM Emil: polprog: lol
02:04 PM polprog: what
02:04 PM Emil: polprog: that's a huge book
02:05 PM polprog: indeed
02:05 PM Lambda_Aurigae: Emil, so? still a fun read.
02:05 PM polprog: im in opamps right now
02:05 PM polprog: it's pleasure to read it
02:05 PM Emil: Lambda_Aurigae: I didn't particularly find it super interesting but it sure has a lot of good reference material
02:05 PM Lambda_Aurigae: I want to learn PLL so I can use a PLL and an AVR as an FM receiver.
02:05 PM polprog: PLL?
02:05 PM Lambda_Aurigae: Phased Locked Loop.
02:05 PM Emil: Lambda_Aurigae: yeah ummmm
02:06 PM polprog: oh, that's interesting too
02:06 PM Emil: Lambda_Aurigae: for receiving you don't need a pll
02:06 PM Emil: Lambda_Aurigae: just a mixer and a low pass filter
02:06 PM Emil: and then you can sample it
02:06 PM Lambda_Aurigae: yeah...that works too.
02:07 PM Lambda_Aurigae: but not so fun!
02:07 PM Emil: Well, actually, sure
02:07 PM Emil: you still need the local oscillator
02:07 PM Emil: from PLL perhaps
02:09 PM Lambda_Aurigae: ok...back to unloading the camper and stuff.
02:09 PM Emil: Hmmmmmmm
02:09 PM Lambda_Aurigae: end of the weekend is horrible work...need a vacation from the weekend!
02:09 PM Emil: I'm not actually sure
02:10 PM Emil: Actually yeah you can
02:10 PM Emil: I'm wondering if one can receive fm without frequency mixing
02:10 PM Emil: I came up with one idea but I find it absolutely kludge :D
02:16 PM renn0xtk9: damn even bombing does seems to make it
02:39 PM Jartza: nice
02:39 PM Jartza: hacked together bootloader for my 3d printer
02:39 PM Jartza: it has atmega2560
02:40 PM Jartza: now I can update firmware either from arduino ide, the "old way" via usb (serial)
02:40 PM Jartza: or I can place firmware.bin into sd-card and it'll automatically update it
03:26 PM mjacob: i want to start avr programming in assembly, but i'm unsure which assembler to take (i prefer open source software)
03:27 PM polprog: mjacob: GCC assemler (aka GAS)
03:27 PM Emil: Jartza: that's pretty nice
03:28 PM Emil: mjacob: write your own :D
03:28 PM Emil: I should do that
03:28 PM Emil: Write my own tools as an exercise
03:28 PM Emil: Even for just one device
03:28 PM mjacob: polprog: it seems like they are using a different syntax than the "original" avr assembler. is that a problem in practice?
03:28 PM polprog: no, the mnemonics are the same
03:29 PM polprog: also, to avoid linker mess i just put the file with .s extension via avr-gcc
03:29 PM Emil: mjacob: listen to polprog here
03:29 PM polprog: .global main and youre good to go
03:29 PM polprog: :)
03:30 PM polprog: thanks Emil
03:30 PM mjacob: Emil: actually that would be reasonable, since i'm writing a compiler with an avr backend :)
03:30 PM Emil: mjacob: lol
03:30 PM Emil: mjacob: unless for a learning excercise
03:31 PM polprog: what do you mean by avr backend...?
03:31 PM Emil: mjacob: I recommend you use readymade foss tools
03:31 PM polprog: compiling on the avr?
03:31 PM mjacob: no, compiling *for* the avr
03:31 PM Emil: now that's pretty hc
03:31 PM Jartza: mjacob: gavrasm or avra are pretty nice
03:31 PM polprog: ah
03:31 PM Emil: mjacob: "avr backend" is pretty vague
03:31 PM Emil: mjacob: most understand it like polprog did
03:32 PM Jartza: mjacob: both are compatible with atmel studio syntax
03:32 PM Lambda_Aurigae: mjacob, http://www.avr-asm-tutorial.net/avr_en/
03:32 PM mjacob: Emil: yeah, i always get confused with the terminology as well ;)
03:32 PM mjacob: polprog: no switched operands either, like with x86 gas?
03:32 PM polprog: hmm
03:32 PM Lambda_Aurigae: Jartza is the avr assembly guru here though.
03:32 PM polprog: normal x86 syntax
03:32 PM mjacob: i don't really like the fact that gcc is cooking their own soup again
03:33 PM Emil: mjacob: lol
03:33 PM polprog: mjacob: my asm files look like that https://paste.debian.net/982277/
03:34 PM Emil: mjacob: it's not that gcc is cooking their own coolaid
03:34 PM Emil: mjacob: it's that everyone else is
03:34 PM Jartza: Lambda_Aurigae: well. I don't know about guru, but at least I'm familiar with avr assembly :)
03:34 PM Lambda_Aurigae: Jartza, with what you did with octapentaveega, that makes you guru in my book.
03:34 PM polprog: yeah
03:34 PM polprog: that thing rocks
03:34 PM Emil: But yeah, Jartza is Master
03:35 PM Lambda_Aurigae: Jartza, avr assembly jedi master.
03:35 PM mjacob: i've read that avra doesn't work with some (newer?) avr mcus
03:36 PM polprog: just use gcc
03:36 PM polprog: that way you can mix C and asm
03:36 PM polprog: you dont wanna wrtie eveyrthing in asm do you
03:36 PM polprog: write*
03:36 PM mjacob: well, my compiler will emit everything as asm :)
03:37 PM Lambda_Aurigae: when I use ASM it is usually as a time critical subroutine for C
03:37 PM Lambda_Aurigae: mjacob, most compilers do.
03:37 PM polprog: honestly that's the only smart use for writing in assembly
03:37 PM Lambda_Aurigae: polprog, unless everything is clock cycle time critical like the opv.
03:38 PM Lambda_Aurigae: also, memory usage critical.
03:38 PM Lambda_Aurigae: like the opv
03:38 PM polprog: opv is all time critical
03:38 PM polprog: :D
03:38 PM mjacob: polprog: thanks, i'll go for gas for now :)
03:38 PM mjacob: what's opv?
03:38 PM Lambda_Aurigae: heck, he even used registers from unused peripherals as variable storage!
03:38 PM Lambda_Aurigae: octapentaveega
03:38 PM polprog: lol
03:38 PM polprog: that's a clever hack
03:39 PM Lambda_Aurigae: attiny85 serial to vga adapter.
03:39 PM Emil: It's a very common thing to do
03:39 PM polprog: if you dont have any SRAM
03:39 PM Lambda_Aurigae: https://github.com/rakettitiede/octapentaveega
03:39 PM Emil: Access to hw peripheral registers is far faster than load from sram
03:39 PM Lambda_Aurigae: it has sram!,,,kindasorta...but all used for frame buffer.
03:39 PM polprog: indeed
03:39 PM mjacob: ah right, i've even had "octapentaveega" in my browser history
03:39 PM Emil: It's only one cycle to load or store to hw peripheral registers
03:39 PM polprog: i know
03:40 PM Emil: and 2? or 3 from sram
03:40 PM polprog: takes time
03:40 PM Jartza: mjacob: well, gavrasm works with new MCUs and it's still maintained
03:40 PM Lambda_Aurigae: I started with gavrasm back in,,,2002ish.
03:41 PM polprog: for me you can type directly in a hex editor
03:41 PM Jartza: but IF you want to combine C/C++ and asm, well, then learn the GNU syntax :)
03:41 PM polprog: i should try once :D
03:41 PM Lambda_Aurigae: polprog, avr assembly is a bit complex for that, but doable.
03:41 PM Lambda_Aurigae: used to do similar with 6502 assembly.
03:42 PM Lambda_Aurigae: back in the vic-20 days.
03:42 PM Jartza: and yeah, I couldn't use SRAM with octapentaveega, because all of the SRAM is used for screen buffer
03:42 PM polprog: vic 20 is cute
03:42 PM Jartza: 32x16 characters = 512 bytes. exactly the amount of SRAM tiny85 has :)
03:43 PM Lambda_Aurigae: atmega1284p is more powerful than c-128 even...
03:43 PM polprog: but what people did with c64
03:43 PM Emil: Jartza: how did you encode color?
03:43 PM Emil: colour*Ä
03:43 PM Jartza: well. for color, you run 3 tinys in parallel
03:43 PM Emil: No I mean
03:43 PM Emil: if you have a character screen buffer
03:44 PM Jartza: each tiny has it's own screen buffer and they draw single color
03:44 PM Emil: it must hold information for black and white and colour
03:44 PM Emil: Or
03:44 PM Emil: Do you split while receiving?
03:44 PM Lambda_Aurigae: each one is 1 bit
03:44 PM Jartza: but every chip receives the same UART data, so when they receive data, they make decision if to store the character to SRAM or not
03:44 PM Jartza: or if to store it in reverse
03:44 PM Lambda_Aurigae: each one only receives the color code for itself...or, rather, only acts on its color bit.
03:44 PM Jartza: :)
03:45 PM Lambda_Aurigae: could easily extend the 3 bit color to more by adding more chips and doing r2r ladders or something for each color.
03:46 PM Jartza: let's say we have green color selected with ansi code. all three chips receive letter "A". red one decides to draw " " in screen buffer. blue one decides to draw " " in screen buffer, green one draws "A" :)
03:46 PM Emil: Ah
03:47 PM Emil: So yeah it's split while receiving
03:47 PM Jartza: yep
03:47 PM Emil: Pretty smart
03:47 PM Emil: I mean
03:47 PM Jartza: and the font has "128 characters" and the same ones in reverse
03:47 PM Emil: You could have done some encoding because you have half the space still available :D
03:47 PM Emil: Ah
03:47 PM Emil: I see
03:47 PM polprog: Jartza: do you keep the carmap in EEPROM then?
03:48 PM polprog: charmap*
03:48 PM Jartza: that allows me to use any combination of front/back-color
03:48 PM Jartza: polprog: nope, in flash
03:48 PM Jartza: eeprom is slow
03:48 PM Emil: eeprom is slooooooooooooooow
03:48 PM Emil: Hmm
03:48 PM polprog: oh, right
03:48 PM Jartza: well, flash is slow too. but bearable.
03:48 PM polprog: you have to wait in a loop during a read
03:48 PM polprog: that kills it i guess
03:48 PM Emil: Jartza: well, depends on how you build your software
03:48 PM Emil: Jartza: it's single cycle if you are not afraid to duplicate code
03:49 PM Jartza: what is single cycle?
03:49 PM mjacob: Jartza: i'll give gavrasm a try as well, as soon as my distribution fixed the package
03:49 PM Emil: Flash
03:49 PM Emil: Jartza: well, zero cycle
03:49 PM Jartza: lpm is 3 cycles
03:50 PM Emil: Jartza: yes, but with clever coding you can extract data from flash in a single cycle
03:50 PM polprog: ldi ? xD
03:50 PM * antto smells ASM
03:50 PM Jartza: polprog: ldi loads from SRAM, not flash
03:51 PM mjacob: are there any other actively maintained open source assemblers besides gavrasm and gas?
03:51 PM Emil: Jartza: LDS?
03:51 PM polprog: ldi loads a constant
03:51 PM Emil: Jartza: LDI is for flash
03:51 PM Jartza: oh. wasn't thinking.
03:51 PM Jartza: yes, ldi is constant
03:51 PM Emil: lol
03:51 PM Emil: Jartza: your guru status took a hit
03:51 PM polprog: lol
03:52 PM Jartza: unfortunately flash is not mapped into data space in tiny85
03:52 PM Emil: But yeah LDI is single cycle and if you build the code as a deterministic state machine with tree like structure your access is 1/0 cycles
03:52 PM Jartza: but it is in tiny5!
03:52 PM polprog: oh cool, didnt know that
03:52 PM polprog: i could write a program that displays itself
03:52 PM Emil: It requires code duplication but it guarantees execution
03:52 PM Jartza: Emil: doesn't help in vga, as jump takes long :)
03:53 PM Emil: Jartza: sshhhhh, don't ruin it ;)
03:53 PM polprog: jeez, so the whole frame render routine is jumpless???
03:53 PM Emil: probably not
03:53 PM polprog: i need to look at that code
03:53 PM Emil: Highly unlikely
03:54 PM Jartza: I love how atmel always advertises... "By executing powerful instructions in a single clock cycle, the device achieves throughputs approaching 1 MIPS per MHz, balancing power consumption and processing speed.
03:54 PM Jartza: yea right
03:54 PM polprog: for sure it's blazingly fast
03:54 PM Jartza: branching is not single cycle, jumps are not single cycle, flash access is not single cycle :)
03:54 PM Emil: Jartza: it does achieve 1MIPS
03:54 PM Emil: For most instructions
03:55 PM Lambda_Aurigae: many
03:55 PM Jartza: polprog: well, one full horizontal line full of pixels is drawn without jumps, yes.
03:55 PM Lambda_Aurigae: maybe most if most is 50% or more I suppose.
03:55 PM polprog: anyway, it's something to be proud of
03:55 PM Lambda_Aurigae: faster than 8bit pic though, that's for certain.
03:55 PM Jartza: sure there are lot of single cycle instructions
03:56 PM polprog: hmm if there was a cheap home-makeable pic programmer i would probably try them
03:56 PM Lambda_Aurigae: there are.
03:56 PM Lambda_Aurigae: but they are limited
03:56 PM Lambda_Aurigae: not all pics supported
03:56 PM Lambda_Aurigae: that's why I ended up buying a pickit3
03:56 PM polprog: how much is it?
03:56 PM polprog: gah wait
03:56 PM Lambda_Aurigae: I paid less than 20 for mine but got it on sale.
03:56 PM polprog: im planning to get an stlink
03:57 PM Lambda_Aurigae: stlink is for stm32 arm.
03:57 PM Lambda_Aurigae: I have one of those too.
03:57 PM polprog: i already got a tqfp breakout board for making the dev board
03:57 PM polprog: stm32 look quite complicated, but doable
03:57 PM Emil: polprog: just order one from ebay you fool
03:58 PM Emil: polprog: they are not more complicated
03:58 PM polprog: Emil: im not the one who keeps saying "i gotta make one"
03:58 PM Emil: polprog: they just have more things to config
03:58 PM Emil: polprog: shshshshshhshshshshshshshshs
03:58 PM polprog: :D
03:58 PM Emil: polprog: I'm not saying that on every_thing :D
03:58 PM Lambda_Aurigae: I bought a couple of stm32 bluepill boards..they work well
03:59 PM Lambda_Aurigae: but are rather complex,specially in the whole configuration side.
03:59 PM polprog: i started with bare avrs and i will take pics on a bare chip
03:59 PM polprog: well, getting one to blink a led is *something*
03:59 PM polprog: no matter what cpu
03:59 PM Emil: Lambda_Aurigae: I hold the opinion that arms could be as easy as avrs
03:59 PM Lambda_Aurigae: they can be, yes.
03:59 PM Emil: if the manufacturers werent such huge asses
04:00 PM Lambda_Aurigae: biggest problems are the huge HALs
04:00 PM Emil: Yup
04:00 PM Emil: And set up
04:00 PM Emil: setup*
04:01 PM Emil: Hmm
04:01 PM Emil: It's super annoying how gcc insists on putting every string in ram
04:01 PM polprog: PROGMEM
04:02 PM Emil: polprog: I'm not finished :D
04:02 PM Jartza: polprog: https://pastebin.com/v5pi9XBr
04:02 PM Jartza: :D
04:02 PM Emil: It makes building efficient tree like structures for program flow a pain
04:02 PM Emil: because you can't just encode a pattern as "something"
04:02 PM Emil: but you need to place individual bytes into the comparisons
04:02 PM polprog: Jartza: that's the code rendering a single line?
04:02 PM Jartza: there's code that draws a single horizontal line worth of pixels (single row from 32 characters, 192 pixels)
04:03 PM polprog: damn im good :D
04:03 PM polprog: why are you executing that sbi all the time
04:03 PM polprog: setting the same bit
04:03 PM polprog: delay?
04:03 PM Lambda_Aurigae: he is abusing the USI.
04:03 PM Jartza: fetches characters from sram, font data from flash and draws pixels using USI :D
04:03 PM polprog: wow
04:03 PM Jartza: polprog: I'm clocking the data out from USI
04:04 PM polprog: this sure needs a lot of abstract thinking
04:04 PM Emil: Jartza: what does the sbi line do hardware wise
04:04 PM Lambda_Aurigae: polprog, on chips with full SPI you can do similar by pretending the SPI is in slave mode.
04:04 PM Jartza: "tickling" the USICLK bit in USICR pushes one pixel out to pin and shifts the byte
04:04 PM Emil: Jartza: you are ticking the usi as fast as you can?
04:04 PM Jartza: yes
04:04 PM Emil: Jartza: bypassing the internal clock?
04:05 PM Emil: I see
04:05 PM Emil: It does the >> for you
04:05 PM Emil: Not bad
04:05 PM Jartza: yep
04:05 PM Jartza: also, out USIDR, temp already pushes the first pixel into pin
04:05 PM Emil: Can't you make it clock itself fast enough?
04:05 PM Jartza: nope
04:06 PM Emil: What's the max f?
04:06 PM Emil: half?
04:06 PM Jartza: yeah
04:07 PM Emil: Hmm
04:07 PM Emil: I wonder if you could do it with CLKO and a swtich
04:07 PM Emil: switch*
04:08 PM Emil: Nah
04:08 PM polprog: alrighty
04:08 PM polprog: thanks for the nice evening
04:08 PM polprog: good night :D
04:08 PM Emil: polprog: good night
04:09 PM Casper: emil: not talking about full blindness, just a flash, enought to make the pupil close, now he can't see well in the dark and need some minutes until the pupil dilate again
04:10 PM Emil: Casper: that's a non issue pretty much
04:10 PM Emil: And you still need a high intensity for it
04:11 PM Casper: it is an issue, look it up
04:13 PM Jartza: one interesting thing in AVR
04:14 PM Jartza: when writing flash, before calling "SPM", you write the data into "temporary buffer", which is a size of single flash page
04:14 PM Jartza: temporary page buffer. that doesn't eat SRAM.
04:14 PM Jartza: I've been wondering where it actually is located :D
04:15 PM Jartza: I don't know any way to read from it, but it would be cool if there was a way, haha
04:16 PM Emil: Jartza: it's highly likely one of the actual pages
04:16 PM Emil: That is then copied to another page
04:17 PM Emil: Or left as is if it's the same page
04:17 PM Jartza: it's much faster to fill the temporary buffer, than to actually flash the page content
04:17 PM Jartza: so I'm assuming it's some kind of ram somewhere
04:17 PM Emil: Highly unlikely
04:18 PM antto: Emil why?
04:18 PM antto: Atmel are not cheap on RAM like microchip
04:20 PM Emil: antto: because no hardware designer is going to leave such a gold nugget unused. But it's simple to test
04:21 PM Emil: Write a small program that sits in the bootloader section and dumps all flash and sram after every fill of the temporary buffer
04:21 PM Jartza: "The temporary buffer is a kind of RAM, but not part of the static RAM. You can't access it like other RAM. This temporary buffer can only be accessed via the "Store Program Memory
04:22 PM Jartza: "To write new data to a page, the Page Buffer must be filled first. The Page Buffer is a
04:22 PM Jartza: separate (not SRAM) write-only buffer holding one temporary page. This buffer must be
04:22 PM Jartza: filled word by word. The buffer is copied to Flash memory in one operation."
04:22 PM Jartza: ^from AVR109
04:23 PM Jartza: too bad it's write only :D
04:23 PM Emil: But personally
04:23 PM Emil: What I'm interested in
04:23 PM Emil: Is the suuuper sikrit Capacitive touch registers that are not documented
04:24 PM Emil: Or if it's just clever software
04:24 PM Lambda_Aurigae: I'm betting on software for AVR
04:25 PM Lambda_Aurigae: PIC has an actual CTMU which rocks.
04:25 PM Emil: Lambda_Aurigae: but if you look at m328pb
04:25 PM Emil: Lambda_Aurigae: it mentions hardware touch
04:25 PM Lambda_Aurigae: yeah..
04:25 PM Lambda_Aurigae: mentions, but doesn't give any specifics anywhere.
04:25 PM Emil: But the documentation is "lol use qtouch"
04:25 PM Emil: Lambda_Aurigae: exactly
04:25 PM Emil: For m328p it's pure software
04:26 PM Emil: but m328pb
04:26 PM Lambda_Aurigae: I have played with the pic32 CTMU to build a TDR wire measurement system.
04:27 PM Lambda_Aurigae: I was able to get 10meter accuracy so far.
04:27 PM Lambda_Aurigae: would be awesome if I could get it down to 1 meter.
04:27 PM Emil: wait wat
04:28 PM Emil: TDR?
04:28 PM Emil: REALLY
04:28 PM Emil: Now that's niiiiiftyy
04:28 PM antto: niftay
04:28 PM Lambda_Aurigae: yeah.
04:28 PM antto: how about xmega? they also had some sort of "touch" sh*t
04:28 PM Lambda_Aurigae: abusing the CTMU to measure pulses.
04:29 PM Lambda_Aurigae: I haven't done any xmega because none of them come in dip package...yeah, yeah, I know..
04:29 PM antto: >:/
04:30 PM Emil: PIC32s with usb in dip is pretty crazy, though
04:30 PM Lambda_Aurigae: yup.
04:30 PM Emil: As a hw designer
04:30 PM Lambda_Aurigae: pic32mx270f256b
04:30 PM Emil: MAKE IT SMALLER
04:30 PM Lambda_Aurigae: 28 pin dip.
04:30 PM Emil: WE NEED TO GO SMALLER
04:30 PM Lambda_Aurigae: you can get it in smaller package.
04:30 PM Emil: Hmmmmm
04:31 PM Emil: I wonder if I could just bend the pins
04:31 PM Emil: and solder directly as smd
04:31 PM Emil: would save routing space
04:31 PM Lambda_Aurigae: comes in 28qfn
04:31 PM antto: it's a pic.. so i will allow it
04:31 PM antto: use a hammer even!
04:31 PM Lambda_Aurigae: antto, it's a pic32....mips core with pic peripherals.
04:32 PM Emil: "This part _needs_ to be through hole? How cute."
04:32 PM Emil: But what I need for myself is simple
04:32 PM Emil: an arm with integrated rf
04:32 PM Lambda_Aurigae: comes in soic, qfn, dip, and ssop
04:32 PM antto: Lambda_Aurigae i don't care, i really accumulated a lot of negative feelings for microchip
04:32 PM Lambda_Aurigae: antto, I have too...I hate 8bit pic with a passion.
04:32 PM Emil: With nice, avr like, development tools and libraries
04:33 PM Lambda_Aurigae: however, microchip now owns atmel and avr too.
04:33 PM antto: i know..
04:33 PM hetii: hi :)
04:33 PM antto: the world is darker now
04:34 PM Lambda_Aurigae: I'm waiting for more AVRs with pic peripherals.
04:34 PM antto: i don't see the light at the end of the 8bit tunnel
04:34 PM Emil: antto: are you surprised?
04:34 PM Emil: antto: arms are better in every single way (except development)
04:34 PM Emil: They are faster, cheaper, have better and more peripherals
04:34 PM Emil: 8 bit is död
04:35 PM Lambda_Aurigae: keyboards, mice, tv remotes...mostly 8bit processors still.
04:35 PM antto: i only do 8bit
04:35 PM antto: and PC programs
04:35 PM Emil: Lambda_Aurigae: only because legacy design and definitely not avr
04:36 PM Lambda_Aurigae: I've found AVRs in tv remotes and keyboards
04:36 PM Lambda_Aurigae: mostly 8051/8052 though.
04:44 PM antto: avr in my synth
04:44 PM antto: avr in the drum machine
04:44 PM antto: avr everywhere
04:45 PM Emil: antto: how old are those designs?
04:45 PM antto: the synth is from.. uh.. 2005 maybe?
04:45 PM Emil: antto: even just 10 years and avr was fine, though arms reigned supreme even then
04:45 PM antto: drum machine is from a few years ago
04:45 PM Emil: drum machine is probably because the designer didn't know or couldn't perform better
04:45 PM Emil: or legacy design
04:46 PM antto: drum machine uses atmega1284P if that rings a bell on the callendar
04:46 PM Emil: Explain
04:46 PM antto: isn't that chip relatively new?
04:46 PM Emil: Probably an updated legacy design
04:46 PM Emil: Which benefits from not having to rewrite code
04:47 PM Emil: Which costs money
04:47 PM antto: uhm.. nope
04:47 PM Emil: >code development doesn't cost money
04:47 PM Emil: antto: please, I'll invest all my moneys into you, just provide me with access to this world
04:48 PM antto: okay, it's 2017 and you need to control a few digital signals and a few USARTs
04:48 PM antto: wat ya do?
04:48 PM Emil: ARM it
04:48 PM antto: imma slap you
04:49 PM Emil: Come at me bro
04:49 PM antto: >:(
04:49 PM Emil: I'll probably use AVRs, though
04:49 PM * antto turns green
04:49 PM Emil: But if I was a better version of myself I'd use ARMs
04:56 PM Emil: antto: https://emil.fi/jako/kuvat/armatme.jpg
04:56 PM Emil: Hehehe
04:56 PM Emil: https://emil.fi/hehehe
05:06 PM JanC_ is now known as JanC
05:28 PM polprog: well, my first design at work uses avrs :>
05:31 PM Emil: You still know better
05:32 PM Emil: And it's only the lack of skill and knowhow that prevents you from using arms, and you still aspire to switch to arms
06:06 PM polprog: that was the case here
06:06 PM polprog: the project definitely did not a powerful cpu
06:06 PM Emil: you a word
06:07 PM polprog: did not need :P
06:07 PM polprog: ehh, i should be sleeping now
06:07 PM polprog: :/
06:07 PM antto: you to sleep
06:08 PM Jartza: I'm starting to lean towards economics of price
06:08 PM Jartza: arm mcus are just cheap
06:08 PM polprog: avrs are getting niche
06:08 PM antto: they look complicated
06:08 PM Jartza: still sometimes it's fun to play with avr
06:09 PM polprog: yeah
06:09 PM Jartza: because avr is simple, I know it's asm and it's just fun
06:09 PM antto: i was a completely n00b and just picked up a compiler and started modifying some firmware, and it worked.. atmega
06:10 PM antto: i looked into arm, and it's sooo confusing
06:11 PM Jartza: it's different
06:11 PM Emil: antto: because the manufacturers want you to not think
06:11 PM antto: that's for sure
06:11 PM Emil: It's exactly as simple conceptually
06:11 PM antto: right.. it's still full of transistors and executes instructions
06:12 PM antto: it's exactly the same as an atmega
06:12 PM Jartza: anyways, 95% of customer stuff I do nowadays revolves around cortex m -series
06:13 PM Emil: Even code wise it's not hard
06:13 PM Jartza: mostly either m0+ or m4
06:13 PM Emil: it's just that
06:13 PM Emil: vendors want to bury you under their shit
06:13 PM antto: well, i certainly think i know what kind of arm i'd want to mess around with
06:13 PM Jartza: Emil: at least they try, yes.
06:13 PM antto: one which has the floating point niceness
06:13 PM Emil: antto: m0+ or m4 GET
06:13 PM Jartza: unfortunately most of the vendor stuff breaks by just looking at it
06:13 PM Emil: m4 with crypto
06:15 PM antto: i read something like.. the arm specification has a given bunch of instructions which should be there, no matter who manufactures it, but then they also put their own custom sh*t
06:16 PM antto: so if you use those exotic things - you can be f*cked
06:25 PM Emil: CMSIS
06:25 PM Emil: And the 90% of instructions
06:25 PM Emil: are same everywhere
06:25 PM Emil: Disclaimer: numbers pulled from ass
06:25 PM Emil: But it's still pretty fucking high
06:28 PM Tom_itx is now known as Tom_L
06:32 PM Jartza: most of the CMSIS implementations are crap
06:33 PM Jartza: which is the big reason why I have so plenty of customers :D
06:33 PM Jartza: rewriting custom drivers and stuff
06:33 PM Jartza: like, datasheet says "we have this neato i2c that is fully autonomous and supports DMA and interrupt generation"
06:34 PM Jartza: then manufacturer gives you piece of crap they call code, without any comments, with hard-coded hexadecimal values, it fiddles some MCU registers and then sits there busylooping and WAITING for the fricking interrupt to happen
06:34 PM Jartza: sometimes I don't know what kind of trained monkey writes those manufacturer "SDKs"
06:35 PM LeoNerd: Hardware manufacturers shouldn't be allowed to write code
06:35 PM Jartza: true that
06:36 PM Jartza: although some hardware manufacturers shouldn't be allowed to design hardware, either :D
06:38 PM enh: Hi
06:38 PM enh: Emil, what does 'use a server' mean?
06:38 PM enh: Sorry for my humble ignorance
06:39 PM Emil: enh: you need a computer that stays on all the time
06:39 PM enh: Ok. That means use a server.
06:39 PM enh: Thanks, Emil!
06:40 PM Jartza: or "bouncer" service, or something
06:40 PM enh: I always learn something new here
06:40 PM enh: These stuff are paid
06:40 PM LeoNerd: Do you not have a computer that doesn't get turned off?
06:40 PM LeoNerd: I thought everyone had one of those
06:40 PM Jartza: as even if IRC is "real time" chat, most people aren't at their keyboard 24/7
06:40 PM Jartza: and asking question gets much easier if you can check the history
06:41 PM enh: I 'll set up a Pi for that.
06:41 PM Jartza: sometimes it takes 6 hours for someone to answer, due to difference in time zones etc.
06:41 PM enh: I have a one year old daughter that never turns off.
06:41 PM Jartza: LeoNerd: I rebooted my mac today *gasp*
06:41 PM Emil: enh: I personally use a vps, virtual private server
06:41 PM Jartza: didn't even check what the uptime was before that
06:42 PM Emil: It costs 5 bucks from DO, though you can get a similar one from OVH for like 3 bucks
06:42 PM Emil: a month
06:42 PM enh: I can hire a server for 5 USD a month
06:42 PM Emil: Yeah
06:42 PM Emil: That's a VPS
06:42 PM enh: I had two of those.
06:42 PM Emil: A dedicated costs a bit more
06:42 PM Emil: enh: put IRC on those
06:43 PM enh: I'll leave a Pi on soon. As soon as I can find an wallwart and an available AC outlet near my router.
06:44 PM enh: But my baby daughter really takes most of my available energy for new stuff.
06:44 PM LeoNerd: So find one of the free web online thingies?
06:44 PM LeoNerd: Aren't there loads of them by now
06:46 PM enh: When I need servers, I hire them at vultr.com $5 for a dedicated server
06:46 PM enh: And they have many OS options.
06:47 PM LeoNerd: Wellsure
06:47 PM LeoNerd: But if all you wanted was 24/7 IRC presence, you wouldn't need that
06:47 PM LeoNerd: There's other things around easier than that I'm sure
06:47 PM enh: IRCcloud
06:47 PM enh: for $%/month also
06:47 PM enh: $5
06:48 PM LeoNerd: Huh.. aren't there others?
06:48 PM LeoNerd: that sounds a lot for *just* that
06:48 PM enh: Yesterday I decided to upgrade my CNC with a somewhat bigger laser: http://www.ebay.com/itm/15W-Laser-Head-Engraving-Engraver-Module-Marking-Wood-Cutting-with-TTL-Adaptor/382190710162?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649
06:49 PM enh: I now have a 0.5W 808nm laser diode
06:49 PM Jartza: https://www.elitebnc.org/
06:49 PM enh: I believe this guy selected the wrong currency for that module. Similar ones are 226 USD.
06:50 PM enh: He charged canadian dollars and the unit cost was 180 USD with PSU, driver and head.
06:50 PM enh: Very cheap considering this module has a non fixed focal length and 15W.
06:50 PM enh: He still have two units available
06:51 PM enh: He shipeed today morning.
06:52 PM enh: I have a shapeoko2 CNC with a few custom upgrades.
06:53 PM enh: This shop on Alibaba: https://nbshaft.en.alibaba.com/?spm=a2700.8443308.0.0.JzI2zh
06:54 PM enh: some time ago said he could sent shapeoko2 mechanical kits for 185 USD
06:54 PM enh: could send, sorry
06:54 PM Emil: LeoNerd: >free
06:54 PM Emil: LeoNerd: that's like
06:54 PM Emil: expecting your information being stolen
06:54 PM Emil: enh: you can't get a dedicated server for 5 dollaroos
06:54 PM LeoNerd: ?
06:55 PM Emil: no one sells/rents them that cheap
06:56 PM Emil: enh: are you sure you are not being pulled into a fraud?
06:56 PM Emil: enh: but I'm realy jealous if you have a shapeoko
06:56 PM Emil: even if just v2
06:56 PM LeoNerd: Emil: I'm not tlaking about entire servers, just persistent web IRC things
06:57 PM enh: Emil: Dedicated servers is different from dedicated hardware
06:58 PM Emil: enh: vps
06:58 PM Emil: vps is the word
06:58 PM enh: yep
06:58 PM Emil: if you say dedicated server it means dedicated hardware
06:58 PM Emil: if you say server it can mean anything
06:58 PM enh: i knew it was somewhere in my memory banks
06:58 PM Emil: if you say virtual server it means virtual server
06:58 PM enh: emil... SOrry.
06:58 PM enh: I disagree
06:59 PM enh: a server is a software that runs a service
06:59 PM enh: and I meant a dedicated operating system that runs a service
06:59 PM Emil: daemon
06:59 PM enh: even if it is virtual
06:59 PM Emil: server is "hardware"
06:59 PM enh: not all servers are daemons
06:59 PM Emil: pls
06:59 PM Emil: server has a well defined meaning
07:00 PM enh: not all servers are daemons
07:00 PM Emil: sigh
07:00 PM enh: huh
07:00 PM enh: or.. not all services are run by daemons
07:00 PM enh: gotcha
07:01 PM enh: Emil: On vultr, a freebsd 11 vps with 25GB SSD for $5/mo
07:02 PM enh: They even have a 2.5 USD/month option with 20GB SSD, 512MB memory and 500GB bandwidth
07:02 PM enh: Their service is very nice
07:03 PM Emil: enh: yeah I just checkedout vultr
07:03 PM Emil: I might try them
07:03 PM Emil: https://emil.fi/jako/kuvat/2017-08-21_02-32-20_18dW2HlL.png
07:03 PM Emil: >604 MB/s
07:03 PM Emil: nice
07:03 PM Emil: NICE
07:03 PM Emil: _NICE_
07:04 PM enh: Depends on what you need the server for.
07:06 PM Emil: bigger numbers are better
07:06 PM Emil: except with latency
07:06 PM Emil: and some other things
07:07 PM enh: If you want a shapeoko, write to the owner of that alibaba shop. He manufactured parts for the shapeoko and inventables, if I understood well
07:07 PM lemmings: price will depend on diskspace, disk performance, number of cpu cores, cpu type, cpu performance, network speed, included traffic, ...
07:07 PM LeoNerd: If you want a shapeoko you almost certainly want a v3
07:08 PM enh: The v2 works well
07:08 PM enh: Probably a v# is much better
07:08 PM enh: v3
07:09 PM enh: The v3 is cleaner and the profiles are larger.
07:09 PM enh: But the price reflect those changes.
07:10 PM enh: If you type shapeoko on aliexpress you can find mechanical kits for 400
07:10 PM LeoNerd: The v3 is *muuuch* more stable and has something like 4 times less flex in the middle of the spans
07:10 PM LeoNerd: It's a /lot/ more precise
07:11 PM enh: LeoNerd: Probably is. But I can already do this with the v2: http://gabuleu.blogspot.com.br
07:11 PM enh: More precision is better, but costs twice the price
07:12 PM enh: If you can find who sources the shapeoko3 profile, you can ask a company to laser cut the support parts
07:12 PM enh: probably cheaper than anything else
07:13 PM enh: maybe with a hundred bucks you can assemble one, without controller
07:14 PM enh: for the controller i suggest tinyg, available from adafruit. Tough controller. Works well here
07:14 PM Jartza: well. gotta hit the bed.
07:14 PM Jartza: night all
07:15 PM Emil: good night
07:15 PM enh: dream well
07:19 PM enh: https://www.shapeoko.com/forum/viewtopic.php?f=7&t=4849
07:22 PM enh: https://amberspyglass.co.uk/store/eshapeoko-cnc-milling-machine-mechanical-kit.html
07:38 PM enh: I also found some nice options in china for linear motion, like supported bars. they even sell kits ready for XYZ axes with ball thread screws for like a hundred dollars. With a laser cutting company available and those parts a big CNC can be built *very* cheap.
07:38 PM enh: Well, enough of that.
07:38 PM LeoNerd: That was the main difference between the shapeoko3 and earlier, though
07:39 PM LeoNerd: earlier ones were based on makerrails, which are great for laser cutters and 3D printers... i.e. machines wherein the guide rails only have to move the head itself
07:39 PM enh: And the supporting end plates
07:39 PM LeoNerd: A CNC mill needs much stronger bars, because it has to apply lateral *force* to the cutting head, against the material
07:39 PM enh: yep
07:39 PM LeoNerd: This isn't an issue for lasers or 3D printers, so their bars don't have to be strong against bending
07:40 PM LeoNerd: The bars the shaepoko{original,2} are made of flex far too much for a decent CNC mill
07:40 PM enh: probably yes.
07:40 PM LeoNerd: "linear motion" kits are often only speced for no-load use
07:40 PM LeoNerd: Especially the cheaper end
07:41 PM LeoNerd: If you intend to put a milling spindle on it for cutting, you really do want milling-spec rails
07:41 PM enh: i prefer the laser option now. The v2 is more than ok for me
07:41 PM enh: the spindle makes a lot of noise and dust. When I need it I can always run at small speeds
07:42 PM LeoNerd: The spindle speed doesn't matter for this task though
07:42 PM LeoNerd: The amount of flexing force applied to the guide rails is a function of motion feed rate
07:42 PM enh: fast spindles carve faster and let the head move faster
07:43 PM LeoNerd: .. well, I suppose if you run the spindle slower you can run the feed rate slower too
07:43 PM enh: yep
07:43 PM LeoNerd: But you'd have to run it *really* slowly to not flex it
07:43 PM enh: i set the spindle for 25krpm
07:43 PM enh: and the feed rate for few mm/s depending on the material
07:44 PM enh: but the cncs are very obedient. Tell them to plunge and they plung. Tell them to move pluged and they try hard to do it.
07:44 PM enh: It is very easy to break a bit or crash the head.
07:45 PM enh: I only played with wood and wax
07:45 PM LeoNerd: Mhmm :)
07:45 PM enh: Is today the eclipse day?
07:46 PM LeoNerd: I'm surprised more machines don't have some sort of torque sensor on the spindle, or some way to detect excessive lateral force under motion
07:46 PM LeoNerd: A "force limit" switch, perhaps
07:46 PM enh: a current metering option on the spindle would work too
07:47 PM enh: But then you have to integrate that with your controller, or software
07:47 PM enh: every change takes a lot of energy to get done
07:48 PM LeoNerd: Hm.. getting a reliable "stop" signal out of spindle current alone might be tough, though
07:49 PM LeoNerd: Current surely depends on speed and actual cutting force and so on; what's a valid current in one scenario might be an alarm level in anothe
07:49 PM LeoNerd: I wonder if sensing lateral force on the spindle caused by the head motion might be more reliable
07:49 PM enh: yep. good point
07:49 PM enh: but you can detect a crash
07:50 PM enh: when i built the kit i had no limit switches. I found they were extremely necessary very fast
07:50 PM LeoNerd: Hah
07:51 PM LeoNerd: Yeah; I see the cheap (like, sub-$300) kits on eBay sometimes and of course, no switches there
07:51 PM LeoNerd: I wonder how those home even
07:51 PM enh: they home where you tell them home is
07:51 PM LeoNerd: "Home is where you park your head"
07:51 PM LeoNerd: I want that on a sticker
07:52 PM enh: if they miss steps due to hard materials or high feed rates, your home moves.
07:52 PM LeoNerd: I suppose that's what you get for $300
07:52 PM enh: that is how they crash
07:52 PM enh: switches are easy to install
07:52 PM enh: and very cheap
07:52 PM enh: if you have a tinyg controller, they are integrated like a breeze
10:24 PM rue_shop3: real systems use servomotors and encoders
11:22 PM mjacob: is it possible to save and restore the carry flag?
11:22 PM mjacob: (to a register)
11:25 PM tpw_rules: mjacob: sure
11:25 PM Casper: if you can write to it, then sure, just do it "by hand" I guess
11:25 PM tpw_rules: in/out from sreg and mask out the carry flag
11:43 PM day_ is now known as daey
11:46 PM mjacob: tpw_rules: thank you