#avr | Logs for 2015-10-14

Back
[05:13:50] <FrankD> ugh
[05:13:54] <FrankD> prototype boards with errata
[05:16:36] <FrankD> http://tinyurl.com/p2fkhce
[05:16:53] <FrankD> note to self: attiny is SOIC-20, not SOIC-24.
[05:16:58] <FrankD> ^1634
[05:18:17] <FrankD> http://tinyurl.com/nkmm8dt <-- with my shit soldering skills, trying to get that TSSOP-28 ADC in should be fun!
[05:20:28] <Jartza> FrankD: hint: flux. lot of flux.
[05:21:01] <Jartza> with flux, it gets easy
[05:21:08] <FrankD> hmm
[05:22:06] <FrankD> well
[05:22:21] <FrankD> atleast I traced the ICSP lines to the right places, aside from the reset line
[05:22:33] <FrankD> which is why theres that big solder bridge :P
[05:23:16] <FrankD> ah well, lessons learned for the next iteration i guess
[05:23:20] <Jartza> flux & solder braid / wick ftw
[05:23:32] <Jartza> yeah, it's all good learning :)
[05:23:37] <FrankD> yeah, i also need to rescue the ADCs when I get new boards in :D
[05:23:42] <Jartza> mistakes, we all make them :)
[05:24:26] <Jartza> mistakes are only bad if you don't learn from them
[05:24:59] <FrankD> yeah i really thought i placed an SOIC-20 down
[05:25:06] <FrankD> went to put the chip on the board and was like o.O
[05:25:15] <FrankD> thank god i barely use any pins on the avr
[05:27:17] <Jartza> :)
[09:30:54] * gorroth thinks he's going to figure out how to write a bootloader so he can install software on his AVR over UART insead of SPI
[09:31:08] <gorroth> then i can program it even if it's from a xbee radio
[09:31:59] <LeoNerd> UART BLs can be fun
[09:32:29] <gorroth> yeah. i don't know how to write one yet, but i guess i'll look up some tutorials. i have a basic idea from a skim of the datasheet
[09:32:32] <gorroth> but nothing solid
[09:32:34] <LeoNerd> I recall seeing a bootloader that can read a file off the root directory of a FAT filesystem on an sdcard... in 4k
[09:32:42] <gorroth> oh really, lol
[09:32:53] <Strangework> What are we talking about? Writing bootloaders?
[09:32:57] <gorroth> yeah
[09:33:19] <gorroth> i'm going to write one for the UART so i can setup my AVRs more easily and also be able to program it from an xbee radio
[09:33:47] <Strangework> Sounds pretty solid
[09:34:06] <gorroth> yeah, now all i have to do is gain the knowledge and then do it, hehe
[09:34:34] <Strangework> First steps ;)
[09:34:46] * gorroth is only a level 4 mage and cannot force pull much knowledge from the surrounding auras quickly
[09:35:09] <Strangework> The native mage clans have much to teach you
[09:35:16] <gorroth> indeed
[09:36:05] <Strangework> Which chip are you using for your project, and do you have a breakout board?
[09:36:24] <gorroth> i'm using an atmega168, which is a pretty common chip and easy to use
[09:36:41] <gorroth> i have a breadboard. i'll put a breakout board on there for the xbee
[09:36:53] <gorroth> but i have some headers on there to keeep it connected to my rpi on spi and uart
[09:36:57] <gorroth> that's how i've been using it so far
[09:38:17] <Strangework> Very cool! I currently work with a similar setup: attiny24a, beaglebone and breadboard :))
[09:38:30] <LeoNerd> Bootloaders on a tiny are whole heaps more fun
[09:38:31] <LeoNerd> "fun"
[09:38:50] <gorroth> well, i've never written one; so, any of it will be fun for me :)
[09:39:08] <Strangework> Aside from a memory limitation, what other hurdles are there for the Tiny?
[09:39:10] <gorroth> at least i know my hardware works properly, since i can get a perfect 50 hz pwm signal out of it (and i know, because the motor is crap if the signal is dirty)
[09:39:27] <gorroth> Strangework: less pins
[09:39:39] <gorroth> oh, you mean for the software
[09:40:11] <LeoNerd> Strangework: the tiny doesn't have hardware support for separate bootloader vs. application memory sections
[09:40:12] <gorroth> i don't know. i do have some ATtiny chips, but i haven't used them yet... might be able to do it after i get a UART BL working
[09:40:22] <LeoNerd> So it's a lot easier for a buggy 'tiny bootloader to corrupt itself
[09:40:24] <gorroth> otherwise the SPI stuff interferes with the 16-bit PWMs
[09:40:37] <gorroth> ooooo
[09:40:45] <LeoNerd> Whereas, on a mega usually you can set the bootloader such that it cannot accidentally overwrite itself, only the app section.
[09:41:28] <gorroth> LeoNerd: on the mega, do you do that by setting some fuses?
[09:41:40] <gorroth> or with some registers the BL would access?
[09:42:10] <LeoNerd> Yes; one of the fuse bytes is almost entirely dedicated to bootloader settings; also the lock bits
[09:42:35] * gorroth opens his m88 datasheet
[09:43:19] <gorroth> LeoNerd: BLB01..12, basically?
[09:44:52] <LeoNerd> Yeah, those ones. Also read the entire chapter 27.
[09:45:01] <LeoNerd> Which is literally about self-programming BLs
[09:45:36] <gorroth> great, i was just looking for where it talkeda bout BL, because i know it did
[09:45:37] <rue_house> Buildout Latency!?
[09:45:39] <gorroth> thanks for pointing it out
[09:45:52] <gorroth> i will read ch. 27 while on downtime at work
[09:46:14] <gorroth> (my job is easy when it's easy and annoying when it's not... basically nowhere as hard as when i worked for a videogame company)
[09:46:18] <gorroth> so i get quite a bit of downtime
[09:47:40] <Strangework> What do you do professionally, gorroth?
[09:47:50] <gorroth> i'm a software engineer
[09:48:15] <gorroth> but i'm going to go back to school next year for either a phd or extra undergrad degree in math
[09:48:22] <gorroth> it will depend on what kind of program my wife gets into
[09:48:30] <gorroth> what about you, Strangework ?
[09:49:26] <Strangework> Software engineer as well :P Graduated from my undergrad a few months ago. Working with a startup developing aquaponic systems. I may go back to school for a masters in bioinformatics
[09:49:30] <rue_house> as a software engineer do you work vs train more or less thatn 50%
[09:50:30] <gorroth> sounds cool; i work for a startup in chicago doing ad/marketing kind of data stuff
[09:50:41] <gorroth> was in a california startup to work on videogames, but the housing market drove me out
[09:50:46] <gorroth> otherwise i'd stay, b/c i loved that job
[09:51:11] <gorroth> rue_house: work all the time; i never have training given to me
[09:51:11] <Strangework> :( I am sorry to hear that. I live in New York City, so I can empathize
[09:51:29] <gorroth> Strangework: yeah... i was in nyc for an investment bank before that... left there for the same reason :)
[09:52:08] <gorroth> the good things about my job now are the fantastic pay and the time it gives me to be able to expand myself personally and professionally with outside projects
[09:52:19] <Strangework> Sounds like you've been hopping all over the states :) Are you relatively new to programming MCUs?
[09:52:22] <gorroth> and is letting me have time to work on this robot, which i'd love to get funded after it reaches demo stage
[09:52:30] <gorroth> yes, i'm pretty new to it
[09:52:34] <Strangework> Tell me about this robot!
[09:52:53] <gorroth> it's a lawn mowing machine, hehe... for now, R/C controlled, but i have plans to make it autonomous
[09:53:17] <gorroth> and i will use the same chassis for some other kinds of household yard work that can be automated
[09:54:08] <gorroth> it's R/C now, because, well, before i can even attempt autonomous, i have to be sure all the control systems work
[09:54:19] <gorroth> plus, it's more fun to chase people with R/C
[09:54:25] <gorroth> or it will be
[09:54:32] <Strangework> Excellent thing :D Reminds me of a fleeting description of a gardening robot in Istanbul from the book Neuromancer :)
[09:54:37] <Strangework> Especially since it mows
[09:54:46] <Strangework> **Fun to chase people especially since it mows
[09:55:18] <gorroth> next july, my friend and i are thinking of mounting a set of tubes on it and having the robot use something to light fireworks, and then it can go down the street (with xbee of course) and parade around with roman candles :-)
[09:55:33] <gorroth> lol, yes
[09:55:56] <gorroth> but if we chase people, we will take off the blades :) that might be really fun during halloween though
[09:56:30] <Strangework> That's a good idea if I've ever heard one!
[09:56:48] <Strangework> You generally work on this device alone?
[09:57:06] <gorroth> yes, but my friend is building a prototype chassis for it
[09:57:12] <gorroth> but i do all the EE/CS alone
[09:57:49] <gorroth> PS3 controller is used to control the motors
[09:58:02] <gorroth> i can show you a video if you like, of when i got that all working last night
[09:58:19] <Strangework> Please! Do you also maintain a blog?
[09:58:43] <gorroth> not yet, but i keep all the code on github for enabling uart/spi/16-bit pwm and managing servo signals and stuff
[09:58:50] <gorroth> things people shouldn't have to do themselves all the time
[09:59:05] <gorroth> going to add ISR-driven uart to the code very soon: http://github.com/grimwm/avr
[09:59:09] <gorroth> let me get the vid
[09:59:38] <gorroth> https://www.youtube.com/watch?v=NqLD8liBMcM
[10:00:07] <gorroth> now that i'm on some downtime, i'll work on a blog; that's a good idea
[10:01:22] <gorroth> the code i have up there is also for helping with comms from the PC side and also for using a PS3 controller and helping set it up on the rpi. i'm going to split the code base out to a separate repo before long, i think
[10:01:50] <gorroth> sorry, i'll stop talking
[10:03:52] <Strangework> NO, lol. Don't be ridiculous
[10:03:59] <Strangework> I am only skimming through your code :)
[10:04:18] <gorroth> :)
[10:04:48] <gorroth> i'm going to remove all from the "master" set of programs except for jstest.c and jsmaster.c
[10:05:03] <gorroth> the others are useless since i don't need them anymore, and the AVR side no longer listens to uart for that
[10:05:06] <gorroth> they were just for earlier testing
[10:06:58] <Strangework> I see you using json in joystick.c! I feel that is a very high-level touch. I don't see json used in embedded purposes too often. Pretty cool!
[10:07:29] <gorroth> hehe
[10:07:40] <gorroth> it's being used on the PC side, which is where it makes sense to do it :)
[10:08:14] <Strangework> Ahh! Okay!
[10:08:34] <gorroth> but yeah, makes it easier to setup a config file
[10:08:50] <Strangework> The PS3 controller can communicate with the Xbee module directly?
[10:08:58] <gorroth> repo updated to remove the "dead" master programs, leaving only jstest and jsmaster and adding a jsmaster.conf example
[10:09:28] <gorroth> possibly, but i will just be going through the raspberry pi, and an xbee will also be connected to the rpi
[10:09:57] <gorroth> oh, bbiab... train is pulling into union station
[11:01:06] <gorroth> back
[11:03:55] <Strangework> welcome back!
[11:33:50] <gorroth> ty
[11:50:24] <Strangework> I watched your video, gorroth. I appreciate your explaining each component. Though I've been poking around with MCUs for a while, I haven't ventured into the world of motor control - I work within a very comfortable range of 3.3v to 5v :P If you manage to get a blog up, shoot me a link. I'd like to see how it develops.
[12:08:26] <gorroth> Strangework: certainly, i'll do that :) my main circuit is in the 3.3-5v range, but i just have to do the power step up for the motors themselves
[12:08:58] <gorroth> now that the motor control is finished, it all seems like a piece of cake
[12:09:11] <gorroth> but that thing took me forever, as i had to get each section of the AVR working, and testing it was not easy
[12:09:27] <gorroth> at least going forward in the future, i know my code and hardware is solid, making it easier to rely on it :)
[13:16:30] <Lambda_Aurigae> gorroth, there are literally dozens of serial bootloaders out there.
[13:36:35] <gorroth> Lambda_Aurigae: yeah, i figured
[13:36:38] <gorroth> but i want to write one
[13:37:20] <gorroth> it'll just be another step to solidifying my knowledge on MCUs at this level
[13:42:11] <Lambda_Aurigae> yup.
[13:42:16] <Lambda_Aurigae> done it myself.
[13:42:34] <Lambda_Aurigae> I like my spi sram bootloader.
[13:42:56] <Lambda_Aurigae> totally useless, but it worked.
[13:43:31] <Lambda_Aurigae> currently working on an SD card bootloader/loader for pic32mx chips.
[13:43:44] <Lambda_Aurigae> specifically so I can load programs from the SD card into sram and execute them.
[19:28:02] <Coded1> hello all, I am a noob as far as AVR micros go but I have no fear of breaking stuff. I have an Atmega328p (with no boot loader ) that I would like to program using a raspberry pi. I've followed this guide > http://kevincuzner.com/2013/05/27/raspberry-pi-as-an-avr-programmer/
[19:28:25] <Coded1> but I am unable to get the chip to respond
[19:30:06] <Lambda_Aurigae> well, being new, you should start with something on the simple side and work your way up, in my opinion.
[19:30:26] <Coded1> probably right
[19:30:56] <Lambda_Aurigae> is there data coming out of the rPI?
[19:31:25] <apo_> Coded1: Are your pins connected correctly? Does the pi send data? Does the atmega respond? Check with a scope/logic analyzer/LEDs
[19:32:06] <Coded1> unfortunately I don't have access to a scope/logic analyzer
[19:32:47] <Lambda_Aurigae> do you have access to an LED and resistor?
[19:32:56] <Coded1> lots of those yup
[19:33:06] <Lambda_Aurigae> then use them to see if there is data coming from the rPI.
[19:33:57] <Coded1> k
[19:35:12] <Lambda_Aurigae> do a little troubleshooting.
[19:35:33] <Lambda_Aurigae> maybe try programming the chip with another programmer like an stk200 clone connected to an older computer with a parallel port?
[19:35:50] <radens> Hey, can someone explain the FMUL instruction?
[19:36:21] <apo_> http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_FMUL.html this site can
[19:36:28] <Lambda_Aurigae> performs 8-bit × 8-bit → 16-bit unsigned multiplication and shifts the result one bit left.
[19:36:44] <apo_> Lambda_Aurigae: That phrasing seems familiar
[19:36:49] <Lambda_Aurigae> hehe.
[19:36:50] <radens> I'm looking at the manual, and it says that (N1.Q1)*(N2.Q2) = ((N1+N2).(Q1+Q2))
[19:36:53] <apo_> I could swear I've seen it before
[19:36:57] <Coded1> with the reset signal is sent to the 328P pin 1, should it be held high to program or just momentarily ?
[19:36:57] <Lambda_Aurigae> stolen right from the page you posted!
[19:37:14] <Lambda_Aurigae> Coded1, it should be held LOW while programming.
[19:37:29] <apo_> radens: Those are the numbers of digits before/after the 'decimal' point
[19:37:29] <Lambda_Aurigae> HIGH while in run mode.
[19:37:48] <radens> apo_: ah
[19:37:57] <radens> I was thinking 1.1*3.3 != 2.6
[19:38:16] <Coded1> Lambda_Aurigae: ty
[19:38:21] <Lambda_Aurigae> beanie babies.
[19:38:39] <radens> err 4.4
[19:39:01] <radens> why is FMUL useful?
[19:39:12] <apo_> because <insert page content here>
[19:39:35] <radens> apo_: thank you, I read the page. It has something about digital signals I don't quite get.
[19:40:13] <apo_> If you're multiplying 1.7 fixed-point numbers, it's useful
[19:40:18] <apo_> if you're not, don't bother with it
[19:40:39] <Coded1> what is considered low on the RESET pin?
[19:40:49] <Lambda_Aurigae> low = GND
[19:40:58] <Lambda_Aurigae> high = vcc
[19:41:11] <Lambda_Aurigae> same as most positive digital logic...
[19:41:58] <Coded1> so if I bind RESET to GND it will be in programming mode until I change the voltage?
[19:42:07] <Lambda_Aurigae> the RESET line should normally be held high, connected to VCC, through a 10K ohm resistor.
[19:42:17] <Lambda_Aurigae> pull it low, to GND, to initiate programming.
[19:42:22] <Lambda_Aurigae> just as it says in the datasheet.
[19:42:43] <Coded1> thanks
[19:42:45] <Coded1> again
[19:53:31] <Coded1> when programming the 328p should I have an external XTAL or will it default to the internal clock ?
[19:54:03] <Lambda_Aurigae> how is it set?
[19:54:23] <Lambda_Aurigae> is the chip new?
[19:54:28] <Coded1> yup
[19:54:38] <Coded1> nothing has been done, fresh out of the box
[19:54:40] <Tom_itx> new chip defaults to internal osc
[19:54:44] <Lambda_Aurigae> if so then it is set to internal clock, 1MHz.
[19:54:55] <Tom_itx> left open for you to screw yourself
[19:55:08] <Lambda_Aurigae> so your programming speed will need to be slowed down from what most programmers default to.
[19:55:25] <Tom_itx> 250khz program rate
[19:55:26] <Tom_itx> max
[19:55:51] <Coded1> Lambda_Aurigae: Tom_itx ty both of you
[22:13:20] <xrlk> I found a pretty dank picture https://i.imgur.com/VA2a0aK.jpg
[22:14:38] <Casper> o.O
[23:05:48] <xrlk> is a linear actuator good for quick applied force
[23:05:59] <xrlk> well
[23:06:03] <xrlk> can I get one that is
[23:06:04] <rue_house> depends how its made
[23:06:13] <rue_house> how about a pneumatic one?
[23:06:34] <xrlk> yea
[23:06:41] <xrlk> I was thinking that originally
[23:07:33] <Casper> pneumatic may have issue with precision, hydraulic with speed, electric with size and noise...
[23:07:42] <rue_house> the pic is technically correct, I like it
[23:08:29] <rue_house> wait, farads? not uF?
[23:08:39] <rue_house> 12V wait, how about 35?
[23:36:05] <gorroth> Lambda_Aurigae: sounds pretty awesome about the sd card loader. sounds kind of like the good ol' days of loading your system from floppy :)
[23:36:14] <gorroth> except, you know, more awesome
[23:37:41] <gorroth> Coded1: i use my rpi as a programmer. for myself, i connect physical pins 15,17,19,21,23,25 to my AVR
[23:38:15] <gorroth> Coded1: i use pin 15 (bcm pin 22) to output the reset signal to the avr, and i use avrdude to do this.
[23:38:39] <gorroth> /etc/avrdude.conf has a linuxgpio that you can uncomment and configure
[23:39:32] <gorroth> Coded1: connect all gnd pins to gnd from rpi, and the avr's Vcc to the 3.3v Vout on the rpi. otherwise, your AVR is just going to feed 5v back to the rpi and burn it up
[23:39:55] <gorroth> Coded1: and put a 1k (or whatever) pullup resister from ~RST on the AVR to Vcc
[23:39:58] <gorroth> that will get you started
[23:41:03] <gorroth> Coded1: i have code on http://github.com/grimwm/avr that can be used to help get you started. the fuse settings are for an ATmega168 with external crystal, but you can use the other fuse setting in there and it should work (but doublecheck your datasheet to be sure)
[23:41:24] <gorroth> you'll just have to uncomment it from the avr_toolchain.cmake file and comment out the other fuse one
[23:41:45] <gorroth> i haven't focused on making the fuse part very clean in that project yet :)