#avr Logs

Dec 22 2017

#avr Calendar

01:08 AM rue_mohr: which to what
01:15 AM jerkey: line 990 here is probably one of several things i'm doing wrong https://github.com/RockTheBike/Adafruit_NeoPixel/commit/c6ee0baab50d6bda0f25b74f54201114412eb4c8
01:36 AM rue_mohr: you trying to optimize the C compilation?
02:02 AM jerkey: yes rue_mohr but my friend pointed out a mistake i made in the c implementation and that worked, behold my PR https://github.com/adafruit/Adafruit_NeoPixel/pull/154
02:13 AM rue_mohr: I havn't played with mine yet
02:13 AM rue_mohr: their still sitting in the goodies box
04:03 AM day__ is now known as day
05:47 AM _ami_: finally i bought one FPGA! https://www.aliexpress.com/item/FPGA-development-board-ALTERA-Cyclone-IV-EP4CE-four-generations-SOPC-NIOSII-send-send-remote-control-to/32691369830.html?spm=a2g0s.9042311.0.0.VtusCn
05:49 AM Tom_L: got altera tools for it?
05:49 AM day__ is now known as day
05:49 AM Tom_L: jtag & software
05:51 AM day__ is now known as day
05:53 AM _ami_: yes, seller has given a link to download it.
05:54 AM _ami_: hopefully this also works: https://wiki.archlinux.org/index.php/Altera_Design_Software
06:11 AM karols146: Price is nice 35 Us, think about FPGA too, I wonder if I can get anything better in that price.
07:10 AM nux__ is now known as nuxil
07:11 AM nuxil: 35 bucks isnt much.
07:11 AM gregor2: only 35 bbucks?
07:12 AM nuxil: and 9 cents :p
07:19 AM nuxil: gregor2, did your programmer sorted out ?
07:19 AM nuxil: *did you get
07:35 AM nuxil: if you have a 32 bit int. and take cast a uint8 on the 32bit value. what will be the result ? im looking at some code im trying to figure out.
07:35 AM nuxil: this is onle line that confuses me a bit.
07:35 AM nuxil: Signal_OUT( SIGNALS[SG.mode], (uint8_t)((uint32_t)SG.acc>>16), (uint8_t)((uint32_t)SG.acc>>8), (uint8_t)SG.acc );
07:35 AM nuxil: SG.acc is a uint32
07:40 AM nuxil: im looking at the sourcecode for AVR DDS Sig Gen V2.
07:40 AM nuxil: found here. https://scienceprog.com/avr-dds-signal-generator-v20/
11:20 AM nuxil: so.. do i got this right?
11:20 AM nuxil: i got a inline fuc like.
11:21 AM nuxil: void static inline Signal_OUT(const uint8_t *signal, uint8_t ad2, uint8_t ad1, uint8_t ad0)
11:21 AM nuxil: and this.
11:21 AM nuxil: Signal_OUT( SIGNALS[SG.mode], (uint8_t)((uint32_t)SG.acc>>16), (uint8_t)((uint32_t)SG.acc>>8), (uint8_t)SG.acc );
11:21 AM nuxil: but that line. cant it be written like.
11:21 AM nuxil: Signal_OUT( SIGNALS[SG.mode], (uint8_t)(SG.acc>>16), (uint8_t)(SG.acc>>8), (uint8_t)SG.acc );
11:21 AM nuxil: ? since
11:21 AM nuxil: assume: uint32_t acc = 0xABCDEF
11:21 AM nuxil: (uint8_t) acc >> 16 = 0xAB
11:22 AM nuxil: next: (uint8_t)(acc >> 8) = 0xCD, will only keep the LSB
11:22 AM nuxil: and finally. (uint8_t)SG.acc, -> 0xED, since we only get the LSB.
11:22 AM nuxil: ?
11:23 AM nuxil: im trying to figure out why the usage of (uint8_t)(uint32_t) since acc is already a 32bit uint
11:24 AM nuxil: struct signal {... volatile uint32_t acc; ... ;} SG
11:25 AM nuxil: in this case. LSB as in least significant Byte. "not Bit" :p
11:28 AM nuxil: (uint8_t)SG.acc, -> 0xED bah.. 0XEF ofcource.
11:32 AM nuxil: polprog,
11:33 AM nuxil: wanna take a shot at some asm ?
11:33 AM nuxil: https://pastebin.com/enD3F5r8
11:33 AM nuxil: i commented what i know
11:34 AM nuxil: no. wait. rue_mohr luvs adm :p
11:34 AM nuxil: *asm
11:51 AM polprog: line 6 is a label, to which 13 jumps if 2nd bit of SPCR is not set. the list with "r"s and "I"s is explaned here in a rather poor way but still understandable
11:51 AM polprog: http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
11:52 AM polprog: out writes from TMP reg to PORTA
11:53 AM polprog: supper's ready, aunt and unlce came over for christmas
11:53 AM polprog: merry christmas nuxil ;)
11:53 AM nuxil: merry xmas to you too
11:54 AM nuxil: wanna recomment that :p
11:55 AM nuxil: so what you having for supper ?
12:02 PM Sulinstajn: Hi, can someone try to help me with my not-working code? I'm just learning and this is first time I use TWI. I'm trying to comunicate with Si7021 humidity and temperature sensor using Atmega328P. HW seems to be right (it works with arduino libs). I'm sure, that I'm doing some stupid mistake but I don't see it. Here is my lib source https://pastebin.com/wpz3rDGW and header file https://pastebin.com/wpz3rDGW the code everytime stuck on line 70, inside Si_read
12:02 PM Sulinstajn: humidity function (acording to datasheet, sensor have to not ack data until data measurement will be done, but it never get ACKed ).
12:02 PM Sulinstajn: bad link, header file is https://pastebin.com/K8TEK3gZ
12:05 PM nuxil: im working on twi code myself too :p im not done with it tho.
12:05 PM nuxil: but what is this--
12:08 PM nuxil: but i cant verify that my code works, since i still wating for my i2c displays :p
12:09 PM nuxil: what i done so far. https://pastebin.com/MfGH1AgF
12:10 PM Sulinstajn: I'm on the same point for about two weeks
12:12 PM Sulinstajn: and worst is, that there is no working code for Si7021 for pure AVR, so I can't inspirate nowhere :D
12:15 PM nuxil: sure. use the I2C lib at github as a template. thats what i did
12:16 PM nuxil: it has example for reading data on i2c. but not exactly for you thingy. but still a example
12:17 PM nuxil: https://github.com/g4lvanix/I2C-master-lib
12:17 PM Sulinstajn: I've looked at many diferent examples, but I think, that problem is in waiting for measurement
12:17 PM nuxil: https://github.com/g4lvanix/I2C-master-lib/blob/master/main.c#L64
12:18 PM Sulinstajn: I dare to say, that TWI base is correct
12:18 PM Sulinstajn: yeah, I know that code
12:31 PM nuxil: after line 68 , add TW_WAIT , then replace the while with a if(TW_STATUS != blah)
12:32 PM Sulinstajn: ok, I'll try it
12:32 PM nuxil: i got no ideas. :p
12:32 PM nuxil: *no other
12:33 PM Sulinstajn: me too :D
12:35 PM nuxil: Sulinstajn, im trying to make one of these https://scienceprog.com/avr-dds-signal-generator-v20/ :)
12:36 PM Sulinstajn: it looks fantastic
12:36 PM Sulinstajn: mine project is just smart greenhouse as school project
12:37 PM nuxil: that not mine :p im make a project like that. using atmega 324
12:37 PM Sulinstajn: yeah I understood
12:38 PM Sulinstajn: it looks, that it works - but it stops at line 84 now..
12:38 PM Sulinstajn: but it's prorgess too.. :D
12:40 PM Sulinstajn: oh sorry, it don't work :D I have mess in binaries and I uploaded old one... :D it stuck on new one if
12:43 PM nuxil: hmm. should you not check for both ?
12:43 PM nuxil: TW_MR_SLA_ACK & TW_MT_SLA_ACK
12:44 PM nuxil: if ((TW_STATUS != TW_MR_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK)) ?
12:44 PM Sulinstajn: that isnt problem, TW_STATUS at that point is TW_MR_SLA_NACK - i've tried it yet few days ago
12:45 PM Sulinstajn: but I can try it
12:45 PM Sulinstajn: still nothing
12:46 PM nuxil: :(
12:46 PM Sulinstajn: I think, I'll rewrite it once more from begining
12:47 PM Sulinstajn: but thank you for your effort
12:53 PM nuxil: sorry could be of no help. but im sure someone can if you stick around some.
12:56 PM Sulinstajn: I just must read datasheet more precisly or borrow JTAG from school for debuging
12:57 PM Sulinstajn: I'm sure, that it is some stupid small mistake :D
12:58 PM nuxil: it normaly is
01:45 PM polprog: the problem with every i2c lib i found is that it was useless to me
01:45 PM polprog: :9
01:45 PM polprog: :(
01:46 PM polprog: nuxil: oh standard stuff. acutally it was more of a dessert, 3 different cakes (gingerbread, poppy cake and yeast cake)
02:00 PM Jartza: nuxil: got the displays?
02:15 PM nuxil: Jartza, sadly not jet.
02:16 PM nuxil: and no more mail until wednesday
02:17 PM polprog: i know that feeling
02:17 PM nuxil: been sticking my head down my mail box each day lately :p
02:18 PM polprog: been at the cargo terminal in warsaw to do customs paperwork for my xmas gift. all went smoothly, im very happy, but i can get the parcel delivered after new year or pick it up at the cargo terminal personally on wednesday or thursday
02:29 PM Emil: polprog: what's in it?
02:29 PM Jartza: nuxil: darn :(
02:29 PM polprog: Emil: blank keys hhkb2 proffesional
02:29 PM Jartza: I'm waiting for a replacement part to my soldering iron
02:30 PM Emil: polprog: link?
02:30 PM Jartza: it's been travelling 2 months from US
02:30 PM Jartza: USPS sucks big time
02:30 PM Tom_L: maybe it's not them. maybe it's customs
02:31 PM Jartza: nope, it haven't reached customs yet
02:31 PM polprog: Emil: mine was preowned in original packaging, unopened so way cheaper https://www.ebay.com/itm/New-PFU-Happy-Hacking-Keyboard-Professional-2-PD-KB400WN-BLANK-Keys-F-S-/191792558334
02:31 PM Jartza: I got package from Panama in two weeks
02:31 PM polprog: Jartza: maybe it's stuck on an island with Tom Hanks making use of it
02:31 PM polprog: :P
02:32 PM Jartza: seems USPS sent it via Jamaica
02:32 PM polprog: what
02:32 PM Jartza: so probably
02:32 PM kl0wn: i've had an awful time this week trying to get a fedex package
02:32 PM kl0wn: requires me to sign
02:32 PM polprog: is it like TOR but with parcels instead of packets? :D
02:32 PM kl0wn: and I can't get to the location before they close
02:32 PM Jartza: https://imgur.com/o6mglXQ
02:33 PM polprog: haha
02:34 PM Jartza: I hope they don't mean Ford Transit
02:34 PM Jartza: driver is going to have a hard time driving to Finland :D
02:35 PM polprog: https://www.google.pl/maps/place/Finland,+Minnesota+55603,+Stany+Zjednoczone/@47.4357632,-91.3097014,13z/data=!3m1!4b1!4m5!3m4!1s0x52a5ffcae087e7e3:0x287f9ce897d5b3bb!8m2!3d47.4140821!4d-91.2461985?hl=pl
02:35 PM Jartza: even the crap from aliexpress arrives faster, usually in 3-5 weeks
02:35 PM polprog: my parcel from yokohama to warsaw took 3 days
02:35 PM Jartza: haha
02:36 PM polprog: it's still in customs though
02:36 PM Jartza: I bet the package is closer to minnesota than the finland I live in :)
02:36 PM Jartza: previous package sent via USPS took 3.5 months to arrive finland
02:36 PM polprog: you live in Helsinki or somewhere else?
02:36 PM Jartza: content: two capacitors
02:36 PM Jartza: polprog: about 70km from Helsinki
02:36 PM Jartza: in a countryside
02:37 PM polprog: countryside, must be nice
02:37 PM polprog: i live in the suburbs of warsaw
02:37 PM Jartza: https://www.google.fi/maps/@60.4905818,24.1159508,3a,75y,232.09h,91.58t/data=!3m6!1e1!3m4!1sqqfBirPlu7OhfLgxd-t0Dg!2e0!7i13312!8i6656
02:37 PM Jartza: if you use your imagination, you can barely see my house's roof in that forest behind the field :D
02:38 PM Jartza: that's the closest google streetview gets :D
02:38 PM polprog: i see, nice place
02:39 PM Jartza: much nicer looking on summer and winter
02:39 PM Jartza: that street view must be taken in spring
02:42 PM Jartza: https://drive.google.com/file/d/0B2dTzW9TMeBxb19SSFMtOG9RNVk/view?usp=sharing
02:42 PM Jartza: same field in summer :)
02:43 PM polprog: wow!
02:44 PM polprog: hahaha im lookign at a map of Las Vegas and hell i know this place better than my own neighbourhood thanks to fallout
02:45 PM Jartza: https://drive.google.com/file/d/0B2dTzW9TMeBxaW9keGZ2aGh3b1U/view?usp=sharing
02:45 PM polprog: primm, goodsprings, searchligh, boulder city, red rock canyon
02:45 PM Jartza: birds on field :)
02:45 PM polprog: this is nice
02:45 PM polprog: same i live in a block of flats
02:45 PM polprog: shame*
02:47 PM Jartza: I used to live in Helsinki, though
02:47 PM Jartza: but moved here 10 years ago
02:47 PM Jartza: almost daily, actually
02:47 PM Jartza: 10 years ago tomorrow :)
02:48 PM polprog: hah
02:49 PM polprog: gotta go sleep
02:49 PM polprog: night!
02:57 PM Jartza: night
03:41 PM nuxil: Jartza, darn indeed. but my little project is far from done :p and adding in the displays and i2c code for it will be the last stepp.
03:42 PM nuxil: still trying to figure out how this DDS code works.
03:42 PM nuxil: and why so many strange things in the code.
03:43 PM nuxil: like the line. Signal_OUT( SIGNALS[SG.mode], (uint8_t)((uint32_t)SG.acc>>16), (uint8_t)((uint32_t)SG.acc>>8), (uint8_t)SG.acc );
03:43 PM nuxil: like why use (uint32_t) in there when acc is alreadya 32bit uint
03:47 PM nuxil: i mean.. isnt (uint8_t)((uint32_t)SG.acc>>16) the same as (uint8_t)SG.acc>>16 if acc is a 32bit uint?
05:23 PM nuxil: https://www.youtube.com/watch?v=g4G_qTwgzmk to you all
11:54 PM rue_: arg
11:55 PM rue_ is now known as rue_mohr
11:55 PM -!- #avr mode set to +o by ChanServ
11:59 PM day__ is now known as day