#avr Logs

Jan 10 2018

#avr Calendar

12:19 AM nuxil: yay. its a live.
12:22 AM nuxil: only change needed was to add _delay_us(10); afer setting the CS line low in the send fnc.
12:22 AM nuxil: datasheet also said that CS line must be low for some time. so i guess thats what my issue was.
12:23 AM nuxil: now to get 16 bit commands working :p
01:35 AM Jartza: some chips have certain wake-up time when pulling CS low
01:35 AM Jartza: but pretty rare to state "some time" in datasheet :D
01:35 AM Haohmaru: wat
01:35 AM Haohmaru: who says "some time" in a datasheet?!
01:41 AM Jartza: looks like 60ns to me :)
01:42 AM Jartza: so probably _delay_us(1) should be sufficient
01:42 AM Haohmaru: even a recipe for bacon and eggs is more specific
02:07 AM nuxil: <Haohmaru> who says "some time" in a datasheet?!
02:07 AM nuxil: microchip
02:07 AM nuxil: not precisly some time but quote: There is a required delay after the CS pin
02:07 AM nuxil: goes active to the 1st edge of the SCK pin.
02:07 AM nuxil: and i cant find it.
02:07 AM Haohmaru: dafuq, microchip!
02:07 AM Haohmaru: >:/
02:07 AM nuxil: Jartza, wherer do you see 60ns ?
02:52 AM nuxil: 16bit write command done :) , nextup the 16bit read command :)
03:00 AM Jartza: nuxil: datasheet timing chart
03:00 AM Jartza: http://ww1.microchip.com/downloads/en/DeviceDoc/22059a.pdf
03:01 AM Jartza: 1.1 (page 11)
03:01 AM Jartza: CS Active (VIL or VIHH) to SCK↑ input, min 60ns
03:01 AM nuxil: ahh
03:01 AM nuxil: thx
03:04 AM Jartza: also, judging from the logic analyzer capture you showed, you're using wrong CPOL/CPHA
03:04 AM Jartza: datasheet states SPI mode = 11
03:05 AM Jartza: being, CPOL = 1, CPHA = 1
03:05 AM Jartza: CPOL=1 is a clock which idles at 1, and each cycle consists of a pulse of 0. That is, the leading edge is a falling edge, and the trailing edge is a rising edge
03:05 AM Jartza: For CPHA=1, the "out" side changes the data on the leading edge of the current clock cycle, while the "in" side captures the data on (or shortly after) the trailing edge of the clock cycle. The out side holds the data valid until the leading edge of the following clock cycle. For the last cycle, the slave holds the MISO line valid until slave select is deasserted.
03:06 AM Jartza: https://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus#Clock_polarity_and_phase
03:07 AM Jartza: nuxil: I mean, under the timing picture is "SPI Timing Waveform (Mode = 11)"
03:08 AM nuxil: yea saw, 0,0 is a page down
03:09 AM Jartza: ahh, oops
03:09 AM Jartza: ahh, true, it supports both 00 and 11
03:09 AM nuxil: jup
03:10 AM Jartza: and determines the mode by the state of SCK in SC transition
03:10 AM nuxil: yea
03:11 AM Jartza: ok. nvm about that then :D
03:11 AM nuxil: page 44 :p
03:13 AM Jartza: yea. anyway, the timing chart says 60ns
03:13 AM Jartza: what cpu clock you're using?
03:14 AM nuxil: im testing it on a atiny13a
03:14 AM nuxil: 1mhz
03:14 AM Jartza: uh
03:14 AM Jartza: then one instruction is 1µs
03:14 AM Jartza: according to that it shouldn't need delay
03:16 AM nuxil: i will tweak it later, after im done with all the commands. then i'll adjust the timing.
03:17 AM nuxil: there is also some status register and the TCON register im thinking about reading out. esp the TCON which you can use to dissconnect the terminals
03:18 AM nuxil: if i understood it correctly.
04:11 AM Jartza: nuxil: welcome to my life, like one third of my work-time is reading the datasheets :D
04:11 AM Jartza: lately it seems, one third is also spent trying to fix stupidities caused by faulty datasheets
04:51 AM dgriffi: does anyone in here understand DTMF tones? I have an ATtiny85 project that makes DTMF tones that aren't easily understood by decoders. I've recorded the audio into Audacity along with known good sources and looking at the waveforms, I can't see the problem.
05:09 AM ok9swl: dgriffi: I have done a pulse to DTMF converter for rotary phone once with ATtiny without difficulties. But I used it for the real telephone network and the near-square wave got filtered along the way to the central office. It may be problem with higher harmonics if you use it locally.
05:11 AM dgriffi: ok9swl: could you take a look at https://github.com/DavidGriffith/bluebox-avr/issues/2 and tell me what you think?
05:17 AM ok9swl: dgriffi: the output in audiocity looks great....
05:18 AM dgriffi: ok9swl: that's what I thought.
05:19 AM dgriffi: maybe oops... I just remembered that I tended to have trouble with the bottom row of the keypad.
05:19 AM ok9swl: dgriffi: what is the target device for your dtmf tones? Phone network?
05:19 AM dgriffi: projectmf patches for asterisk
05:19 AM dgriffi: or asterisk in general (redboxing a payphone in my own garage)
05:20 AM ok9swl: dgriffi: please check the frequency in audiocity with fft for all the tones, that you are not skewed in frequency/timing domain. The signal envelope looks great.
05:21 AM ok9swl: Oh, those phone phreaks :)
05:21 AM dgriffi: ok9swl: I missed out on most of that when it was a thing
05:23 AM ok9swl: dgriffi: I missed it out by my own decision. It look to simple for me as a ham radio operator to be interested in phones. I completely forgot that it is not the phones, it is the phone network that is interesting. Before I realized that, we were switched to Nortel DMS and all fun gone.
05:25 AM dgriffi: ok9swl: check out projectmf.org sometime.
05:26 AM dgriffi: ok9swl: this project is a reimplementation/expansion of the projectmf bluebox
05:26 AM dgriffi: ok9swl: I uploaded a new Audacity screenshot, this time comparing the # digit
05:26 AM ok9swl: dgriffi: Sure, I will as soon as I get home. Evan Doorbell recording taught me what I deliberatelly missed. I can just kick myself about it now. Its gone forever.
05:28 AM dgriffi: ok9swl: my reason for making this bluebox was for AVR programming practice and to provide an alternative bluebox firmware that doesn't depend on an expensive proprietary compiler.
05:28 AM dgriffi: and, of course, historical fun.
05:30 AM ok9swl: dgriffi: The timing looks good too for the first sight... You can do the fft to be sure, but I do not think it is necessary. The remaining is the volume intensity, the phone may be overloaded and distorts the tones.
05:31 AM dgriffi: Don Froula (projectmf bluebox designer) suggested to me that my problem might be "twist", that is, the individual sine waves might not be both at the same amplitude. I'm having a hard time understanding how that can be possible given how I'm generating the waves.
05:31 AM dgriffi: ok9swl: I'm also thinking that the Radio Shack bench amplifier might be putting crappy harmonics into the output
05:32 AM dgriffi: but I don't see evidence of that in my first screenshot.
05:34 AM dgriffi: by the way, the PCB for this project is not yet finalized. I'm holding off on that until I get the DTMF recognition problem fixed.
05:34 AM dgriffi: once that's done, I'll be selling boards
05:36 AM dgriffi: Oooo... fourier tells me something odd
05:38 AM dgriffi: ok9swl: for the Audacity-generated DTMF # tones, I see peaks at 944 and 1479
05:38 AM dgriffi: ok9swl: for the ATtiny85-generated DTMF # tones, I see peaks at 926 and 1458
05:39 AM dgriffi: ok9swl: published standards for the # tone is 941 and 1477.
06:16 AM jragon: oh man, this microchip merger is getting really annoying
06:16 AM dgriffi: jragon: what's going on now?
06:17 AM jragon: Anyone have a collection of avr application notes? I've found it very difficult to use the microchip website as it me
06:17 AM jragon: it merges all their products in to one big section under 8-bit mcus and the search function is awful
06:17 AM dgriffi: jragon: I have a few lying around locally. what're you looking for?
06:17 AM polprog: hi everyone
06:18 AM jragon: Notes on setting up UART
06:18 AM jragon: I've found one hosted on pldworld.com, what ever that is. Google is helpful as always :)
06:18 AM dgriffi: jragon: sorry, I don't have anything on that
06:19 AM jragon: Okay, so googling 'Subject AVR Application Notes' usually gives a number which you can put into the micro chip search function. That finally returns the up to date application note
06:20 AM jragon: Hopefully google should reindex everything soon
06:20 AM dgriffi: hopefullly microchip figures out its search sucks
06:20 AM dgriffi: this merger made me feel that microchip might sometime try to kill off the AVR line
06:21 AM jragon: That would be sad
06:21 AM jragon: time to try out the arm stm32 solution maybe
06:23 AM dgriffi: would they be so assinine to do that?
06:28 AM jragon: aha, if you go to the product page for your device (ie http://www.microchip.com/wwwproducts/en/ATmega644P) and click on documentation it lists all the relevant application notes and datasheets
06:31 AM ok9swl: dgriffi: You are a bit skewed with the timing, try to fix the tables a bit.
06:33 AM dgriffi: ok9swl: where?
06:42 AM ok9swl: dgriffi: sorry, I didnt see your code, I supposed that you are generating the DTMF using precomputed constant tables
06:43 AM dgriffi: ok9swl: I have a sine table made with http://www.daycounter.com/Calculators/Sine-Generator-Calculator.phtml
06:51 AM dgriffi: ok9swl: maybe if I increase the sampling rate a smidgen?
08:10 AM Sadale_ is now known as Sadale
08:53 AM day: if they would make the pics more accessible would there even be demand for the atmegas?
09:01 AM dgriffi: day: how is that supposed to work?
09:01 AM dgriffi: day: A big part of why I prefer AVR is that the development tools are open source freeware
09:10 AM day: dgriffi: well is gcc inherently incompatible to PIC?
09:10 AM dgriffi: day: how so?>
09:10 AM day: o0
09:11 AM dgriffi: day: whoops! I thought misparsed and thoght you were making an assertion.
09:11 AM day: ah
09:11 AM * dgriffi brainfarts
09:12 AM day: im just thinking, what would happen if they remove the atmegas and make the pics gcc/ opensource tool chain compatible
09:12 AM dgriffi: day: probably piss off a lot of people
09:13 AM day: that doesnt matter. the question is where do they run to
09:13 AM dgriffi: day: indeed. that would be an eeevil thing to do.
09:14 AM day: it would be more evil to kill atmega and not make PICs opensource usable :/
09:14 AM dgriffi: that too
09:17 AM dgriffi: according to this, Microchip appears to be hostile to the idea of a full-featured GCC for the PIC line: http://www.microchip.com/forums/m222611.aspx
09:17 AM polprog: doesnt sdcc support some pics? and theres some obscure flasher what works with pickit2
09:18 AM polprog: still i think its not that easy to kill a mcu line off the market
09:18 AM polprog: what would they do, halt the production overnight?
09:18 AM dgriffi: polprog: they could shit on the hobbyists and nothing would happen. I'm guessing the military would lean on them to knock off such shinanigans
09:19 AM dgriffi: mil, aerospace...
09:19 AM polprog: shit on the hobbyists meaning?
09:19 AM polprog: stop selling them to civils? haha
09:19 AM dgriffi: polprog: ya
09:20 AM polprog: theres too many designs using avrs to just do that
09:20 AM polprog: that would not be a smart move
09:21 AM dgriffi: I'm rather cynical right now...
09:21 AM dgriffi: about all sorts of things.
09:21 AM polprog: im cynical about most of my life
09:21 AM polprog: >:)
10:16 AM nohit_2 is now known as nohit
11:28 AM JanC is now known as Guest37549
11:28 AM JanC_ is now known as JanC
12:23 PM nuxil: anyone else haveing problem loading microchip.com ?
12:23 PM nuxil: heh. server not found. :\
12:24 PM nuxil: looks like they had a short downtime.
12:30 PM s8548a: nuxil: working
12:33 PM nuxil: so. microship is gonna start killing off chips now, according to the ceo. doesnt say what will be affected tho.
12:33 PM nuxil: quote: "we are seeing a significant increase in the number of device end
12:33 PM nuxil: -
12:33 PM nuxil: of
12:33 PM nuxil: -
12:33 PM nuxil: life notices
12:33 PM nuxil: being issued"
12:34 PM nuxil: arg. sorry
12:35 PM nuxil: https://www.microchip.com/docs/default-source/announcements-documents/newyear-2018-letter-from-steve-and-ganesh.pdf
12:36 PM polprog: imcracking ponyprog
12:36 PM nuxil: why?
12:36 PM polprog: got it to bitbang i2c and SPI, but for some reason atmega8 slave does not send data while being programmed
12:36 PM nuxil: using ollydbg?
12:37 PM polprog: using what?
12:37 PM nuxil: you said you where cracking ponyprog :p
12:38 PM polprog: in the meaning that i linked ttyUSB0 to ttyS3 since ponyprog allows you to select between ttyS 0 to 4
12:38 PM nuxil: ok
12:38 PM polprog: so now i got it sending a bunch of what i suppose to be ISP but the avr doesnt respond
12:39 PM nuxil: install wireshark and see what its transmitting.
12:40 PM nuxil: and usbcap
12:41 PM polprog: i i see this on the LA
12:42 PM polprog: if only this was a maintained program...
12:43 PM nuxil: ponyprog?
12:43 PM polprog: theres flashrom but that's for spi flash only (works with bus pirate), and some 24Cxx reader wich works with linux i2c devices
12:43 PM polprog: yeah ponyprog
01:01 PM polprog: ok, so it seems that all signalling is properly shaped and timed, it must be ponyprogs fault, maybe it sends wrong ISP data? since the MISO line on the avr keeps high (even when it's not connected to anything)
01:02 PM nuxil: that why i said install wireshark with usbcap and see what its transmitting. :p
01:02 PM nuxil: recieving
01:03 PM polprog: yeah i know but the problem is that the avr is physically not sending data! i can see on the LA the exact bytes ponyprog is bitbanging on MOSI
01:04 PM polprog: whatever, ill leave this for now
01:04 PM polprog: i bet this is wrong data being sent by pp
01:05 PM polprog: if anyone cares - ill put up the spreadsheet with my notes on the site
02:04 PM antto: day even if they make pics pink and fill them with honey, if i need 4KB RAM or more - pics are out of the question
02:04 PM nuxil: why?
02:05 PM polprog: 64 bytes ought to be enough for everybody
02:05 PM polprog: :^)
02:05 PM polprog: plus, how can you not love being able to adress your whole memory with a single register ? :P
02:06 PM antto: iirc, there are pics with no RAM
02:06 PM antto: like.. zero
02:06 PM antto: there are some with 37 bytes, or something like that
02:06 PM antto: D A F U Q
02:06 PM nuxil: lol whats the point :p
02:07 PM tpw_rules: aren't there some avrs like that too
02:07 PM polprog: lol
02:07 PM antto: last time i checked, the pic with the MOST ram doesn't even have 4KB
02:07 PM antto: what year is it?!
02:07 PM polprog: ( took that 64 bytes by googling pic12f - first partno that came to my mind)
02:08 PM polprog: how can you program them in C if they have enough ram bytes to draw the memory map on a napkin?
02:08 PM * polprog was actually thinking about getting a pickit2 on a bargain
02:08 PM nuxil: aww
02:11 PM polprog: but i already spent some money on some usb-ttl bridges and a soic clip
02:13 PM antto: https://www.tme.eu/gb/details/pic16c55a-04_p/8-bit-pic-family/microchip-technology/
02:13 PM antto: look mom, i have moar legs than i have brains!
02:14 PM polprog: lol
02:15 PM polprog: wheres the no ram one?
02:15 PM antto: can't find it thru tme's filters
02:15 PM polprog: can you still call an mcu a harvard architectue when there is no data memory
02:16 PM antto: hey! their UART receiver has a FIFO!
02:16 PM antto: they call it a FIFO buffer!
02:16 PM polprog: wait wait wait
02:16 PM antto: with the mighty length of 1 byte (plus one bit)
02:17 PM polprog: that's brilliant, no i know why mike used a delay line as a memory in one of his vids lol: https://www.youtube.com/watch?v=-qerYLM-eEg
02:17 PM polprog: ha ha ha
02:17 PM polprog: 1:50
03:01 PM polprog: this is ultimate nerdgasm, with that fallout music being the icing on the cake; https://www.youtube.com/watch?v=CMvFKDHh4WM
03:01 PM * antto not gon' click dat
03:02 PM polprog: why not
03:02 PM antto: "fallout" music
03:02 PM polprog: oh come on
03:02 PM antto: my brain said no
03:02 PM polprog: you can mute it haha
03:02 PM polprog: ibm 5155 on the net
03:02 PM antto: not fast enough
03:03 PM antto: the fuggly "music" will still be reaching large parts of the computer
03:03 PM antto: propagating like poison
03:04 PM polprog: spin up a vm haha
03:04 PM antto: don't you increase the attack vectors for exploits when you run a VM? ;P~
03:05 PM polprog: no idea
03:05 PM antto: your OS probably has some bugs
03:05 PM polprog: id think VMs (properly made ofc) let you isolate stuff
03:05 PM antto: the OS u gon run in VM also has some bugs
03:05 PM antto: the OS+VM(OS) must have some other kinds of bugs on top ;P~
03:06 PM polprog: clearly, the only secure way of computering is disposable pi zeros
03:06 PM polprog: :P
03:06 PM antto: aren't those running allwinner cpus?
03:07 PM polprog: hmm, they may
03:07 PM polprog: extra chineese bugs in there
03:07 PM polprog: :P
03:07 PM antto: there was something "echo root my device" and you become root
03:08 PM polprog: i remember that i accidentally found out that unplugging one disk on our family SUSE pc caused it to fail to mount entries from fstab (i know this now, back then i had no idea about linux) and it dropped you to root prompt
03:08 PM polprog: where i elegantly added my user to the sudo group (with help of the internet)
03:08 PM polprog: and put the disk back in
03:09 PM polprog: notabene that pentium 4 PC is now runing netbsd behind me, as a workshop "thin" client
03:09 PM antto: linux is "secure" but it can't grow legs to kick you off from butchering it physically
03:10 PM polprog: nothing can, unless you pay $$$ for a secure building
03:10 PM polprog: physical access beats all security
03:10 PM antto: stick it in a safe
03:10 PM antto: put a guard cat on the safe
03:11 PM polprog: hide the actual server under the floor tiles, if you do it right, nobody will find it
03:11 PM antto: or that, yeah
03:11 PM polprog: and the filesystem (over network) in the ladies restroom in the ceiling
03:11 PM antto: but still get a safe, and put trump in it
03:11 PM polprog: the only nerd-safe place lel
03:12 PM antto: so if someone tries to hack your server, hell spend hours cracking the safe, and then when he opens it - BOOM, eat this, pandora!
04:01 PM eszett: does an atmega respond (to avrdude), even without the smoothing capacitors and getting "dirty voltage" from USB?
04:05 PM polprog: it may or may not
04:05 PM polprog: just add the caps
04:26 PM nuxil: The USB specification states that the 5v is supposed to be +-5% under load, which translates to 4.75v to 5.25v.
04:26 PM nuxil: Most IC's designed for 5v should accommodate the +-5%
04:27 PM nuxil: But adding in a cap dosent hurt.
05:28 PM eszett: re. I had a disconnect, was there some answer to my question, meanwhile?
05:34 PM Aslak3: anyone got an AVR IC with microchip written on it? that's gonna be weird!
05:34 PM Aslak3: I assume they've kept the AT part prefix?
05:42 PM eszett_web: let's see if my inet connection is stable now
05:45 PM Casper: Aslak3: I hope they won't replace it with a PIC prefix
05:46 PM Casper: PICMEGA3284 o.O
05:46 PM Aslak3: :/
05:58 PM timemage: it's not really in their interest to piss all over it to make it theirs. particularly not this soon.
06:06 PM Casper: they will most likelly continue both lines for a while, then start integrating the AVR technology in their pic, then stop slowly the avr, will keep new parts for compatibility purpose but most likelly will tend to go more with pic
06:11 PM eszett_web: can someone tell me pls, if an Atmega responds to avrdude, even without decoupling caps and with "dirty" USB voltage?
06:13 PM timemage: eszett_web, maybe. not something you can count on.
06:22 PM eszett_web: timeage: hmm ok, I gonna test it by myself then
06:40 PM Casper: eszett_web: depend on speed, how much noise and if the brownout detector is enabled
06:40 PM Casper: should respond, but might error out
06:43 PM Aslak3: I've had reasonable results programming an avr jammed into breadboard, powered by the programmer with no decoupling caps.
06:43 PM Casper: same
06:46 PM Aslak3: At first I just wedged wires into the IDC connector. Then I made a IDC10 to DIP10 adapter with strip board.
06:50 PM eszett_web: Casper & Aslak: ye, I will setup my breadboard and give it a try
07:18 PM Casper: I succeded to flash a board without supply once...
07:18 PM Casper: I forgot to hook the power
07:19 PM Casper: the data power was enought
09:17 PM christner_home: Jartza: I figured out my issue from the other night.....
10:16 PM nuxil: Casper, you can actually run a chip without power on the vcc pin.
10:18 PM nuxil: David jones demostrating it, https://www.youtube.com/watch?v=2yFh7Vv0Paw
10:19 PM Casper: nuxil: seen way better than that
10:20 PM nuxil: its just a small demo showing its possible.
10:20 PM Casper: http://lh3.ggpht.com/micahjd/SNb7HTZfCvI/AAAAAAAAAeg/x35lnnlfH9g/s288/attiny85-rfid.jpeg <==== complete circuit
10:21 PM Casper: that's an inductor
10:21 PM nuxil: lol
10:21 PM nuxil: yea. put that chip in a magnetic field and it should power up. :p
10:22 PM Casper: it actually communicate
10:22 PM Casper: not just power up
10:22 PM Casper: http://scanlime.org/2008/09/using-an-avr-as-an-rfid-tag/
10:22 PM Casper: he coil actually powers the AVR through two of its I/O pins.
10:22 PM nuxil: nice .
10:22 PM Casper: Power filtering using the AVR’s die capacitance.
10:22 PM Casper: Very low voltage operation. (barelly over 1V)
10:22 PM Casper: The coil is the AVR’s clock source.
10:27 PM nuxil: anyway. that project is impressive.
10:28 PM nuxil: 2 parts :p
10:30 PM Casper: yeah
10:42 PM _ami_: Casper, correction, she :)
10:42 PM Casper: as long as it is not "it" then we're fine
10:42 PM Casper: ... for now...
10:43 PM _ami_: sure
11:17 PM day__ is now known as day