#avr | Logs for 2016-04-09

Back
[01:04:28] <WormFood> I was looking for a way, to set and clear bits at the same time, and stumbled across this snippet of code. PORTC = PORTC ^ ((PORTC ^ ((1<<PORTC2)|(1<<PORTC0))) & 0x0F); The 0x0F is the mask, so bits 0 and 2 will be set, and bits 1 and 3 will be cleared, and the rest of PORTC remains unchanged.
[01:05:12] <WormFood> Obviously, it's more instructions than just 2 operations to clear and set the bits you want, but it might be useful if you need to set and clear bits in one operation.
[01:06:31] <WormFood> avr-gcc compiles that snippet of code, into 7 assembly instructions.
[01:06:59] <cehteh> the point is that the final change to the port is atomic
[01:11:11] <WormFood> exactly!
[01:15:15] <WormFood> Which is what I needed ;)
[01:16:09] <WormFood> If you don't need the bit mask, then I don't think there is any advantage in doing it this way.
[01:30:02] <xMopxShell> what's the name of the sockets that accept through hole microcontrollers, typically with a lever on the side to grip/release the pins?
[01:30:17] <WormFood> ZIF
[01:30:35] <WormFood> Zero Insertion Force
[01:30:41] <xMopxShell> bam. thanks WormFood
[01:30:43] * WormFood knew some girls like that
[01:30:46] <xMopxShell> ;)
[01:43:58] <WormFood> That bit/set clear code snippet I just gave, has no advantages over doing it the obvious way. In fact, the obvious way is only 4 opcodes. But, if you need a bit mask, then the previous code snippet is good.
[01:48:55] * cehteh thinks one could use the DDR as mask right away
[02:10:14] <NicoHood> If I write a flash page within the bootloader and the code to update the flash page and the flash page itself to update are equal, what will happen? Lets assume that the new data contains the exact same functions, just different data bytes outside the program function
[02:31:40] <cehteh> using any lib for that?
[02:31:53] <cehteh> the µC does exactly what you are asking it to do
[02:32:32] <cehteh> its advised that you check the content of flash before erasing/writing to prevent unneccesary wear
[02:32:43] <cehteh> (same for eeprom)
[03:52:43] <limpkin> would anyone know an __attribute__ that would prevent a function from not being included in a final firmware? __attribute__((optimize("O0"))) is not enough
[04:29:16] <robotijo> Heyyhoooo
[04:30:06] <robotijo> Anyone have suggestion for easy beginners friendly avr programmer for avrdude
[04:30:29] <robotijo> Appreciate any comments and help, clue
[04:38:37] <lorenzo> robotijo: usbasp
[04:39:01] <lorenzo> please get the genuine one, it's like 9$ and it just works
[04:39:09] <lorenzo> chinese clones often only work at lower clocks, etc
[04:39:24] <robotijo> Can you tell me why you choose usbasp?
[04:39:42] <lorenzo> cheap, works fine
[04:39:47] <lorenzo> usbtinyisp is also good
[04:40:26] <robotijo> Have you tried serial/parallel port?
[04:40:52] <lorenzo> nope
[04:40:57] <lorenzo> I don't have one sadly
[05:15:04] <robotijo> .ok thx lorenzo
[05:41:50] <Lambda_Aurigae> lorenzo, there is a genuine usbasp?
[05:42:10] <Lambda_Aurigae> I thought they were all just clones from that v-usb test project.
[05:50:06] <lorenzo> Lambda_Aurigae: http://www.fischl.de/usbasp/ I think
[05:51:29] <Lambda_Aurigae> aahh.
[05:51:52] <Lambda_Aurigae> it's still a clone/hack of the usbasploader v-usb example project
[05:55:02] <Lambda_Aurigae> hmm
[05:55:24] <Lambda_Aurigae> I guess it's the othe way around...obdev sucked the usbasploader back from usbasp
[05:55:27] <Lambda_Aurigae> interesting.
[05:55:51] <Lambda_Aurigae> it's still v-usb based though which limits the usability in my opinion.
[05:57:01] <Lambda_Aurigae> they could get better stability by running the chip at 3.3V rather than the zener diode lock down from 5V.
[05:57:52] <Lambda_Aurigae> I have several laptops that don't work with v-usb. one will work if you run the chip at 3.3V but not if you use the zener method and run the chip at 5v.
[05:57:55] <Lambda_Aurigae> is very strange.
[05:58:32] <Lambda_Aurigae> but v-usb does some strange things to make usb work anyhow.
[06:01:17] <liwakura> RiskusW was featured on Hackaday.com
[06:01:25] <Lambda_Aurigae> oh?
[06:01:29] <Lambda_Aurigae> which article?
[06:01:39] <liwakura> gimme a second
[06:01:44] <liwakura> or, at least mentioned
[06:01:46] <Lambda_Aurigae> rue_bed, was on it years ago.
[06:01:59] <Lambda_Aurigae> a whole article on his PATA-avr programmer
[06:02:33] <liwakura> Lambda_Aurigae: http://hackaday.com/2016/04/07/reverse-engineering-debugwire/
[06:03:04] <liwakura> was just skimming and saw his nick and though wtf i know that dude
[06:04:29] <Lambda_Aurigae> aahh..I breezed by that one.
[06:06:00] <Lambda_Aurigae> hackaday is on my rss feeds list..along with over 200 other sites.
[06:07:09] <rue_bed> the link to my site for it...
[06:07:29] <Lambda_Aurigae> rue_bed, what about it?
[06:07:46] <liwakura> rue_bed: whats your site?
[06:07:53] <liwakura> ah
[06:07:56] <liwakura> ruemohr
[06:07:57] <rue_bed> http://ruemohr.org/~ircjunk/tutorials/elex/ata2isp/main.html
[06:07:57] <liwakura> got it
[06:08:26] <Lambda_Aurigae> oh...hehe...I have that bookmarked actually.
[06:08:34] <rue_bed> :)
[06:08:49] <liwakura> lol
[06:08:50] <liwakura> i see
[06:09:03] <liwakura> Lambda_Aurigae is the guy you will need in later quests
[06:09:19] <rue_bed> I hope someone makes one one day
[06:09:42] <Lambda_Aurigae> I used that setup to build a gpio from the IDE port once...ports actually.
[06:09:56] <Lambda_Aurigae> as I had a dual ide addon card.
[06:10:17] <Lambda_Aurigae> had to make some minor changes to get it working but I was able to blinky lights.
[06:10:28] <rue_bed> there is a lot of io space in a ata port
[06:10:34] <Lambda_Aurigae> yeah.
[06:11:47] <Lambda_Aurigae> I wired an atmega32 directly to it once way back when and used an SD card to hold disk images....built a semi-virtual cdrom unit.
[06:12:13] <rue_bed> cool
[06:12:15] <Lambda_Aurigae> could eject and load images with 3 buttons and a 16x2 lcd for display.
[06:12:39] <Lambda_Aurigae> it was slower than moles asses in antartica.
[06:13:05] <Lambda_Aurigae> never did get it to play cdrw which was my ultimate goal.
[06:13:36] <rue_bed> I'd like to do the same but with a floppy mfm cable
[06:13:52] <rue_bed> I have serveral apps that just need a floppy disk
[06:14:10] <Lambda_Aurigae> I think I saw similar done with a floppy cable, a microcontroller, and a harddrive...somewhere...years ago.
[06:14:27] <rue_bed> probably been done, yea
[06:14:35] <Lambda_Aurigae> shouldn't be too difficult to emulate a floppy drive
[06:14:50] <Lambda_Aurigae> kinda like my commodore floppy drive emulator.
[06:15:07] <Lambda_Aurigae> it uses a 386 PC running dos and this emulator software.
[06:15:14] <rue_bed> iirc, floppies are fixed bit rate
[06:15:24] <rue_bed> I wonder what the rate is
[06:15:29] <Lambda_Aurigae> parallel port is used to bitbang the commodore bus interface.
[06:15:47] <rue_bed> say, for a 1.4M 3.5
[06:15:55] <Lambda_Aurigae> cable from parallel port to commodore....and you have a commodore harddrive!
[06:16:14] <Lambda_Aurigae> you talking transmission rate? or data storage?
[06:22:48] <Lambda_Aurigae> looks like you would need a pll and a bit of decoding/encoding but it should be doable.
[06:25:36] <Lambda_Aurigae> I know some people in the olden days did some bitbanging on the floppy port to blinky lights and such.
[06:27:03] <Lambda_Aurigae> reboot time...my window manager is doing funky stuff.
[06:33:07] <Lambda_Aurigae> and rue_bed, projects like the ata-isp is why I keep a stack of old p-4 class machines laying around to play with.
[06:33:20] <Lambda_Aurigae> now if I could just convince my wife they are useful.
[06:34:07] <Lambda_Aurigae> 2nd gen of that project could probably be done with a single AVR to play decoder logic.
[06:34:26] <Lambda_Aurigae> I know the goal was to build an avr programmer without having to have a programmed avr....
[06:34:32] <Lambda_Aurigae> or at least, that's what it looks like.
[06:44:15] <NicoHood> the avr instruction set says that jmp is 2 words (4 bytes). However if I add a jmp to my assembly the compiler generates 1word(2byte) jmp commands. Is this normal? I am using atmega 32u4
[06:46:50] <NicoHood> analyzing the hex data shows me that the compiler replaces jmp with rjmp. even in my assembly. That is good but weird.
[06:48:42] <|DM|> I mean, C doesnt let you write to specific places in memory anyways right ?
[06:54:26] <Lambda_Aurigae> well, not usually.
[06:54:29] <Lambda_Aurigae> there are ways.
[06:55:44] <Lambda_Aurigae> NicoHood, rjmp is shorter because it can only jump within a 4K word range.
[06:55:50] <Lambda_Aurigae> jmp is used to go outside that.
[06:56:27] <NicoHood> i know. however i was wondering why may code.S assembly gets converted from jmp to rjmp by the compiler automatically
[06:56:28] <Lambda_Aurigae> so it's optimizing your code for you when it assembles jmp into an rjmp
[06:56:43] <Lambda_Aurigae> I'm sure there's an optimization to turn off to stop that.
[06:56:53] <NicoHood> i now used rjmp directly, as i know it is in range (used fixed addresses)
[06:57:04] <NicoHood> just wanted to understand what happens
[06:57:53] <Lambda_Aurigae> assembler being too smart for your own good.
[06:59:43] <Lambda_Aurigae> also, jmp is not available in all devices.
[07:02:02] <Lambda_Aurigae> what chip are you using?
[07:37:04] <|DM|> Is there a way that doesnt involve inline assembly/assembler labels
[07:37:05] <|DM|> ?
[07:39:45] <NicoHood> 32u4
[09:31:59] <stephe_> i need a logic analyzer
[10:06:37] <Lambda_Aurigae> stephe_, make one.
[10:07:30] <stephe_> Lambda_Aurigae: you done that?
[10:08:33] <Lambda_Aurigae> yup.
[10:08:42] <Lambda_Aurigae> logic shrimp
[10:09:00] <Lambda_Aurigae> http://dangerousprototypes.com/docs/Logic_Shrimp_logic_analyzer
[10:09:14] <Lambda_Aurigae> and logic pirate
[10:09:17] <Lambda_Aurigae> http://dangerousprototypes.com/docs/Logic_Pirate
[10:09:40] <Lambda_Aurigae> although I understand you can get a saelae clone pretty cheap too.
[10:16:41] <stephe_> hmm, that logic pirate seems cool
[10:17:37] <stephe_> wonder if i'd ever need the open bench logic sniffer, seems way too powerful for basic things
[10:30:08] <Lambda_Aurigae> that's the software that works with it.
[10:39:05] <stephe_> Lambda_Aurigae: hmm no seems like a separate tool: http://dangerousprototypes.com/docs/Open_Bench_Logic_Sniffer
[10:40:52] <Lambda_Aurigae> ok..
[10:41:06] <Lambda_Aurigae> yeah...the SUMP Logic analyzer software is what I was thinking.
[10:41:24] <Lambda_Aurigae> that is a far more complex device.
[10:41:52] <Lambda_Aurigae> includes an FPGA and all.
[10:42:11] <Lambda_Aurigae> the logic shrimp and logic pirate are much easier to build...can be built entirely through hole in fact.
[10:42:44] <Lambda_Aurigae> logic pirate being the second gen logic shrimp basically.
[10:57:26] <stephe_> true
[10:58:31] <Lambda_Aurigae> with some minor mods they can be expanded to even more ram and/or more inputs.
[10:58:40] <Lambda_Aurigae> and they can do data output too.
[10:58:58] <Lambda_Aurigae> you can load a logic stream to the sram then just clock it out in theory.
[12:57:56] <rue_shop3> pop quiz, whats the internal vref for the adc on an AVR!
[12:58:36] <Tom_itx> 1.1v
[12:58:45] <Tom_itx> or whatever you set the fuse to
[12:59:04] <rue_shop3> hmm thats low
[12:59:16] <Tom_itx> i used it once on the toaster oven
[12:59:35] <Tom_itx> they may not all be the same though
[13:01:14] <rue_shop3> making a colour sensor
[13:01:32] <rue_shop3> I'v adjusted all the leds to pick up the same resistance on the ldr
[13:01:39] <rue_shop3> which is about 450 ohms
[13:02:34] <rue_shop3> 5V will be too much current at 5V to make the divider from
[13:04:06] <rue_shop3> no robotics kids today, too much sun I recon
[13:04:56] <rue_shop3> balancing the RGB led was 5 mins of fun
[13:05:01] <Lambda_Aurigae> mine don't start till school is out.
[13:05:44] <rue_shop3> thats ok, I was prepped, which means next time someone does show up, the content is ready
[13:06:33] <rue_shop3> I wonder how many adc channels..... arg, the tiny13 has no serial system
[13:06:36] <Lambda_Aurigae> I have 2 beginners and 2 3rd year kids coming this year.
[13:07:05] <Lambda_Aurigae> at least, that's what is signed up so far.
[13:07:05] <rue_shop3> 5 is a handfull
[13:07:14] <rue_shop3> what kinda projects/etc do you do?
[13:07:58] <Lambda_Aurigae> well, the beginners will do entry level electronics learning at first..by the end of the summer they should be programming a simple sumobot kinda thing to do line following or light following.
[13:08:20] <Lambda_Aurigae> I like the light follower..I call it the flashlight puppy dog.
[13:08:30] <rue_shop3> :)
[13:08:46] <Lambda_Aurigae> advanced kids this year will be working with pic32 I think.
[13:08:58] <rue_shop3> ughkg PIC
[13:09:10] <Lambda_Aurigae> doing a competitive robot environment with resources.
[13:09:14] <Lambda_Aurigae> pic32 is not a real pic.
[13:09:16] <rue_shop3> tho I suppose you can program in C now
[13:09:23] <Lambda_Aurigae> it's a mips processor with pic peripherals.
[13:10:03] <Lambda_Aurigae> blows away anything in the atmega world for speed, flash, and ram.
[13:10:14] <rue_shop3> I wonder if mips and arm are gonna be direct compeditors sometime down the road
[13:10:24] <Lambda_Aurigae> mplabX and xc32 run nicely on the p-4 laptops I have for them.
[13:10:25] <rue_shop3> yea, its not a microcontroller
[13:10:34] <Lambda_Aurigae> 28pin dip package
[13:10:50] <Lambda_Aurigae> but it's a modified von newman arch.
[13:11:04] <Lambda_Aurigae> normally program is flash and data is in sram.
[13:11:14] <Lambda_Aurigae> however, you can actually make it run program from sram.
[13:11:39] <rue_shop3> I'm still gonna stand on x86
[13:11:57] <Lambda_Aurigae> x86 is great for a full computer.
[13:12:02] <rue_shop3> tho, I see arm replacing it for me at some point
[13:12:06] <rue_shop3> micro itx
[13:12:08] <rue_shop3> etc
[13:12:09] <rue_shop3> sbc
[13:12:17] <Lambda_Aurigae> haven't found a decent small small form factor for microcontroller like jobs.
[13:12:41] <rue_shop3> you start to see the challanges with the PI layout
[13:12:52] <rue_shop3> a standard is gonna be a challange
[13:13:22] <rue_shop3> esp when your connectors need to come out all 6 sides of the boards due to size constraits :)
[13:13:30] <Lambda_Aurigae> yup.
[13:13:37] <Lambda_Aurigae> I've seen those challenges for many years.
[13:15:10] <rue_shop3> when I started using a standard connector set for the microcontroller boards I was making, it made so many things come togethor in an awesome way
[13:15:13] <Lambda_Aurigae> my vision of this robot vs robot interactive world is to have things like battery packs laying around that they can pick up and use. maybe have 1 or 2 ports they can stuff resource modules into.
[13:15:27] <rue_shop3> but then arduino boards came along that cost, effectivly, nothing...
[13:15:42] <Lambda_Aurigae> and to have the bots have light sensors and directional LEDs..
[13:15:44] <Lambda_Aurigae> for combat.
[13:15:49] <Lambda_Aurigae> basically laser tag bots.
[13:15:57] <rue_shop3> sounds good
[13:16:03] <Lambda_Aurigae> the goal, to survive the longest.
[13:16:10] <Lambda_Aurigae> and map out your environment.
[13:16:15] <rue_shop3> my turnover rate makes the program stay stuck at the basics
[13:16:39] <Lambda_Aurigae> maybe have recharge points where a bot can sit to recharge but then it would be vulnerable to attack.
[13:16:49] <Lambda_Aurigae> so, a tradeoff..do you sit there or do you run?
[13:17:11] <Lambda_Aurigae> do you go for the packs or do you go for the power outlet?
[13:17:32] <Lambda_Aurigae> I suspect it will be a 2 year project ultimately.
[13:17:37] <Xark> rue_shop3: I think MIPS and ARM are direct competitors. However ARM is winning. :)
[13:17:44] <Lambda_Aurigae> yeah.
[13:17:57] <Lambda_Aurigae> arm is winning, specially for the small pc/tablet world.
[13:18:11] <Lambda_Aurigae> mips is more a deep embedded processor.
[13:18:16] <rue_shop3> I dont think mips isn't part of the race, and the tides turn really rapidly in this stuff
[13:18:19] <Lambda_Aurigae> at least, that's where I'm seeing it.
[13:18:31] <rue_shop3> in 10 years I dont think there will be any x86 around
[13:18:50] <rue_shop3> I think x86 is going kinda cancerous, and its gonna die
[13:18:54] <Lambda_Aurigae> if arm gets powerful enough, that's a possibility.
[13:19:12] <rue_shop3> its not that, its manufacturers trying to lock down hardware
[13:19:13] * Xark is really looking forward to playing with something like http://www.eetimes.com/author.asp?doc_id=1323406 (until then, I'll have to synth one on an FPGA). :)
[13:20:22] <Lambda_Aurigae> too bad the old transmeta chip never got any traction.
[13:20:44] <rue_shop3> hey! what about the Z180!
[13:20:50] <Xark> This also looks interesting for an open PC (but expensive). Power8 is nice though... https://raptorengineeringinc.com/TALOS/prerelease.php
[13:21:33] <Xark> Lambda_Aurigae: Apparently Nvidia has come out with a spiritual successor to Transmeta. The latest Tegra has "code morph" type stuff.
[13:21:58] <Lambda_Aurigae> I think they bought the technology actually...it looks an awful lot like the transmeta implementation.
[13:22:05] <Xark> http://www.extremetech.com/computing/174023-tegra-k1-64-bit-denver-core-analysis-are-nvidias-x86-efforts-hidden-within
[13:22:53] <Lambda_Aurigae> yeah..read that a while back.
[13:23:13] <Xark> Lambda_Aurigae: Wikipedia does say "According to Tom's Hardware, there are engineers from Intel, AMD, HP, Sun and Transmeta on the Denver team, and they have extensive experience designing superscalar CPUs with out-of-order execution, very long instruction words (VLIW) and simultaneous multithreading (SMT)."
[13:23:51] <Lambda_Aurigae> still betting someone bought the original design stuff from whatever was left of transmeta.
[13:23:52] <Xark> Hmm, "Also according to Demerjian, Project Denver was originally intended to support both ARM and x86 code using code morphing technology from Transmeta, but was changed to the ARMv8-A 64-bit instruction set because Nvidia could not obtain a license to Intel's patents."
[13:24:22] <Xark> IIRC Nvidia and Intel hate each other (from Xbox zero spat).
[13:24:28] <Lambda_Aurigae> hehe.
[13:24:31] <Lambda_Aurigae> of course they do.
[13:25:02] <Xark> Nvidia used license for Xbox 0 to make a bunch of PC chipsets (which Intel did not intend). :)
[13:26:00] <Lambda_Aurigae> I never followed all that.
[13:26:17] <Lambda_Aurigae> I have no need for xbox so usually anything with that in the topic I ignore.
[13:27:30] <Xark> Intel freaked out when Xbox zero was going to use AMD, so gave a sweetheart deal (and then regretted it). Doubtful future consoles will have Intel... :)
[13:29:20] <Lambda_Aurigae> at least intel will still have apple.
[13:29:41] <Lambda_Aurigae> I spent several multiple hours trying to get a hackintosh vmware instance running here.
[13:29:51] <Lambda_Aurigae> only to find out that it REQUIRES an intel processor.
[13:30:11] <Lambda_Aurigae> my big computer is an 8core amd processor.
[13:30:34] <Lambda_Aurigae> anyhoo...back to my outside project.
[13:30:40] <Lambda_Aurigae> roofing and screening in the deck.
[13:32:53] <Xark> I have an aging Hackintosh running Snow Leopard. Probably should just reformat with Ubuntu or something (Snow Leopard is like WinXP these days). :)
[14:51:24] <Lambda_Aurigae> Jartza, if I didn't know any better I would say you did this!
[14:51:26] <Lambda_Aurigae> http://hackaday.com/2016/04/09/tetris-everywhere-character-lcd-edition/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+hackaday%2FLgoM+%28Hack+a+Day%29
[15:14:03] <Jartza> :)
[15:14:15] <Jartza> Lambda_Aurigae: I thought about something similar
[15:14:22] <Jartza> but lately I've been playing with 3D printer kit
[15:14:36] <Jartza> but I'm already hacking octapentaveega to it
[15:16:29] <Jartza> Lambda_Aurigae: the gap between the character blocks is annoying though
[23:31:22] <_ami_> hey guys
[23:31:38] <_ami_> needed little help in compiling arduino sketches using cmake.
[23:31:54] <_ami_> i get this error while compiling
[23:32:09] <_ami_> make Linking C executable blink.elf avr-gcc: error: unrecognized command line option ‘-rdynamic’
[23:32:23] <_ami_> project link: https://github.com/amitesh-singh/amiduino/tree/master/avr/ami-arduino-cmake
[23:32:41] <_ami_> using avr-gcc version 4.8.1 (GCC)
[23:45:54] <Casper> arduino? #arduino