#avr Logs

Nov 09 2017

#avr Calendar

12:04 AM day__ is now known as daey
12:46 AM x7C3_ is now known as x7C3
01:26 AM nikomo_ is now known as nikomo
03:22 AM polprog: Emil: yeah i forgot about it. actually woke up in the middle of the night to note down to add isp there :P
03:23 AM polprog: Emil: its not finished yet. i need to find the crystal, etc
03:24 AM polprog: ill ground gnd too
03:24 AM polprog: agnd*
03:25 AM polprog: as i said its not done yet
03:26 AM polprog: i want the fuse and the diode is there to protect against reverse polarity (schhottky)
03:27 AM polprog: schottky because low vf
03:28 AM polprog: it willl also be small enough to be clocked with 32k768 crystal directly
03:29 AM polprog: anyway, ill finish it later... i dont know when im back from school
03:30 AM polprog: today we have some drama show for children about safe internet
03:30 AM polprog: ("dont talk to strangers")
03:31 AM polprog: and then local drama club has something
03:33 AM polprog: fun day
03:53 AM Thrashbarg_ is now known as Thrashbarg
04:02 AM JanC_ is now known as JanC
04:03 AM Emil: polprog: here's the thing with clocking at 32768
04:04 AM Emil: to avoid flicker
04:05 AM Emil: You nees to update all say 32 timwes a second
04:05 AM Emil: which is low as fuck already
04:09 AM polprog: ok, ill clock one timer externally
04:21 AM Ameisen: Is there a benefit to doing PWM manually setting pins, rather than using something like Arduino's AnalogWrite?
04:34 AM thardin: uhh analogWrite does pwm? the hell
04:35 AM thardin: you may or not want control of the pwm frequency, and the resolution
04:40 AM Ameisen: true
05:56 AM Emil: Ameisen: arsuino is shit
05:56 AM Emil: Ameisen: analogwrite eother uses the hardware pwm
05:56 AM polprog: the hal is shit
05:56 AM Emil: or ISR toggling
05:56 AM polprog: the hardware is medium
05:59 AM thardin: yes arduino has some weird abstractions
05:59 AM polprog: its weird cos its programming for nonprogrammers
05:59 AM polprog: but if you want an 8 year old to build a bluetooth controlled robot thrn its okay
06:00 AM polprog: you can expect primary school children to understand writing and reading from registers etc.
06:00 AM polprog: can't*
06:01 AM Ameisen: Why not?
06:01 AM Ameisen: The beatings shall continue until understanding of low level programming improves.
06:01 AM Emil: polprog: buklshit
06:01 AM Emil: polprog: I actually think thay
06:02 AM Emil: 8 year olds can more easily understand fixed sized registers
06:02 AM Emil: than.abstract datatypes like ints
06:02 AM thardin: young people absorb knowledge quite easily
06:02 AM thardin: if you teach them asm they'll learn it
06:03 AM Emil: yup
06:03 AM thardin: lunch!
06:03 AM Emil: id you make it a game thats enganging they'll learn by themselves
06:11 AM Lambda_Aurigae: the earlier you start teaching them the better they grasp the concept.
06:11 AM Lambda_Aurigae: teaching them to write bloatware with bloatware just results in windows 10 again.
06:20 AM Emil: yup
06:31 AM polprog: prohramming for n o n p r o g r a m m e r s
06:31 AM polprog: which doesnt meannthey should not learn programming
06:31 AM polprog: they should do
06:32 AM Lambda_Aurigae: I find that 12 is a good age to start programming for most kids.
06:33 AM Lambda_Aurigae: most 8 year olds don't have the concept of action-reaction that is needed to program...."do this and that happens" just hasn't sunk in yet.
06:34 AM thardin: I started around 11-12 I think
06:34 AM Lambda_Aurigae: I started electronics at 8 and programming computers at 12.
06:35 AM Lambda_Aurigae: I teach kids here during the summers and younger than 12 just don't have the mindset for the most part...there are exceptions, but most of them just don't quite get it.
06:36 AM Lambda_Aurigae: https://hackaday.com/2017/11/08/take-robby-home/
07:52 AM nuxil: mornings
07:52 AM nuxil: Lambda_Aurigae, are you around ?
07:52 AM Emil: whatcha need lambda for?
07:52 AM nuxil: dont need him was just gonna ask him something. :p
07:53 AM nuxil: but since you are here i can ask you
07:53 AM nuxil: :D
07:53 AM Emil: most of us have irc running all the time
07:53 AM Emil: you can pretty much just ask
07:55 AM nuxil: my shopping list is almost completed. and im about to get some more mcu's either more atiny85 or a ATMEGA324P-20PU . but i never messed around with this chip before. so im woundering. i use this setup for flashing the atiny85's http://www.instructables.com/id/Programming-the-ATtiny85-from-Raspberry-Pi/ will it work for a ATMEGA324P-20PU aswell ?
07:55 AM Emil: mateee
07:57 AM nuxil: i need to fill up on new parts. caps, resistors. prototype boards and so on. so if i can use this method on a atmega. im odering it along more atiny85's :D
07:58 AM nuxil: i know its not reccomended using a raspberry to do this since the gpio pins are 3 volts. but it works fine on atinys.
07:58 AM Emil: oh 324 is bigger than 328
07:59 AM nuxil: ups sorry..
07:59 AM nuxil: meant atmega1284p
08:00 AM nuxil: lol. i was looking at the atmega324p dont know why i pased it in :p
08:03 AM nuxil: Emil, thats why i ask. i want a new chip to mess around with and i was reccomended the atmega1284p by Lambda_Aurigae
08:05 AM Emil: I recommend atmega328pb
08:16 AM Jartza: attiny85 is enough for everything
08:16 AM Jartza: ;)
08:55 AM nux_ is now known as nuxil
10:50 AM nuxil: oh boy.
10:51 AM nuxil: Jartza, you can really do some magic with the tiny85, saw your video on YT.
10:51 AM nuxil: vga stuff
10:51 AM polprog: yeah, octapentaveega is state of the art
11:25 AM Lambda_Aurigae: I'm kinda around.
11:25 AM Lambda_Aurigae: at work...at lunch at the moment.
11:27 AM Lambda_Aurigae: so long as you run the atmega328 or atmega1284p at 3.3V you can use the rPI gpio to program it...but that limits your speed on the atmega chips.
11:27 AM Lambda_Aurigae: look at the datasheet....there is a max speed for 3.3V which is not the 20MHz max speed of the chip.
11:27 AM Lambda_Aurigae: try to run it at full speed at 3.3V and it will likely cause you all kinds of problems.
11:27 AM nuxil: i will only be running it at 3.3v when programming it
11:27 AM Lambda_Aurigae: but if you keep within the rated speed for the voltage you are running at then you are fine.
11:28 AM Lambda_Aurigae: so you will need 2 different crystals
11:28 AM nuxil: aww. :p
11:28 AM Lambda_Aurigae: or,,,keep to one lower speed.
11:29 AM Lambda_Aurigae: it is possible to run with a 20MHz crystal and keep the div8 fuse programmed...then turn that off in code
11:29 AM Lambda_Aurigae: so you can program it at lower speed/voltage then your code can disable the div8 when it runs and kick the chip up to full speed.
11:29 AM Lambda_Aurigae: the other thing you can do is build a voltage level shifter to protect the rPI and run the atmega at 5V
11:30 AM nuxil: yea i belive i seen some code that did that
11:30 AM nuxil: tonz of shmitt triggers will do :p
11:31 AM nuxil: i think
11:32 AM polprog: there are already readymade converter chips
11:32 AM Lambda_Aurigae: yup.
11:32 AM Lambda_Aurigae: lots of them.
11:32 AM Lambda_Aurigae: or
11:33 AM Lambda_Aurigae: get a real programmer.
11:33 AM Lambda_Aurigae: or
11:33 AM Lambda_Aurigae: if you have a parallel port, make an stk200 programmer and be done with it.
11:33 AM Lambda_Aurigae: and don't say new computers don't have parallel ports because I just bought one last week, an i7 with a gigabyte motherboard, that has both parallel and serial ports.
11:33 AM polprog: what does stk200 stay for?
11:34 AM Lambda_Aurigae: stay?
11:34 AM Lambda_Aurigae: stand?
11:34 AM polprog: mean
11:34 AM nuxil: stk200 programmer.. o.0 wow it costs over 100bucks
11:34 AM polprog: santd lol
11:34 AM Lambda_Aurigae: it's just the model.
11:34 AM Lambda_Aurigae: costs?
11:34 AM polprog: he means the original one
11:34 AM Lambda_Aurigae: you use a few resistors between parallel port and the chip.
11:34 AM Lambda_Aurigae: or a 74ls244 or 74ls125 chip if you want a buffer.
11:35 AM nuxil: like this one ? http://www.sbprojects.com/projects/stk200/stk200.png
11:35 AM Lambda_Aurigae: 4 different stk200 clone programmers you can build.
11:35 AM polprog: nuxil: yeah
11:35 AM Lambda_Aurigae: yup..that works.
11:35 AM nuxil: but.
11:35 AM Lambda_Aurigae: https://sites.google.com/site/emrirc/avrisp-unbuffered.gif
11:36 AM polprog: but what
11:36 AM nuxil: why paralellport cant this work with the gpio ? i dont have suck a old pc with paralell port :p
11:36 AM nuxil: *such
11:36 AM Lambda_Aurigae: I use a 74ls244 based programmer similar to this.
11:36 AM Lambda_Aurigae: gpio on an rPI is 3.3V and not 5V tolerant...so you need a level converter if you want to run the avr at 5V
11:37 AM nuxil: i have shmitt triggers laying around.
11:37 AM polprog: they should work imo
11:37 AM polprog: i made level coverters with mosfets
11:37 AM polprog: single mos per line
11:37 AM Lambda_Aurigae: if you can make a 5V level converter..then you are good to go.
11:38 AM Lambda_Aurigae: really you only need to keep the 5V levels from the chip down to 3.3V so you can, in theory, just use some diodes on the lines that feed from the avr to the rPI to drop the voltage.
11:38 AM polprog: https://i.stack.imgur.com/gS3SS.jpg
11:38 AM polprog: this sould work, i think it's bidirectional
11:38 AM polprog: be right back
11:38 AM Lambda_Aurigae: the lines from the rPI to the AVR will be fine...unless the AVR happens to turn one of them on as an output,,then the rPI is fried.
11:38 AM nuxil: yea. get about 0.6 drop on each diode
11:39 AM Lambda_Aurigae: but, as I said earlier, not all new computers come without parallel ports.
11:39 AM Lambda_Aurigae: I also have multiple i5 laptops with parallel ports either built in or in a little docking base.
11:39 AM Lambda_Aurigae: so, parallel port is still available out there.
11:39 AM Lambda_Aurigae: and, heck, it's not hard to scrounge an old p-4 or something and put linux on it for the sole purpose of programming chips.
11:40 AM nuxil: i need to go dumpster diving for that :p
11:40 AM Lambda_Aurigae: ask around.
11:40 AM Lambda_Aurigae: heck, my customers have them laying around all over the place and they have no clue what to do with older computers.
11:41 AM Lambda_Aurigae: I have a pile of probably 20 p-4 class machines sitting at home...both laptop and desktop styles.
11:41 AM nuxil: o.O
11:41 AM Lambda_Aurigae: people give them to me when they find out what I do with them.
11:42 AM Lambda_Aurigae: I refurb them, put linux on them, and give them to low income families who don't have computers.
11:42 AM nuxil: nice :D
11:42 AM Lambda_Aurigae: and/or give them to my students in the summer to learn electronics, microcontrollers, and robotics with.
11:42 AM nuxil: that verry nice of you
11:42 AM Lambda_Aurigae: it costs me nothing but time and gets me lots of good will around the community.
11:43 AM Lambda_Aurigae: and recycles what would otherwise be thrown in the dump.
11:43 AM polprog: now that i think about it this mos circuit is rather a limiter not a level shifter
11:44 AM Lambda_Aurigae: polprog, you could just use some 3.3V zeners between the i/o pins and GND
11:44 AM Lambda_Aurigae: that will limit the voltages and do the job.
11:44 AM polprog: yeah, there are multiple ways to do that
11:44 AM Lambda_Aurigae: that's how many of the usbasp clones do it.
11:44 AM Lambda_Aurigae: D+ and D- on the usb port are 3.3V lines and NOT 5V compliant.
11:44 AM Lambda_Aurigae: so they just put a couple of zeners on them
11:44 AM polprog: once i used a pink led instead of a 2V zener (pink leds which are in reality blue have about 2.5V Vf)
11:44 AM Lambda_Aurigae: and run the avr at 5V directly from vUSB
11:45 AM Lambda_Aurigae: zener is used for the reverse breakdown usually.
11:45 AM polprog: i know
11:45 AM Lambda_Aurigae: although, sometimes they are used because of their unique forward voltage characteristics
11:45 AM polprog: so i could use a reverse polarized zener which i dont have or a forward polairized pink led i bough for shits and giggles
11:46 AM polprog: what's so unique about that forward characteristic
11:46 AM Lambda_Aurigae: saw a circuit that used them to actually do a voltage shift...it was a really screwy circuit but it ended up giving 2 to 5 voltags rather than 0 to 5 volts..
11:47 AM Lambda_Aurigae: the voltage drop on a zener is different from your average silicon or germanium diode.
11:47 AM Lambda_Aurigae: LEDs are similar in that their drop is a bit different from most regular signal diodes.
11:49 AM polprog: how different?
11:49 AM polprog: not 0,7V i see but is that all?
11:49 AM Lambda_Aurigae: pretty much, yeah.
11:49 AM polprog: lol
11:50 AM polprog: i was looking for some unique curve etc
11:50 AM Lambda_Aurigae: oh...not really.
11:50 AM polprog: i really like schottky diodes
11:50 AM Lambda_Aurigae: make a bridge rectifier out of zeners and watch what happens...it's fun.
11:50 AM polprog: i believe it is
11:50 AM polprog: ;)
11:51 AM polprog: probably gives some cool waveform
11:52 AM nuxil: Can i use a normal voltage divide back to the pi? since source is 5V and i use something like. r1 = 5k r2=10k ~ 3.3v over r2.
11:52 AM nuxil: *divider
11:53 AM Lambda_Aurigae: you cn
11:53 AM Lambda_Aurigae: can
11:53 AM polprog: Lambda_Aurigae: wow that's cool
11:53 AM polprog: http://tinyurl.com/yaryzyfv
11:53 AM Lambda_Aurigae: that's one way of getting a voltage level conversion.
11:54 AM Lambda_Aurigae: fun stuff, eh?
11:54 AM Lambda_Aurigae: try it with schottky diodes too.
11:55 AM polprog: one sec ;)
11:56 AM polprog: odd falstad doestn have schottky diodes so i used a normal one with low vf and it just gives me a normal rectifier
11:57 AM Lambda_Aurigae: yeah..regular diode responds different.
11:58 AM Lambda_Aurigae: it's a sharper response
12:13 PM pitastrudl_ is now known as pitastrudl
12:39 PM nuxil: Lambda_Aurigae, im looking at the avrisp-unbuffered.gif picture you posted, is it only the MISO i need to reduce to 3.3v for my pi right, its the only return bus right?
01:08 PM polprog: Master In Slave Out
01:08 PM polprog: sounds about right
01:10 PM polprog: 0:50 lol https://www.youtube.com/watch?v=jHbI_B2sPA0
01:49 PM nuxil: alot of this is due to human error
01:49 PM nuxil: not calulating correct bor lenght :p
01:51 PM nuxil: 1.15 into it surly looks like so
02:46 PM JanC_ is now known as JanC
03:46 PM polprog: nuxil: behind every computer error there are two human errors, including blaming the error on the computer
03:47 PM polprog: nuxil: nevertheless it just looks hilarious how the drill breaks of the thing when backing out :P
08:36 PM Snert: words for the wise. sounds 'bout right :)
10:28 PM paul_: Hello, I'm trying understand how boot loaders are implemented on the ATTINYxx controllers.
10:28 PM paul_: The ATMEGA series appear to have fuses, and what not, that allow a boot loader partition to be defined and used on chip reset.
10:29 PM paul_: On the ATMEGA, it seems straight forward ... flash a chip with a boot loader of choice then subsequent application flashes just leave that area alone.
10:29 PM paul_: However, I'm failing to see how boot loaders are implemented on ATTINY chips.
10:30 PM paul_: I can see that they exist, but I'm struggling to find any sources that explain how it's actually achieved from flashing to booting.
10:30 PM paul_: Any able to shed some light?
10:31 PM Tom_itx: never tried a bootloader on a tiny
10:32 PM paul_: One example would be ATTINY as Arduino.
10:32 PM paul_: But it's not clear to me how that's implemented.
10:10 PM cehteh: just as is, code starting up with no hardware protection/section
10:11 PM cehteh: look at the micronucleus bootloader
10:11 PM cehteh: iirc they dont even have their own interrupt tables
10:15 PM paul_: I see. The Arduino scenario I gave isn't actually a bootloader. They just appear to set the fuses and nothing else during the "Burn bootloader" operation. TinySafeBootloader is interesting.
10:20 PM paul_: From what I can micronucleus and other such boot loaders rely on the Makefile / compilation to get all the addressing worked out.
10:21 PM paul_: Would that be right?
11:32 PM day__ is now known as daey