#avr Logs

Mar 04 2017

#avr Calendar

12:11 AM daey_ is now known as daey
12:32 AM ENHering: a question. May I?
12:32 AM ENHering: Is there a way to know if there is a receiver connected to a SPI bus?
12:35 AM Thrashbarg: if it's intelligent and can respond with something detectable... yes... else, no
12:35 AM Thrashbarg: at least as far as I know :P
12:35 AM ENHering: thanks, Thrashbarg
12:36 AM ENHering: That is what I thought. But maybe we are wrong. Dunno.
01:08 AM ENHering: Maybe the slave can keep the SS line high by a pull up.
01:10 AM Thrashbarg: ENHering: what are you trying to do btw?
01:11 AM ENHering: I'm working on this: https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller
01:12 AM ENHering: I want to know which slots are occupied by modules and which aren't.
01:13 AM ENHering: What I do now is to call each slot, send a qustion
01:13 AM ENHering: question, which is a byte, and check the answer, which should be another byte
01:13 AM ENHering: if I get a zero I understand the slot is empty
01:14 AM ENHering: but this seems to be fragile.
01:16 AM ENHering: There is a protocol in this communication. It is not a simple byte exchange
01:16 AM Thrashbarg: yeah
01:17 AM Thrashbarg: is there a spare pin you could use to loop through the module board to detect if there's one present?
01:17 AM ENHering: I could use SS pin for that.
01:17 AM Thrashbarg: okay
01:17 AM ENHering: Maybe
01:18 AM ENHering: I would have to read it, see if it is high, pull it low and send data
01:18 AM Thrashbarg: the build looks pretty respectable though
01:18 AM Thrashbarg: yup
01:18 AM ENHering: thanks.
01:18 AM ENHering: The question is if I can pull it low.
01:19 AM Thrashbarg: the way I'd go about it is to have a sense pin pulled high by default, and each board has a diode connected to it and its /SS pin. When the board is selected and present, it pulls the sense pin low
01:19 AM ENHering: If the master can pull down the slave pull up
01:19 AM ENHering: good idea yours
01:20 AM Thrashbarg: thanks lol
01:20 AM ENHering: but that would need HW changes. And a bus change too
01:20 AM Thrashbarg: yeah that's the only thing...
01:21 AM ENHering: do you think the master can bring low a line that has a pull up?
01:23 AM Thrashbarg: what's the default response from the various modules if you just read from them without writing to them?
01:23 AM Thrashbarg: 0xFF?
01:24 AM ENHering: Usually yes
01:24 AM Thrashbarg: just wondering if you could pull the MISO pin on the ATmega low and read from it after reset. If there's a device present it'll respond with something non-zero
01:25 AM ENHering: hum..
01:25 AM ENHering: maybe
01:26 AM ENHering: What if I set slave SS to input, but set it high by enabling the pull up. Can the master still pull it down?
01:26 AM Thrashbarg: oh I see... for some reason I thought you were using a decoder on the /SS pins, not connecting straight to the ATmega
01:27 AM Thrashbarg: yes that'd work heh
01:27 AM Thrashbarg: assuming you have a pulldown strong enough to do it
01:27 AM ENHering: In principle I could check the SS lines and see who responds
01:28 AM Thrashbarg: yeah
01:29 AM ENHering: I wonder who is stronger... Master pin output set low, or slave pin input pullup high
01:29 AM Thrashbarg: the master pin output would be
01:29 AM Thrashbarg: it's driven by a transistor. The pullup is a resistor (or a current source)
01:29 AM ENHering: In that case it is worth a try
01:29 AM Thrashbarg: yup
01:30 AM ENHering: Thanks, Thrashbarg
01:30 AM Thrashbarg: no problem
01:31 AM ENHering: I'm looking for collaborators. If you get interested, please join the small team.
01:31 AM ENHering: The system need not be used only for piloting. It is very flexible.
01:32 AM ENHering: modules can be built for many purposes. The last idea suggested was to make a module for a BLDC
01:32 AM ENHering: But a stepper motor controller would be nice too
01:34 AM Thrashbarg: cool
01:35 AM ENHering: you can join the channel if you wish. #labvant.com
01:44 AM ENHering: I wish I could know which part of the 'optimized' code is wrong. When I switch off optimization the bug disappears.
01:44 AM ENHering: Sometimes I want to make everything volatile
01:48 AM ENHering: Goodnight everybody. Thanks again for the help, Thrashbarg
01:48 AM Thrashbarg: bye!
06:09 AM JanC is now known as Guest79186
06:09 AM JanC_ is now known as JanC
08:03 AM Tom_itx is now known as Tom_L
08:29 AM ENHering: Somebody here might be interested in this: https://ca.indeed.com/viewjob?jk=497731b5c1e1a42f&q=Physics&tk=1baci5odn18ojfs4&from=ja&alid=5828b1c7e4b03949cb72ab6b&utm_source=jobseeker_emails&utm_medium=email&utm_campaign=job_alerts
09:25 AM Arlenx: hey guys, i'm trying to execute this code: http://pastebin.com/Ufx5JPvP on attiny85 but the problem is that line 15 is always executing no matter what voltage is in ADC2.help please
09:30 AM specing: > pastebin.com
09:30 AM specing: no help
09:32 AM Arlenx: specing, it's on pastebin
09:33 AM specing: the problem is that you have used the worst paste bin service in the world
09:33 AM Arlenx: specing, i should not use pastebin?
09:33 AM Arlenx: what's the alternative ? please
09:34 AM specing: do /msg greybot !pastebin.com
09:34 AM specing: and add TLS to the list of requirements.
09:35 AM Arlenx: omg sound complicate
09:38 AM Arlenx: specing, i paste the code to greybot but it didn't like {}
09:38 AM antto: eek
09:38 AM antto: specing look what u did nao
09:39 AM specing: LOOOOOOOOOOOL
09:39 AM Arlenx: what's wrong with pastebin? it's not that bad
09:39 AM specing: Arlenx: greybot will tell you.
09:40 AM Arlenx: well i better giveup the help then mess with this greybot
09:40 AM Arlenx: anyway thanks
09:43 AM antto: Arlenx check how you initialize the adc pin, the adc module, and the conditions
09:48 AM Arlenx: antto, if i replace this line: if( adcHigh > 512 ) with this: if( ADCH > 200 ) then the code run ok. but i don't know why
09:48 AM antto: adcHigh and ADCH is not the same thing, ya know?
09:49 AM Arlenx: i want 10bit resolution not 8 bit
09:54 AM Arlenx: antto, adcHigh is just a variable that i added to hold the whole number of ADCH and ADCL but it's not working this way for some reason
09:57 AM Casper: enhering: first, you should use ADC instead of messing with ADCH/ADCL
09:57 AM Arlenx: antto, i'm confused now, i tried with if( adcHigh > 32000 ) and it's working now but i don't know why it's using more then 1023
09:58 AM ENHering: Me?
09:58 AM Casper: aslo, there is an order to read ADCH/ADCL, I forgot which one it is, but need to be followed
09:58 AM Arlenx: ADCL first
09:59 AM Casper: and lne 28 may be the issue think
10:03 AM Arlenx: Casper, i suspend line 28 and it's working now. huge thanks!
10:05 AM Tom_L: *.ch
10:06 AM Tom_L: wrong window..
10:09 AM ENHering: Hi
10:09 AM ENHering: New development: https://hackaday.io/project/11724-yauvc-yet-another-unmanned-vehicle-controller/log/54323-module-recognition-implemented
10:12 AM ENHering: Please comment, if you have interest or time.
10:16 AM Casper: oh I misquotted the name... woops
12:11 PM Emil: For anyone else not reading the datasheets
12:12 PM Emil: ADC is a macro that expands to the whole 10 bit adc value
12:12 PM Emil: And if you are reading ADCH and ADCL separarely you must read them in a specific order
12:12 PM Emil: can't remeber which first
12:14 PM Emil: apparently first L and then H when reading and otherway around when writing
12:14 PM julius: if there is a 30ma led connected to the avr via a "big" mosfet (6A peak) will it still stress the avr/arduino output?
12:14 PM Emil: wat
12:14 PM julius: because of the high gate capacity
12:14 PM Emil: 6 peak is fucking nothing
12:14 PM julius: true
12:14 PM julius: but it is for the avr output?
12:14 PM Emil: Wat
12:15 PM julius: for a output pin...wasnt there a 40ma limit for all outputs together?
12:15 PM Emil: oh you mean the capacitance? Dot mattee
12:15 PM Emil: If you want to design foolproof then add a 100k pulldown a 1k series
12:15 PM Emil: Pin 1k Gate 100k Ground
12:16 PM julius: im asking because i read that you should put a 100ohm resistor between avr output pin and mosfet
12:16 PM Emil: julius: only because you might be an idiot and could fuck the pin order up
12:16 PM julius: ok, yeah i know about the gate -> gnd....that trap i already fall into
12:16 PM Emil: it's easy even if you arent a complete retard (regards ds18b20)
12:17 PM julius: you mean connecting avr output -> to source of the mosfet and to gnd with tha?
12:17 PM Emil: wat
12:18 PM robinak is now known as robink
12:18 PM Emil: If you know how to use a mosfet then understanding what I meant by pin 1k gate 100k ground shouldnt be an issue
12:18 PM julius: i know
12:18 PM Emil: 100 ohm is also okay in place of the 1k
12:18 PM julius: but you mentioned "to fuck up the pin oder"
12:19 PM julius: the only way to see that that would hurt the avr would be a connection from the avr output to gnd
12:19 PM julius: ...mosfet source
12:19 PM julius: am i right?
12:19 PM Emil: yes. The only reason most beginner guides ask you to put a resistor in betwewn gate and pin is because you could fuck up the pin ordwr
12:19 PM julius: ok thanks
12:19 PM Emil: I said that above
12:20 PM julius: no
12:20 PM Emil: Also because if you are an idiot, which most guides assume, you could havw a transistor instead of a mosfet in your hands
12:20 PM julius: you said "fucked up the pin order"
12:20 PM Emil: 2017-03-04 19:46:58 +0200 < Emil> julius: only because you might be an idiot and could fuck the pin order up
12:21 PM Emil: julius: dont fucking give me shit
12:21 PM julius: yeah..and i asked another question to which pins specifically
12:21 PM Emil: mate, just stop
12:21 PM julius: did i offend you in some way?
12:21 PM Emil: julius: by being a retard, yes
12:22 PM julius: time to check out the mute function...
12:22 PM Emil: if a person is helping you what the heck do you profit from trying to be a smartass?
12:22 PM Emil: julius: sure, go ahead, blocj the person who gavw you advice
12:23 PM Emil: go #arduino if you cant handle it
12:23 PM grafi_: woha
12:25 PM Emil: ohwell
12:26 PM Emil: What's with people not bothering to read what is being said and getting offended because people say you didnt read things
12:26 PM grafi_: trump syndrome
12:27 PM Emil: grafi_: but it's mostly a liberal thing, well, actually, it's surprising how both sides do it
12:27 PM Emil: fucking safe spaces errywhere
12:27 PM Emil: anycase
12:27 PM Emil: so I'm doing my shit ook radio
12:27 PM Emil: and was wondering about the packet format
12:28 PM Emil: obviously there must be a preamble
12:28 PM Emil: but also a sync is probably needed
12:29 PM Emil: The rest of the packet is mostly application specific but I feel like there should be some more layer 2 stufd
12:30 PM Emil: perhaps a length field, some fec and and a checksum?
12:30 PM Emil: Though perhaps it would be better to have a fixed length packet
12:30 PM grafi_: i guess you dont have access to the chip being used?
12:31 PM Emil: what do you mean?
12:32 PM Emil: There's no config registers, it really is a shit ook transmitter and almost equally shitty ook receiver
12:32 PM grafi_: ah, nm, i was thinking reverse engineering
12:33 PM Emil: I have decided on fsk on top of the ook since it is really easy to send and modulate
12:35 PM Emil: Though now I'm wondering if I should do bipolar based modulation, which is cheap on the receiving end or unipolar, which is time based but more efficient
12:36 PM Emil: s/bipolar/RZ
12:36 PM Emil: which would halve my bandwith
12:36 PM Emil: (again)
12:36 PM grafi_: whats the use case?
12:37 PM Emil: grafi_: personal, learning
12:37 PM Emil: fun
12:37 PM grafi_: oh, ok
12:40 PM grafi_: builing it from the ground up or using existing hw?
12:40 PM grafi_: the radio part
12:47 PM Emil: SYN115/480R
12:51 PM grafi_: looks like the fsk part may be challenging
01:14 PM grafi_: Emil: why not use a semi-decent radio instead?
02:21 PM Emil: grafi_: 2017-03-04 20:07:42 +0200 < Emil> grafi_: personal, learning
02:22 PM Emil: grafi_: and "fsk"
03:03 PM grafi_: Emil: not going to argue, but a (bit) more advanced radio (at almost the same cost) gives you more learning opportunities regarding modulation, line coding, frequencies etc.
03:04 PM grafi_: also, I may be wrong but isn't the SYN115/480R a fixed ask ook radio
03:10 PM grafi_: (if you look aside the personal reasons, ofc :)
03:43 PM bsdfox_ is now known as bobryan
03:48 PM Duality is now known as Guest68525
03:51 PM Guest68525 is now known as Duality
04:33 PM Burgundy is now known as Guest89970
05:49 PM ENHering: It would be nice to have carabia back. He is very helpful.
05:54 PM specing: indeed
05:56 PM Emil: grafi_: mate :D it's not about the actual data transfer efficiency
05:56 PM Emil: grafi_: it's about achieving it from a shitty standpoint myself
05:57 PM Emil: grafi_: also fsk on top of ook is a thing
05:57 PM Emil: ENHering: specing whatever happened to the old grumpy one?
05:57 PM specing: I'm guessing suicide
06:02 PM ENHering: :)
06:02 PM ENHering: he was online two weeks ago
06:02 PM ENHering: but i was not
06:02 PM ENHering: If somebody has his email address, I'd like to write him.
06:04 PM julius: looks like #openocd is currently asleep
06:04 PM julius: got a simple smt32 beginners board here, can i assume that i connected it right to the programming adapter if it connects via usb and shows up in dmesg?
06:07 PM grafi_: Emil: but isnt the module fixed ask and not fsk? Maybe i'm missing something
06:10 PM grafi_: but sure, sure, using shitty modules can be very educational indeed
06:19 PM Emil: grafi_: fsk on top of ook
06:20 PM Emil: Hmm
06:20 PM Emil: I wonder why my Raspi doesn't want to connect to my router wifi
06:20 PM Emil: but my phone wifi is just fine and dandy
06:21 PM grafi_: ok, the prod info said only ask/ook, butbut
06:22 PM Emil: grafi_: fsk ON TOP OF ook
06:22 PM Emil: grafi_: what is ook?
06:22 PM grafi_: i see what you write
06:22 PM Emil: It's on off
06:22 PM Emil: How can you modulate that on off keying?
06:23 PM Emil: And there's your answer
06:25 PM grafi_: okok, let me know when you are able to do fsk on an ask-only chip, it can come in handy
06:26 PM Emil: grafi_: mate, how thick are you?
06:27 PM specing: THICKER THAN A BOWL OF OATMEAL!
06:27 PM grafi_: :')
06:27 PM Emil: grafi_: how about you look at this
06:27 PM Emil: http://www.atmel.com/Images/Atmel-42559-Differences-between-ATmega328P-and-ATmega328PB_ApplicationNote_AT15007.pdf
06:27 PM Emil: And specifically the section 2.3
06:28 PM specing: Emil, grafi_: https://lut.im/mzoLiGJdpK/DToBEnk1rFWwgMV7.gif
06:29 PM Emil: specing: can never know when gifs are real
06:33 PM grafi_: havent worked much with barebone rf systems, but when i think of modulation i think of either ask, fsk, psk on top of some sort of line coding
06:33 PM grafi_: in general
06:34 PM Emil: grafi_: can you not understand the concept?
06:35 PM grafi_: nope, apparently not. The way i see it you want to do frequency modulation on an amplitude modulation only chip?
06:36 PM Emil: did you even look at the pdf?
06:37 PM grafi_: aah, fsk on top of ask/ook?
06:39 PM Emil: ...
06:40 PM Emil: I assume you must either have the memory of a goldfish or that's sarcasm
06:40 PM grafi_: morse?
06:40 PM Emil: sarcasm is was
06:41 PM Emil: specing: if I say to you "I'm doing a shit on off keying radio with a module that does only ook and that I'm going to do fsk on top ook" and I show you the diagram
06:41 PM Emil: as mentioned above
06:42 PM Emil: specing: do you understand what I'm doing?
06:42 PM specing: Emil: I'm not familiar with radio tech yet, sorry
06:43 PM Emil: specing: okay so imagine that you have a radio that can send only at one frequency and that it can either send and not send
06:44 PM grafi_: (fixed ask)
06:44 PM Emil: also known as on off keying
06:44 PM Tom_L: morse code
06:44 PM Emil: Not morse
06:44 PM Tom_L: moose?
06:44 PM grafi_: morse is nice
06:44 PM Emil: morse is a protocol already
06:45 PM Emil: Tom_L: do you understand my point?
06:45 PM Tom_L: no, just walked in
06:45 PM Emil: specing: anycase
06:45 PM Tom_L: and just about to walk out again..
06:45 PM Emil: Tom_L: don't do this to me
06:45 PM specing: :D
06:46 PM Emil: specing: so you can either have the radio on or off. Now you must decide obviously on how you are going to send data through that
06:46 PM Emil: specing: you need to modulate how you turn the radio on and off
06:46 PM Tom_L: http://wireless.murata.com/media/products/apnotes/ookvsfsk.pdf
06:46 PM Emil: Tom_L: that pdf is for the actual phy
06:46 PM Emil: my phpy is ook
06:46 PM Tom_L: oo k
06:47 PM Tom_L: :D
06:47 PM Emil: In general fsk (fm) is much better than pure ook
06:47 PM Emil: or even ask
06:47 PM grafi_: true
06:48 PM Emil: specing: now fsk means frequency shift keying, which means we change the frequency that we send at
06:48 PM Tom_L: warble
06:50 PM Emil: specing: so if I say that we modulate the on off keying radio with fsk, do you understand what I mean?
06:50 PM specing: it doesen't work
06:50 PM specing: if it can only tx at one freq
06:50 PM Emil: sigh
06:51 PM Emil: Fine, whatever, I just lose my own time
06:51 PM specing: though that seems strange, most txs I've heard about can transmit at a whole band
06:56 PM grafi_: still dont understand why you'd want fsk on top of ask
06:58 PM Emil: grafi_: SYN480R requires data whitening
06:59 PM Emil: (which is a byproduct of a great feature it has, though, which is agc)
07:22 PM grafi_: buuut
07:22 PM grafi_: ok, i'll stop now
08:00 PM Emil: Hmm
08:01 PM Emil: Anyone played around with ds18b20 and especially do you know if their calibration can be thrown off by accidentally heating it?
09:27 PM Chillum: Emil: they can be damaged over 125C according to their datasheet
09:27 PM Chillum: but I imagine they could handle a bit of abuse
09:27 PM Emil: Chillum: hmm, probably what happened
09:27 PM Chillum: I have never had one go bad on me without just giving an error back
09:28 PM Chillum: if you have more than one you can compare
09:28 PM Emil: I had one the wrong way around for quite some time :D
09:28 PM Emil: yeah I have 10
09:28 PM Emil: + 3
09:28 PM Chillum: ah well they are sensitive to reverse current
09:28 PM Emil: no 4
09:28 PM Emil: But it still works
09:28 PM Chillum: if it is giving bad info you should destroy it so it does not get mixed in with your good ones
09:29 PM Emil: Chillum: well, I can't particularly know how bad the info is
09:29 PM Emil: It's only off by half a degree but so far that's a consistent off by half a degree
09:29 PM Chillum: good ones should agree with each other
09:30 PM Chillum: a half degree is not much, being in slightly different positions can account for that
09:30 PM Emil: Hmm
09:30 PM Emil: Perhaps I should just donate it to our electronics lab :D
09:30 PM Chillum: or detonate it in the chemistry lab
09:30 PM Emil: I wish I could