#avr Logs

Jul 03 2017

#avr Calendar

12:20 AM day_ is now known as daey
12:50 AM _ami_: i can use lithium battery charger module (MP1405) to power up a circuit if input power is supplied via a solar panel directly? i don't need lithium battery since i want my circuit to work only when sun is there.
12:51 AM Casper: probably not
12:59 AM _ami_: Casper, why so?
01:00 AM Casper: a charge controller IC is made to cut the power once it detect a full charge
01:01 AM Casper: and limit the current
01:38 AM Thrashbarg_ is now known as Thrashbarg
04:16 AM Snert: and possibly a temperature sensor so if the lipo gets hot.
07:01 AM Emil: hgnhnhgnh
07:02 AM Emil: I don't want to
07:02 AM Emil: this datashit is only 95 pages long
07:02 AM Emil: but it feels so oppressive
07:02 AM Emil: https://www.nxp.com/docs/en/data-sheet/MFRC522.pdf
07:30 AM Emil: Anyone written a driver for those?
07:33 AM Tom_itx: https://github.com/mkschreder/avr-ultimate-driver-pack/blob/master/mfrc522.h
07:33 AM Tom_itx: https://github.com/avr-libs/rfid-rc522
07:33 AM Tom_itx: maybe
07:34 AM Tom_itx: http://randomport.com/doxygen/avrlib/mfrc522_8c.html
07:44 AM Emil: I am being oppressed
07:45 AM Lambda_Aurigae: so revolt
07:45 AM * Lambda_Aurigae is often revolting
07:50 AM Emil: But I can't
07:51 AM Lambda_Aurigae: oh, I'm sure you can be revolting.
07:51 AM Emil: But it's the datashit
07:51 AM Lambda_Aurigae: off to worky now.
07:51 AM Emil: it's oppressing me
07:51 AM Lambda_Aurigae: oppressing or depressing?
07:51 AM Emil: both
07:52 AM Emil: So much shit in only 95 pages
07:52 AM Emil: I'm beginning to doubt if I should take on this endeavour
07:53 AM julius: hopefully somebody pays you todo that
07:53 AM julius: doesnt sound like it
07:54 AM Emil: lolno
07:55 AM julius: than you really have to want it :)
07:56 AM Emil: But why does it have to be so fucking convoluted
08:00 AM julius: sometimes i think that people who really uderstand what they are doing and which are creating products/libraries for the public make it extra complicated
08:00 AM julius: just to show off
08:00 AM julius: like every math article on wikipedia....
08:01 AM julius: they abstracted the shit out of those....most of them are really none intuitive
08:40 AM xentrac: I learned last night that you can multiply by 27 with only two adds, although this is not very useful on the AVR: x += x << 1; x += x << 3;
08:40 AM xentrac: by allowing adds and subtracts with any shift, you can get any multiplier from -84 to 170 in two adds or subtracts
08:41 AM Thrashbarg: neat
08:43 AM xentrac: and more than three-quarters of all the multipliers from -1024 to 1024
08:44 AM xentrac: this interests me because in some sense the shifting is "free" — in hardware it's "just wires"
08:44 AM xentrac: on the AVR of course it's a horrifying loop of rotates through the carry bit
08:59 AM cehteh: even with a barrel shifter in hardware, its one cycle at least
08:59 AM cehteh: nothing is free
08:59 AM Thrashbarg: indeed
09:00 AM cehteh: some processors have combinded multiplyadd commands
09:00 AM Thrashbarg: yea
09:00 AM cehteh: https://en.wikipedia.org/wiki/Fast_inverse_square_root if you want something really mind bending
09:03 AM xentrac: yeah, in software you often still pay one cycle for shifting
09:03 AM xentrac: some ARM processors don't; they have single-cycle instruction execution with a shift built in
09:05 AM xentrac: fused multiply-add (FMA or MAC, multiply-accumulate) is sort of free; a non-fused multiply needs to start by clearing the register where it's accumulating the result, and in a sense MAC is just a matter of skipping that step
09:06 AM xentrac: but it fits uneasily into two-operand instruction encodings; if your multiply instruction was normally like a *= b, now you have c += a * b
09:07 AM xentrac: single-cycle MAC used to be the distinguishing feature of DSP chips, but now it's all over the place
09:30 AM noHitW_work: xentrac do you know any low-cost DSP kits?
09:31 AM xentrac: you can do a significant amount with an Arduino these days
09:31 AM xentrac: for higher-end stuff, I see lots of people starting with RTL-SDR and doing the DSP on a desktop or laptop
09:34 AM Lambda_Aurigae: pic has some interesting dsp chips.
09:35 AM xentrac: the Arduino Primo has a 72MHz STM32 Cortex-M3 with a single-cycle multiply and a nRF52832 64MHz Cortex-M4 which also has, I think, single-cycle multiply
09:43 AM noHitW_work: <xentrac>for higher-end stuff, I see lots of people starting with RTL-SDR and doing the DSP on a desktop or laptop <<-- what does this mean?
09:43 AM Emil: Pretty much most modernish arms have single cycle multiply
09:44 AM Lambda_Aurigae: noHitW_work, software defined radio and do your processing on the attached PC.
10:49 AM Shavik: Anyone familiar with a rotary encoder that supports a pull functionality?
10:50 AM xentrac: you mean, it keeps track of the rotational position and tells you what it is when you query it over SPI or I²C or something?
10:54 AM Shavik: no a mechanical pull functionality
10:54 AM Shavik: I assume it'd output gray code or something
10:54 AM Shavik: just like any old encoder
10:54 AM Shavik: But also with a pull switch so you can pull out on the knob
10:55 AM Shavik: So can rotate it on one plane, then pull on the knob and can rotate on another plane
10:55 AM Shavik: https://gyazo.com/2597ae2dc83a776dc3125ee09707b6be is a picture of an example real life control. Those two aluminum knobs. can be rotated but be pulled out and then rotated still. Then pushed back in
10:56 AM xentrac: I see. I don't know of anything, but I'd assume it's rigged up with like a shaft with a flat on it that slides through the rotary encoder and also actuates a switch
10:59 AM Shavik: https://ae01.alicdn.com/kf/HTB18vuSRXXXXXa.XXXXq6xXFXXXF/10PCS-EC25-Hollow-font-b-Shaft-b-font-font-b-Encoder-b-font-font-b-Rotary.jpg
10:59 AM Shavik: I need something like that and then build the mechanicals to push pull the knob from a in or our position
10:59 AM Shavik: in or out*
11:29 AM polprog: ive seen some hex encoders, but theese were more trimpot style
11:29 AM polprog: id be interested if someone found such an encoder
11:49 AM rue_bed2: they use them on scsi drives to select the address
12:04 PM Lambda_Aurigae: really, the encoder just needs a sliding shaft with a switch on shaft.
12:06 PM Lambda_Aurigae: take apart a car radio that has the push button/rotary encoder combo...should be not too difficult to remove the spring so it stays in one position or the other on the pushy button part.
12:13 PM julius: isnt there a software that changes your uart register names between chips? for example from atmega16 code to 328=
12:17 PM Lambda_Aurigae: should be the same names unless you have dual usarts
12:17 PM Lambda_Aurigae: then you add a 0 or 1 to the names.
12:18 PM julius: ok this time it wasnt that painfull
12:18 PM julius: as you said, just some zeroes
12:25 PM julius: i believe i just turned my avr ports on without first setting DDRB |= (1 << PB0) ...they were just sliglty going on, you had to watch closely....but they went on
12:30 PM Lambda_Aurigae: pullup resistors in input mode.
12:41 PM xentrac: did you measure the pullup current, julius?
01:00 PM Emil: julius: rtfm
01:09 PM julius: ok
01:09 PM julius: but its not that important, i forgot to set them as outputs....just curios to see
01:09 PM julius: xentrac: no
01:10 PM julius: yesterday i got my rtc modul ds3231 to talk to me, found a arduino sketch that runs. so i tried to get it working with peter fleurys i2c library that i already used on a DS1307.
01:12 PM julius: but somehow the i2c_start never returns in my code on line 165 https://bpaste.net/show/019dacb8221c the arduino library uses: Wire.beginTransmission(DS3231_I2C_ADDRESS);
01:13 PM julius: i use: i2c_start(DS3231....); but im not sure what else you need to take into consideration when using fleurys library
01:13 PM julius: or why the code would not even return with a error
01:14 PM Lambda_Aurigae: never had a problem with fleury's libs.
01:14 PM julius: good to know
01:18 PM julius: he uses DEVICE_ADRESS+I2C_WRITE and + I2C_READ in his eeprom example, is this the common way to all devices to tell them to write or read?
01:20 PM xentrac: so this might conceivably be related to what you were doing earlier, julius
01:21 PM xentrac: in that I²C needs a resistive pullup somewhere on the bus in order to operate properly
01:22 PM xentrac: I've never used it, but I'd imagine that if the I²C pin were spuriously low and didn't have a pullup, you could get stuck forever waiting for a hypothetical nonexistent slave to stop clock stretching
01:25 PM julius: yes, 4.7k pullups are on sda and sdl
01:25 PM xentrac: ok
01:25 PM julius: as i said, i used it with the DS1307 successfully
01:25 PM xentrac: sorry
01:25 PM julius: just read that the 3231 is more precise
01:25 PM julius: no problem, input is welcome
01:25 PM julius: also the arduino version does show a time counting upwards
01:26 PM julius: so the hardware connections should be fine
01:34 PM Jartza: http://free-electrons.com/blog/free-and-ready-to-use-cross-compilation-toolchains/
03:46 PM Emil: Jartza: now that is interesting
04:09 PM julius: this is probably good for something else than avr...am i right?
04:11 PM Jartza: yes
04:11 PM Jartza: not really AVR related, but good news for everyone with other microcontrollers, especially arm
04:15 PM Emil: hey hey hey now
04:15 PM Emil: linux does run on avr!
04:17 PM julius: ah ok, almost forgot
04:19 PM julius: ive seen linux on orangepi....those things rock
04:19 PM julius: for a headless system for backup for example
05:04 PM day is now known as daey
09:51 PM Tachyon` is now known as Tachaway