#avr Logs

Jan 11 2018

#avr Calendar

12:04 AM Jartza: christner_home: what was it?
12:23 AM Emil: Casper: it was done years ago by spritz also
12:23 AM Emil: spritesmod*
12:24 AM Emil: s
12:24 AM Emil: and even before by somone else
12:42 AM Casper: possible
01:54 AM day: antto: well in that case most people would likely go for ARM anyhow, dont you think?
02:02 AM Haohmaru: day if they need 4K RAM?
02:04 AM day: Haohmaru: the arm chips start pretty cheap.
02:10 AM Haohmaru: so, 8bit with less than 4K ram or 32bit arm
02:10 AM Haohmaru: AVRs are useless
02:10 AM Haohmaru: there is no gray, only black and white
02:14 AM ok9swl: dgriffi: Hi, any progress yesterday?
02:21 AM Emil: Haohmaru: if development costs are the biggest obstacle then AVRs outshine everything
02:38 AM day: Emil: why are dev costs lower for AVRs than they are for ARMs?
02:48 AM Haohmaru: you can start messing with AVR with just a bare computer running linux with a parallel port and some tiny amount of DIY stk200
02:59 AM Emil: day: because getting started is over 9000 times easier, its 100% open source which means you can run the tools in any way you want (allows remote development and testing, headless development and so on)
02:59 AM Emil: day: and the documentation is awesome
03:00 AM Emil: the hardware is of course pretty obsolete but that's besides the poiny
03:00 AM day: true the arm docu isnt exactly easy to digest. but im working on my stm32 with exclusively opensource tools
03:00 AM day: at least i think i am
03:01 AM abcminiuser: I got an invite to https://github.com/madChopsCoderAu and I have no idea what the hell is going on
03:01 AM abcminiuser: The...err...explainer repo is not forthcoming with details...
03:02 AM Emil: day: mate, write a emil.fi/avr (just the software and getting it is enough, no need for fancy ascii art or hardware things)
03:02 AM Emil: I'll jump ship to arm instantly
03:02 AM Emil: :D
03:03 AM day: a blinker tutorial? O.O
03:04 AM _ami_: abcminiuser, https://github.com/madChopsCoderAu/why-did-you-get-an-invite-
03:05 AM abcminiuser: _ami_, indeed, now I need someone to explain that to me
03:05 AM Emil: day: its enough
03:05 AM Emil: day: also close to hardware is ofc bettwe
03:07 AM day: opencm3 has working blink examples
03:07 AM Emil: openmc3 is shit, though
03:07 AM Emil: :D
03:08 AM day: i cant judge that, but ive run into some "issues". but im not sure if i was the problem or the lib
03:15 AM _ami_: meh! Emil !
03:15 AM _ami_: opencm3 is far better than other stm32 libraries (even official stm32 lib)
03:19 AM _ami_: you can use this template to kickstart your learning ARM journey! https://github.com/amitesh-singh/libopencm3-proj-template
03:20 AM _ami_: and default program blinks the led.
03:21 AM Emil: >meson
03:21 AM Emil: >ninja
03:21 AM Emil: yeaaah aint gonna touch it :D
03:22 AM _ami_: Emil, are you makefile fan?
03:45 AM Emil: _ami_: no
03:45 AM Emil: _ami_: but getting there :D
06:59 AM Emil: God damn premature optimisation :D
07:00 AM Tom_L: i read that wrong the first time... good i re'read it
07:05 AM jragon: Is there a graphics library for TFT displays floating about (idealy for the ILI934x driver)? I've got some simple functions and can draw boxes and text easily enough but programming with just those functions is time consuming
07:09 AM nuxil: http://download.mikroe.com/documents/compilers/mikrobasic/avr/help/tft_library.htm ?
07:13 AM Aslak3: In my day men were men and wrote their own graphics routes ;)
07:45 AM nuxil: hmm. i just read the news. i see elon musk is quitting as CEO in tesla and starting to focus on FinTech. he invested $100 millon into it.
07:45 AM nuxil: and if you go look at the video " https://www.youtube.com/watch?time_continue=4&v=H9jRznr07UI "
07:45 AM nuxil: it sounds like a big scam
07:45 AM nuxil: only 7member per day bla bla. typical scam stuff :p
07:47 AM jragon: Aslak3: Fair enough, I'm just lazy :)
07:48 AM nuxil: no need to reinvent the wheel if you there is already one made that fits your needs :p
07:48 AM Aslak3: I thought FinTech was something about fishes. Obviously not.
07:49 AM nuxil: i thought it was some finnish firm :p
07:50 AM nuxil: my mind sees. Fin and i think about findland :p
07:56 AM nuxil: anyway. im sure FinTech is not a some scam. it just looks & feels like it after seeing that video.
07:58 AM Aslak3: that fintech ltd video is your perfect update to the ponzi schemes of old
07:58 AM Aslak3: I can't believe how anyone would fall for that crap
08:07 AM jragon: nuxil: That looks great! But it seems like proprietary software :(
08:08 AM nuxil: yea sign up. and you might be lucky, as video said. they accept only 7 member each day.
08:10 AM nuxil: Aslak3, well, elon musk with $100 million did :p
08:10 AM day: looks like musk needs some money after burning through too much :P
08:10 AM jragon: sorry, that was in reference to the mikroe avr tft library. Also I think it's written in basic?
08:11 AM nuxil: port it to C :)
08:11 AM jragon: I don't think it's open source
08:11 AM nuxil: :(
08:12 AM Aslak3: https://github.com/flungo-avr/ili934x-driver ?
08:13 AM Aslak3: lots of people have fallen for this fintech ltd. more money then sense?? :/
08:13 AM jragon: I was looking at that. He said he wrote a 2d graphics lib, text lib and graph lib. I've only managed to find the graph lib
08:15 AM Aslak3: bbl
08:15 AM nuxil: time to take a nap
09:24 AM jragon: nuxil: if you're interested, this is what I've discovered: http://embeddedlightning.com/ugui/
09:25 AM jragon: It's pretty cool! It just uses draw pixel function which you pass to it. So it's platform independent
09:26 AM jragon: Just to double check: Functions I don't use will be optimized out by the compiler right?
09:54 AM [1]MrMobius is now known as MrMobius
10:05 AM Emil: yes
10:05 AM Emil: like in all C code
11:43 AM Jartza: evening
11:55 AM christner: Jartza: the short version - I'm an idiot
11:56 AM christner: the still short but complete version - I didn't have the mmcu flag set to atmega328p @ link time
12:27 PM Jartza: christner: well, you learn from your mistakes, don't you ? ;)
12:28 PM polprog: i once spent an hour changing code and hitting the upload button just to realize there was a surplus brakcet at the end of the file and it wasnt creating the new executable... i was wondering why the changes i made in code dont appear on the mcu
12:29 PM Jartza: stuff happens
12:29 PM Jartza: I also love how broken cmake is
12:30 PM Jartza: changed one pin *name* in code and made small small other changes
12:30 PM Jartza: suddenly the code just kept on crashing in the beginning
12:30 PM Jartza: spent some good few hours debugging what happens, on a platform that's *very* hard to debug
12:31 PM Jartza: in the end. cmake was drunk. it just didn't compile everything correcly but used some already compiled .o files instead
12:31 PM polprog: hahaha
12:32 PM Jartza: also. cleaning all didn't help either. I had to basically recreate the build folder, create cmake config from scratch and rebuild.
12:34 PM polprog: rm -rf * && git pull
12:34 PM Jartza: no git pull necessary fortunately :)
12:35 PM Jartza: but had to delete build folder, create new cmake config and rebuild from scratch
12:35 PM Jartza: there's few thousand files in the project :)
12:36 PM polprog: wow
12:36 PM polprog: avr project or something else
12:47 PM Jartza: ahh, no avr projects at work, mostly
12:47 PM Jartza: usually some cortex-m ones
12:48 PM Jartza: I think I've done only 2 avr projects to customers
01:43 PM christner: Jartza: sadly, probably not, I'm sure it won't be the last time. CMake and I have a love hate relationship.
01:44 PM christner: polprog: I did something like that yesterday, I kept reflashing the board without realizing that I wasn't rebuilding when I ran the avrdude command directly. That got me laughed at more than a bit.
01:44 PM polprog: hah
01:45 PM polprog: i define a flash target in makefile so i can just make && make flash
01:45 PM Jartza: christner: you identified the problem eventually, I call that learning :)
01:46 PM christner: Yea, I had set that up, but I was jumping between different boards to verify and I ended up running the flash command directly instead of swapping the makefile each time
01:46 PM christner: (I finally got wise and just added a target for each)
01:47 PM christner: Jartza: yea, I went through each bloody flag that the arduino ide was putting out, each file, I even went through the init and main.cpp that the arduino uses to be sure that the code that I was using was EXACTLY the same.
01:48 PM Jartza: :)
01:48 PM Jartza: so. not an idiot.
01:49 PM christner: ,--8<-
01:49 PM christner: |well, not an idiot doesn't pull his engine apart trying to figure out why his tire is flat. but thanks for the laughed at more than a bit.
01:50 PM christner: |14:44 < polprog> hah
01:50 PM christner: `-->8-
01:50 PM christner: computer fart...
01:50 PM christner: *well, not an idiot doesn't pull his engine apart trying to figure out why his tire is flat. but thanks for the positivity!
01:52 PM polprog: hm?
01:53 PM christner: I think i hit my center mouse button and pasted a bunch of junk in, sorry about that
01:59 PM polprog: ah
03:26 PM eszett: hi
03:26 PM eszett: I have a question, does the atmega respond to avrdude (resp. the programmer), even without extternal crystal attached?
03:27 PM antto: depends on fuses
03:29 PM eszett: yew right now im browsing the datasheet for the fuse settings
03:32 PM eszett: it says "The device is shipped with Low Power Crystal Oscillator (8.0MHz-16MHz) enabled and with the fuse CKDIV8 programmed, resulting in 1.0MHz system clock with an 8 MHz crystal." that is, when I take the default fuse settings, it should respond.., right
03:33 PM eszett: I have to external clock attached.. however it doesnt respond
03:34 PM eszett: I soldered a new PCB together, with a new blank ATMega32u4, and it is still the same. The chip doesnt respond in avrdude, if I'm trying to initialize it
03:34 PM timemage: eszett, iirc, the 32u4 has different order codes for how the clock fuses are set
03:35 PM eszett: how do I know which fuse setting my chip has by default (from factory)?
03:35 PM timemage: eszett, anyway, if you have to, you can drive the clock-in pin with a square wave. as long as it's something like 8 times isp clock rate, it should respond.
03:35 PM timemage: eszett, the order code.
03:36 PM eszett: don't know the order code anymore, I bought them from a private person some years ago via ebay
03:37 PM timemage: eszett, i dunno that there are any markings on the chip.
03:37 PM eszett: timemage: however. my guess is that the problem isn't related to the clock, since my first PCB didn't respond with an external crystal attached, and another one doesn't respont with no crystala attached.
03:38 PM eszett: maybe I soldered the atmega in a wrong orientation in, but I doubled checked that
03:39 PM timemage: eszett, what are you using for a programmer?
03:39 PM eszett: I've got a cheap USBasp. and a bus pirate. Both work with other circuits.
03:39 PM eszett: The programmer devices shouldnt be the problem either
03:40 PM timemage: eszett, yeah, i never know where someone is at with things. i take it you know your target it powered correctly and all that as well.
03:40 PM eszett: I consolidated the wiring of the interface (betw. programmer and PCB), by soldering the jumper cables in, so that should be the problem either.
03:41 PM eszett: should'nt
03:41 PM timemage: eszett, yeah, i guessed that's what you meant.
03:41 PM christner: aren't you not able to directly program fuses on the atmega?
03:42 PM eszett: I'm not able to do this
03:42 PM christner: Don't you need an intermediate programmer to do that?
03:42 PM eszett: which one?
03:43 PM christner: alot of places say to use an uno I think
03:43 PM eszett: well, but with an duino what is different: the chip has to respond to the programmer first, before I can change the fuses. no
03:43 PM eszett: ?
03:44 PM christner: You are just using the arduino as an isp to burn the fuses
03:44 PM christner: h.o, still googling
03:45 PM HelloShitty: Hello
03:45 PM eszett: basically the bus pirate i'm using is capable of doint that, but the atmega has to respond first
03:45 PM HelloShitty: Does anyone know of a diode capable of handling about 80Khz in a buck converter?
03:51 PM eszett: what the heck. I think I gonna solder some jumper wires directly to the pins of a brand new atmega, and try to talk to the chip with avrdude again.
03:51 PM eszett: then it should respond, no
03:51 PM timemage: eszett, nothing really. it's common for arduino users to run a sketch that makes arduino behave roughly like an avrisp. some of have taken to just suggesting people don't because often they don't follow the directions, in particular defeating the dtr reset feature of on uno when it's used as a programmer. anyway, there's nothing about using an arduino as a programmer than's going to give an advantage over a bus pirate or usbasp.
03:52 PM eszett: timemage: yes
03:53 PM eszett: I'm trying to narrow the source of trouble down, but the problem is well hiding.
03:54 PM timemage: eszett, i dunno. if you have clear images of the wiring, the commandlines in use, etc, maybe i'd notice something. your programmer at least shows the voltage its sampling right?
03:54 PM timemage: eszett, the usbasp, i mean.
03:56 PM eszett: I'm not sure how do make it display the voltage
03:56 PM eszett: I have rudimentary knowledge about avrdude's command line yes
03:57 PM timemage: eszett, i'm not entirely sure the usbasp can, but "parms"
03:57 PM eszett: parameters yes
03:57 PM timemage: eszett, i know the dragon will. though offhand i dunno if avrdude reads it. atmel's stuff does.
03:59 PM timemage: eszett, maybe not, i'm looking at some documentation for it. i see it has a 5v/3.3v selection jumper.
03:59 PM eszett: yep, the jumper is set correctly to 5v
03:59 PM timemage: eszett, so it's not sampling, i guess. it's providing 5v to the target
03:59 PM eszett: yes
04:00 PM timemage: eszett, okay.
04:00 PM eszett: do you know the difference between error code rc-2 and rc-1 of avrdude?
04:00 PM eszett: I get rc-2
04:01 PM eszett: rc=-2 to be more precise
04:01 PM timemage: eszett, what does your avrdude command-line look like?
04:02 PM eszett: sure one moment
04:02 PM eszett: https://i.imgur.com/aUv1v3e.png
04:03 PM timemage: eszett, do you have a scope or logic probe or something so you can see the reset line fall when you run that?
04:05 PM eszett: unfortunately no, I orderd a new multimeter some days ago, since my old one isnt relieable anymore
04:05 PM timemage: eszett, might not show on a multimeter. would be so quick. though, in theory you could just lower it yourself.
04:06 PM eszett: I see..
04:07 PM timemage: eszett, what does reset look like on the board? is it the usual thing of pulled high by 10k or so?
04:08 PM eszett: yes, it is pulled up by a 10k
04:08 PM eszett: shall I measure voltage at RST while having the chip connected to my programmer?
04:09 PM timemage: eszett, usually programmer just pull it low when they communicate. so it may only by down long enough to get no-response. microseconds to milliseconds. so if you put a meter on it, it'll probably just read high.
04:10 PM eszett: dang, so trhat won't help me
04:59 PM timemage: eszett, well, if you get bored, post whatever. images, schematics, etc. you might learn something with extra -v in avrdude.
05:10 PM eszett: yep, know that parameter
05:11 PM eszett: timemage: can you tell me, which wires are absolutely necessary to make the chip respond: do I need all six: VCC, GND, MISO, MOSI, CLK, and RST?
05:11 PM timemage: eszett, typically all of them.
05:12 PM eszett: because soldering them to the pins of the chip is abit tricky
05:12 PM timemage: eszett, i imagine it would be.
05:12 PM eszett: =)
05:14 PM timemage: eszett, from the chips perspective they all have to be connected to something. the programmer could probably not have reset connected if you manually activated it at the right times. vcc may or may not have to go to the programmer, usually it does. either the traget is powering the programmer or the programer is powering the target, or the target is powering the target side of a voltage level conversion circuit. miso and mosi are serial in an
05:14 PM timemage: out. in needs a command in to respond to. it needs the output pin to send the response.
05:15 PM timemage: eszett, depending on your programmer and target and how they're powered, there are times when you could probably disconnect vcc.
05:16 PM eszett: ye. maybe I could try to have the PCB be powered by USB, while having the programmer connected and initializing..?
05:16 PM timemage: eszett, yeah, you may have to be careful with voltage matching.
05:17 PM timemage: eszett, if i were going to do that i'd probably add some inline resistance to miso, mosi, clk, and drop the isp bit rate.
05:17 PM eszett: ok, so I connect the programmer with CLK, MISO, MOSI, and RST only, without VCC and GND. while having the PCB powered by USB
05:17 PM eszett: the atmega is pretty robust, it should survive it
05:18 PM LeoNerd: You want ground
05:18 PM LeoNerd: You always want ground
05:18 PM nuxil: indeed
05:18 PM timemage: eszett, maybe, but there isn't any need to rely on that. 1k or so of inline resistance shouldn't hurt.
05:18 PM eszett: ok
06:10 PM day__ is now known as day
06:38 PM shifttymike is now known as Guest7184
06:53 PM dgriffi: ok9swl: I think the tones are within the 1.8 percent margin of error.
06:54 PM dgriffi: ok9swl: much of my frustration came from using DTMF recognition apps on Android... all of which I now realize stink.
06:55 PM timemage: dgriffi, too strict or too forgiving?
06:55 PM dgriffi: timemage: too strict, I think.
06:58 PM eszett: lil question. Is buying this device a reasonable method to validate functioning of chips before soldering them in? https://de.aliexpress.com/item/Free-shipping-CHIP-PROGRAMMER-SOCKET-TQFP44-QFP44-PQFP44-TO-DIP40-adapter-socket-support-MCU-51-chip/32280177562.html
06:59 PM dgriffi: timemage: I found that the android apps would react better to a Radio Shack tone dialer that uses a UM9559E DTMF generator. That thing is able to produce more accurate tones to within 0.74 percent. Mine is about 1 percent.
07:00 PM dgriffi: timemage: and I had it explained to me on avrfreaks that the reason for this is the system timer being derived from dividing down the crystal frequency
07:00 PM timemage: eszett, pretty sure "yes".
07:00 PM eszett: timemage: good, then i'll order!
07:01 PM dgriffi: eszett: what sort of chips are you checking over?
07:01 PM timemage: eszett, i dunno that you'd want to try to run a crystal down/up those connections. but you could do a lot with it.
07:02 PM eszett: dgriffi: the atmega32u4, do you know it?
07:02 PM timemage: dgriffi, yeah. kind of like using baud rate compatible crystals.
07:03 PM timemage: dgriffi, or 'color crystals'
07:03 PM dgriffi: eszett: I don't do much with surface-mount AVRs
07:03 PM eszett: the internal clock maybe sufficient for testing purposes
07:03 PM dgriffi: timemage: I suppose color crystals were used because they were so very very common
07:04 PM dgriffi: I'm using a 20MHz crystal.
07:04 PM dgriffi: someone suggested using a color crystal to run my ATtiny85... I'm not sure that would be a good idea.
07:13 PM eszett: dgriffi: so youre working with good ol DIP MCUs?
07:14 PM dgriffi: eszett: yep
07:14 PM eszett: nice.. I wish I could, but space and height is restricted.
07:15 PM eszett: modern MCUs arent produced as DIP anymore, even..
07:16 PM eszett: probably our grandchildren will solder with microscopes only.
07:16 PM dgriffi: I do a lot of stuff where my customers are people who like the old Heathkit approach
07:17 PM dgriffi: I am working on a variant of this bluebox project which would replace the board in a Radio Shack toner dialer. That one will be surface-mounted.
07:18 PM dgriffi: this is the prototype: https://www.flickr.com/photos/32548582@N02/29668476264 https://www.flickr.com/photos/32548582@N02/29668476574
07:19 PM dgriffi: eszett: I wouldn't say that modern MCUs aren't in DIP anymore. The chipmakers seem to realize that amateur tinkering is a big customer base.
07:20 PM timemage: dgriffi, huh, i just looked at a few dtmf generator chips. they do seem to like using color crystal frequency. wondering if the dtmf spec planned for that.
07:22 PM timemage: dgriffi, iirc, they used dtmf for signaling things broadcast tv also.
07:35 PM timemage: dgriffi, well, i guess not. i don't completely understand what i'm reading yet, but it's not related so far as i can tell.
08:08 PM dgriffi: timemage: I know they used dtmf for broadcast TV. I used to hear it all the time.
08:09 PM timemage: dgriffi, turns out to be unrelated anyway.
08:09 PM dgriffi: also is used for controlling stuff over radio links... repeaters, emergency equipment, etc.
08:10 PM timemage: dgriffi, yeah, although my guess is the use in broadcasting is older than much of that. was thinking they might have chosen the frequencies for use with color crystals. not the case it seems.
08:17 PM dgriffi: last time I checked, the frequencies were choses so that there would be no harmonics to possibly cause false triggering
08:20 PM timemage: dgriffi, yup. although i guess it's more prone to problems than they'd hoped.
08:20 PM dgriffi: well, I'm glad the tolerance is reachable with a microcontroller
08:21 PM timemage: http://www.repeater-builder.com/tech-info/dtmf/dtmf.html
08:21 PM dgriffi: as-is, my tones just barely make it within tolerance
08:21 PM dgriffi: I'm thinking of tweaking each of the tones I need and call it done.
08:21 PM dgriffi: that seemed to work okay with the DTMF ones.
08:22 PM rue_: fft?
08:23 PM dgriffi: rue_: that's how I've been checking the accurancy
08:24 PM dgriffi: rue_: I feed the tones into Audacity on my Linux box, run a FFT, and see where the peaks are.
08:24 PM dgriffi: rue_: see https://github.com/DavidGriffith/bluebox-avr/issues/2 in case you're interested.
08:38 PM rue_: I think the selectivity of a fft is the same as a comb filter
11:59 PM day__ is now known as day