#avr Logs

Mar 25 2018

#avr Calendar

12:02 AM day__ is now known as day
01:36 AM Emil: Was it any surprising? >:D
05:02 AM chat is now known as Guest26664
07:56 AM MrFahrenheit: anyone know what you would call a data structure that's got a read and write pointer to a buffer like a ring buffer, but without the ring part
08:00 AM MrFahrenheit: I guess it's like a "fifo buffer"
08:00 AM Emil: EH?
08:01 AM Emil: so you've got like struct bufferlocation {u8 *r; u8 *w;}; ?
08:01 AM Emil: where r and w point to the same buffer
08:02 AM MrFahrenheit: yeah
08:02 AM Emil: dunno
08:02 AM Emil: rwbuffer?
08:08 AM MrFahrenheit: I guess something like that, I was hoping it had a name I couldn't remember
08:08 AM desperek: hiya
08:09 AM desperek: so, how do i tell if my atmega8 doesnt respond because of connections or because it went off?
08:13 AM antto: MrFahrenheit where's the buffer size variable?
08:16 AM MrFahrenheit: no, it actually just applies itself on an existing buffer
08:17 AM antto: so this is used as a data structure that is just unaware of what happens with it
08:17 AM antto: then isn't it just a "two pointers" or "two indexes" struct ;P~
08:18 AM MrFahrenheit: well it has a bunch of functions that go with it
08:18 AM MrFahrenheit: that manage the pointers
08:18 AM antto: i think in C++ you can use some sort of class-specific annonymous struct, then you don't have to think of a name for this
08:33 AM Emil: MrFahrenheit: RWLOC
08:55 AM polprog: desperek: what do you mean
08:57 AM chat is now known as Guest40513
08:58 AM MrFahrenheit: I think he just wants a way to check if his ic still has magic smoke in it or not
09:04 AM polprog: redo connections
09:04 AM polprog: maybe measure the power consumption
09:13 AM desperek: polprog, well, i shall wait till monday and i will buy 16MHz Si.
09:15 AM polprog: a 16MHz what?
09:15 AM desperek: polprog, w/e, forgot how to say quartz in English :D
09:15 AM polprog: ah lol
09:16 AM polprog: quartz is SiO2 ;)
09:18 AM desperek: oh okay
09:18 AM desperek: my bad then
09:18 AM desperek: im just a coolkid :p
09:19 AM desperek: polprog, well, other question then. how do i connect it?
09:20 AM polprog: attach it to xtal1 and xtal2 pins, make sure you have ballast capacitors connected
09:20 AM polprog: from memory
09:20 AM desperek: ...
09:20 AM desperek: polprog, once more, please?
09:20 AM polprog: 12-22pF to ground?
09:20 AM desperek: oh
09:20 AM _ami_: 22pf works well all the time.
09:20 AM desperek: well, should it be between xtal1 and xtal2 or vcc and xtalY?
09:21 AM polprog: how many legs does your crystal have
09:21 AM polprog: 2 or 4?
09:21 AM _ami_: lol
09:26 AM polprog: what
09:26 AM polprog: :D
09:27 AM polprog: _ami_: is your CPU running?
09:29 AM _ami_: polprog: i have only seen 2 legs xtals.
09:29 AM _ami_: why did u ask 4? was it a joke? ;)
09:29 AM polprog: yeah but some people call generators "crystals" as well
09:29 AM _ami_: oh
09:30 AM _ami_: ok
09:30 AM _ami_: i am in love with sallen key filters. why i did not not about them before. :/
09:32 AM polprog: yeah but are your cpus running
09:36 AM _ami_: cpu running? i guess yes
09:39 AM polprog: then you better go catch them :D
09:41 AM MrFahrenheit: get out
09:52 AM desperek: polprog, umm, i dont have it yeeeeeeet, but i believe crystals have 2 legs...
09:52 AM desperek: i've never seen anything with 4 legs actually
09:53 AM polprog: ok. just wanted to make sure were talkking about crystals not this
09:53 AM polprog: https://www.taydaelectronics.com/media/catalog/product/cache/1/image/500x500/9df78eab33525d08d6e5fb8d27136e95/O/S/OSC-20M-MEC_2.jpg
09:53 AM Tom_L: some smt have 4
09:53 AM desperek: oh what's that?
09:54 AM desperek: im talking about http://www.elektronika-sklep.pl/galerie/k/kwarc-16-000mhz-rohs_7668.jpg
09:55 AM polprog: ok
09:55 AM Tom_L: 2 are likely gnd though
09:56 AM polprog: https://puu.sh/zPdQY/a85b50c984.jpg
10:00 AM Tom_L: http://farm8.staticflickr.com/7102/7192598504_2c1fb10b70_b.jpg
10:00 AM desperek: how much is 22pF in uF
10:00 AM Tom_L: .00000000000000000000000000000022
10:01 AM Tom_L: or somewhere inbetween
10:01 AM desperek: Tom_L, no thats in F
10:01 AM Tom_L: .0022 i think but who knows
10:01 AM desperek: hm
10:01 AM desperek: maybe
10:01 AM desperek: thanks
10:01 AM desperek: so, 22pF 50V 1206 5% COG SMD ROHS will be good?
10:01 AM polprog: 22x10^-9
10:02 AM polprog: thats surface mount
10:02 AM polprog: look for ceramic caps
10:02 AM polprog: thru hole
10:02 AM Tom_L: polprog have you seen the rest of em?
10:02 AM polprog: Tom_L: rest of what
10:02 AM polprog: ?
10:02 AM Tom_L: https://www.google.com/search?q=useless+coupons&tbm=isch&source=iu&ictx=1&fir=Vc699XOBFsWMfM%253A%252ChmxmZfLRf59sRM%252C_&usg=__uMuYr9H_HIkPeCoMChnBwDMsE8c%3D&sa=X&ved=0ahUKEwismaSP3ofaAhVPz2MKHeFlDxMQ9QEINjAC#imgrc=Vc699XOBFsWMfM:
10:03 AM polprog: lol
10:03 AM desperek: polprog, what do you mean ceramic caps
10:03 AM Tom_L: baked clay
10:03 AM desperek: oh i see
10:03 AM Tom_L: not wrapped tin foil
10:03 AM Tom_L: or mica
10:04 AM Tom_L: or some other substance
10:04 AM desperek: yaya
10:04 AM desperek: i have it here
10:04 AM Tom_L: :D
10:04 AM desperek: like, on the website tho :D
10:04 AM polprog: desperek: if you are new and want to get into it, get a capacitor and resistor parts kit
10:04 AM Tom_L: yeah because 2/3 of the kit you will never never use
10:04 AM desperek: ^
10:05 AM desperek: polprog, i dont really need a kit since i have some electronics shops like walmart in my city
10:05 AM Tom_L: walmart carries smt caps??
10:05 AM Tom_L: awesome
10:05 AM desperek: oh no, that was a joke
10:05 AM desperek: like i would be american, smh
10:05 AM polprog: id say radioshack but they are closing
10:06 AM Tom_L: closed
10:06 AM desperek: btw, ATMEGA8A-PU vs -AU?
10:06 AM Tom_L: so is sears
10:06 AM Tom_L: sad day in merica
10:06 AM desperek: polprog, i have some local shops
10:06 AM polprog: desperek: good
10:06 AM polprog: http://polprog.net/papiery/avr/atmega8.pdf
10:06 AM polprog: check that ^
10:06 AM desperek: polprog, i have datashit
10:07 AM desperek: nie jestem jakis ze wsi czy cos :D polprog
10:07 AM polprog: to spoczko ;)
10:08 AM polprog: lol
10:47 AM MrFahrenheit: does papiery mean papers in polish? cause it really sounds like a french word
10:47 AM desperek: yup
10:47 AM desperek: MrFahrenheit, more like documents tho
10:47 AM desperek: as for usage
10:48 AM desperek: but yes, it does indeed mean papers
10:48 AM polprog: papiery as informal for "documents"
12:59 PM desperek: so, some 22pF, 16MHz.. do i need something more for avr?
01:00 PM Tom_L: not for the xtal
01:00 PM Tom_L: .1uf and .01uf caps for power filtering across the chip power leads
01:01 PM Tom_L: just good practice
01:01 PM desperek: Tom_L, hmm okay
01:02 PM desperek: hm
01:02 PM desperek: okay
01:07 PM polprog: 10k pullup resistor for the reset pin, optionally pushbutton to be able to reset it manually
01:07 PM polprog: and ofc some parts that it will control.
01:07 PM polprog: but that's the rest of your project
01:32 PM Emil: MrFahrenheit: Papiery proszę.
01:36 PM polprog: бумаги, пажалуйста
01:36 PM polprog: пожалуйста*
01:40 PM desperek: polprog, why 10k resistor tho
01:41 PM polprog: usually 10k is used. i always have some spare ones
01:41 PM desperek: so its RESET->10K R->GND polprog ?
01:41 PM splud is now known as splurch
01:41 PM polprog: its vcc-reset-switch-gnd
01:42 PM splurch is now known as splud
01:42 PM antto: eh?
01:43 PM antto: 10k between reset and VCC, switch from reset to gnd
01:43 PM antto: and don't press the switch while programming
01:43 PM polprog: https://puu.sh/yqKFY/f4322a7539.png
01:43 PM desperek: antto, i first need to learn how to connect it ;3
01:44 PM polprog: i sometimes press the switch while programming and nothing nasty happened
01:44 PM polprog: in that picture there is a jumper instead of a switch, that was to save PCB space
01:45 PM polprog: the resistor goes to vcc instead gnd because its RESET with a line over it. that means negation. so the CPU is in reset state when that pin is low
01:46 PM desperek: ehh 2 hard 4 me
01:46 PM polprog: dont give up ;)
02:21 PM Emil: polprog: does this trigger you: https://emil.fi/d/2018-03-25_22-20-25_lcKpynUe.png
02:21 PM Emil: unless you meant to write in russian
02:22 PM Emil: desperek: 100k is also good
02:22 PM polprog: why would that trigger me
02:22 PM Emil: desperek: emil.fi/avr has a connection diagram
02:22 PM Emil: polprog: first I thought you meant to write in Polish
02:22 PM polprog: :P
02:23 PM Emil: and translate autodetecting it as Russian
02:23 PM Emil: but it was actually Russian directly
02:23 PM Emil: :D
02:23 PM polprog: last time i checked we use a latin alphabet xD
02:23 PM polprog: yeah, i wrote that in russian ;)
02:26 PM polprog: lol https://www.youtube.com/watch?v=tW2kT1cU_4w
02:26 PM polprog: skip to 5:00
02:26 PM polprog: its the ugliest build ive ever seen
02:32 PM desperek: Emil, well, im waiting for tomorrow to buy clock
02:36 PM Emil: hm?
02:36 PM Emil: clock?
02:41 PM desperek: Emil, quartz :p
02:42 PM desperek: oua, your www is brilliant Emil !
02:49 PM Emil: ah :D
02:49 PM Emil: desperek: glad you like it! :)
02:49 PM desperek: ^^
03:31 PM MrFahrenheit: I rewrote this libusb application that I recently wrote from c to rust
03:32 PM MrFahrenheit: it was a bit tedious at first, but now that it's done it just works perfectly... every edge case handled, every error described, no segfaults, and it just works even with silly settings like setting the io buffer size to 4 bytes
03:42 PM polprog: nice
03:45 PM MrFahrenheit: thinking of attempting a screendump 4 bytes at a time
03:45 PM MrFahrenheit: polprog, you have a scope?
03:46 PM polprog: yeah
03:46 PM polprog: a rigol
03:46 PM MrFahrenheit: good, and you run linux?
03:46 PM polprog: mm
03:47 PM MrFahrenheit: gonna need you to test this with your scope some time in the future
03:47 PM polprog: heh
03:47 PM polprog: allrighty
03:47 PM MrFahrenheit: cause I'm reasonably confident it would work with rigol scopes too
03:47 PM polprog: actually, i might try to make my rigol talk to sigrok
03:47 PM MrFahrenheit: and if it does I'm gonna turn it into a kernel driver
03:47 PM MrFahrenheit: which means rewriting it back to c, but eh
03:48 PM polprog: well technically
03:48 PM polprog: i think if it compiles to assembly its fine
03:48 PM polprog: im sure you can write a kernel module in rust
03:48 PM MrFahrenheit: you can, but calling kernel functions is tedious
03:48 PM polprog: i dont remember if my rigol worked well over lan or usb..
03:49 PM MrFahrenheit: I'm counting on the fact that it probably works fine with the NI VISA driver
04:05 PM MrFahrenheit: hah, it worked, a bmp screendump with 4 byte transfers
04:05 PM MrFahrenheit: took 5 minutes https://i.imgur.com/kTHNXEC.png
04:07 PM polprog: shit finally someone is making proper software for scope handling
04:07 PM * polprog hugs MrFahrenheit
04:08 PM polprog: when i first conencted my riglol to pulseview i didnt know that pulseview supports triggering.
04:08 PM polprog: lol
04:08 PM polprog: so i called it useless
04:08 PM MrFahrenheit: takes 2-3s with a reasonable sized buffer
04:08 PM polprog: now i noticed that ive never ever used a trigger different than edge trigger
04:09 PM polprog: and that's a trigger PV supports
04:09 PM MrFahrenheit: I once hacked at PV to add crop support
04:09 PM MrFahrenheit: but I never bothered to clean it up for merge
04:09 PM polprog: so with that i get a way better interface, MORE RESPONSIVE one, and i can save to a sane format
04:09 PM polprog: crop being?
04:09 PM MrFahrenheit: to crop the capture so only the interesting part is left
04:10 PM polprog: nice
04:10 PM MrFahrenheit: cause it's silly to have a 20MB capture when you need those 20kB
04:10 PM polprog: yeah
04:11 PM MrFahrenheit: now to test my other scope
04:12 PM polprog: what scope you have?
04:12 PM polprog: other^
04:13 PM MrFahrenheit: does this answer your question? https://i.imgur.com/Y4YBiG5.png
04:14 PM MrFahrenheit: it's the siglent scope I had before I got the new siglent
04:17 PM polprog: mm
04:18 PM MrFahrenheit: anyway, application works perfectly with it
04:18 PM polprog: if i could buy something new to my lab it would be a signal generator
04:18 PM polprog: actually found a pretty neat siglent one
04:18 PM MrFahrenheit: I have one of those chinese ones, the proper ones cost too much
04:19 PM MrFahrenheit: still alright, 24MHz, although it's not really usable at that level
04:19 PM polprog: anyway. so i suppose that VISA thing is some protocol to transfer screen images from the scope?
04:19 PM MrFahrenheit: VISA is the driver that implements the usbtmc protocol on windows
04:20 PM MrFahrenheit: on linux you have a few libraries and the kernel driver, but they all seem to suck in one way or another
04:20 PM polprog: i was thinking
04:20 PM polprog: i you share the screengrabbing code
04:21 PM polprog: id happily put together a crude application that would let you display your scope screen on the pc monitor in more or less real time
04:21 PM polprog: even if its 2 fps it would be something
04:21 PM MrFahrenheit: I'm thinking of putting this on github at some point, yes
04:21 PM polprog: good
04:22 PM MrFahrenheit: also, I wrote the rust code so that it could be turned into a c-abi library
04:23 PM MrFahrenheit: but remember, this is just the protocol, every scope has a different set of commands that it supports
04:24 PM polprog: after i figure out how to display a cairo (or preferably any png/jpg) image in gtk i think id be ready to implement a remote screen software
04:24 PM MrFahrenheit: even my two scopes don't behave the same way with commands
04:25 PM polprog: well
04:25 PM polprog: maybe i could help with the rigol part. surely
04:25 PM polprog: in fact.
04:25 PM polprog: actually i forgot what i wanted to say
04:25 PM polprog: :P
04:36 PM polprog: nah...
04:36 PM polprog: sigrok with scopes is.. not the kind of thing you want to use
04:36 PM polprog: its awesome with LAs but scopes... nope
04:44 PM MrFahrenheit: yeah, it seems to implement usbtmc in great detail, including the 488 extensions, but then it doesn't work at all
04:44 PM MrFahrenheit: I don't get why they wrote all that code for 488 when they seem to just use the few commands that are needed to get the waveform and that's it
04:45 PM MrFahrenheit: just realised I forgot to take my meds today and my reminder app didn't remind me
04:46 PM polprog: oh
04:46 PM polprog: hope its not serious
04:46 PM polprog: also
04:46 PM polprog: https://www.cmrr.umn.edu/~strupp/serial.html this is one of the best guides ive ever read
04:47 PM polprog: i had no experience and a bit of theoretical knowledge about how linux handles IO
04:47 PM polprog: this was my linux system call hello world
04:48 PM MrFahrenheit: neat
04:49 PM polprog: time to shut off the pc, pack school stuff for tomorrow and pretend i sleep
04:54 PM MrFahrenheit: night
04:58 PM polprog: i said pretend ;)
05:01 PM MrFahrenheit: oh
05:01 PM MrFahrenheit: "night"