#avr | Logs for 2015-10-17

Back
[01:09:14] <FrankD> hmm
[01:45:04] <Xark> FrankD: Since with USI you basically execute two instructions per bit, you can just execute more instructions (with a load data opcode before the 2nd 16).
[01:50:21] <FrankD> hmm
[01:50:47] <FrankD> is the DDR? register pin 0..7 or 7..0?
[01:51:33] <FrankD> been a while
[01:53:43] <Casper> 7-0
[01:54:25] <Casper> easy, the order is like our number system.... 1000 > 0001
[01:58:28] <FrankD> so 0b00000001 is PIN0? excellent
[01:58:39] <Casper> exactly
[02:32:34] <FrankD> thanks!
[07:50:01] <Lisa1157> Hi was wondering if any1 has any knowledge of Atmega2560 here, I am writing a program to measure the rpm of my motor but for some reason I keep getting 0 as the output
[07:58:33] <apo__> Lisa1157: We'll need more information than that.
[07:59:07] <apo__> (How are you trying to measure the RPM, for starters)
[07:59:10] <apo__> (And where's the code)
[08:05:46] <Lisa1157> apo__: https://dpaste.de/X0aa3
[08:06:23] <apo__> oh dear, asm. This is gonna take a while :D
[08:08:43] <antto> i don't read asm
[08:10:44] <Lisa1157> apo__: here is another sample that was written by someone else that is meant to do the same thing, he is out of contact for the weekend though
[08:10:48] <Lisa1157> apo__: https://dpaste.de/tFwX
[08:11:41] <osteri> why the asm?
[08:12:18] <osteri> why not binary?
[08:12:56] <Lisa1157> osteri: Kappa
[08:13:23] <Lisa1157> osteri: have to cause it is required by my course
[08:14:29] <osteri> any other reason than that would be madness
[08:14:49] <apo__> osteri: there /are/ reasons to do stuff with asm...
[08:15:34] <antto> there bytes 262144 for asm codez on teh chip
[08:15:47] <osteri> i don't see much reasons
[08:16:17] <antto> wut.. did i really wrote such a broken sentence
[08:16:20] * antto hides
[08:16:41] <osteri> especially whole program in asm
[08:19:04] <apo__> Lisa1157: is your ext_int2 getting triggered at all?
[08:19:32] <apo__> Lisa1157: also, you're not saving the temp register in interrupts
[08:32:42] <Lisa1157> apo__: how can I check for ext_int2 getting triggered?
[08:34:24] <Lisa1157> apo__: also i thought lines 216,217,218 would output the counter as required?
[08:35:49] <apo__> Lisa1157: toggle an LED while you're in it or something
[08:36:09] <apo__> Lisa1157: but in 183 you're overwriting temp :p
[08:36:15] <apo__> in the other interrupts as well
[08:38:45] <apo__> But I guess you're doing all the work in interrupts anyway
[08:38:55] <apo__> unless they get triggered before main starts looping it doesn't matter
[08:42:28] <apo__> Lisa1157: you're doing too much in the interrupts.
[08:42:37] <apo__> Lisa1157: Especially the LCD stuff, don't do that there.
[08:42:55] <apo__> Lisa1157: You have a bunch of really long waits in that, and no other interrupts can run while you're in an interrupt
[08:43:14] <Lisa1157> apo__: okay ill take a look at restructuring it a bit,
[08:43:59] <Lisa1157> apo__: was there anything glaringly wrong with my second link code?
[08:44:51] <apo__> second link? Dunno
[08:45:03] <apo__> Having to read through one asm file is enough =P
[08:46:00] <apo__> Lisa1157: But what you should do in the timer interrupt is store the current counter somewhere, set a flag for the main loop to push that out, and reset the counter
[08:46:07] <apo__> keep your interrupts small
[08:47:10] <Lisa1157> apo__: alright thx alot for ur help
[18:36:15] <gorroth> hmm, i'm trying to use the bootloader asm from the datasheet on the m88. does that not assemble using gas (avr-as)?
[18:38:37] <Lambda_Aurigae> dunno.
[18:38:45] <Lambda_Aurigae> didn't know the datasheet had a full bootloader in it.
[18:38:57] <gorroth> it has some sort of bootloader anyway
[18:41:38] <Lambda_Aurigae> where in the datasheet?
[18:42:12] <Lambda_Aurigae> aahh..page 265.
[18:42:22] <gorroth> ya
[18:42:34] <gorroth> maybe i'll take the chicken's way out and write it in C
[18:42:38] <Lambda_Aurigae> I don't think it is complete.
[18:42:48] <gorroth> looks like libc-avr has avr/boot.h to help out
[18:42:56] <Lambda_Aurigae> yes.
[18:43:02] <Lambda_Aurigae> that code looks like it is missing stuff.
[18:43:04] <gorroth> and i can reuse my uart header, even though it'll be a larger bootloader in the end
[18:43:08] <gorroth> yeah, it might be
[18:43:13] <gorroth> i haven't written asm like that in ages
[18:43:19] <gorroth> i never did much of it anyway
[18:43:19] <Lambda_Aurigae> like, some headers and definitions.
[18:44:03] <gorroth> well, thanks for taking a look. you seem to be more up on it
[18:44:05] <Lambda_Aurigae> I usually write things in C with assembly subroutines for timing critical stuff.
[18:44:11] <gorroth> yes, that's what i do
[18:44:28] <gorroth> for the bootloader, i thought i'd go a diff route, but i failed :)
[18:44:39] <Lambda_Aurigae> or, more often, steal other people's code and mod it to fit my own purposes
[18:44:44] <gorroth> that's what i'm doing
[18:44:45] <gorroth> in C
[18:44:49] <gorroth> >:)
[18:45:00] <Lambda_Aurigae> there are dozens of bootloaders out there to work from.
[18:45:17] <gorroth> yeah, i'm starting with someone else's for inspiration and to figure this out faster
[18:45:28] <gorroth> since it's not the interesting part of my project... just something i'd really love having and understanding
[18:45:44] <Lambda_Aurigae> well, understanding isn't too hard.
[18:45:56] <gorroth> true
[18:46:21] <Lambda_Aurigae> in general, the command that writes to flash has to be executed from the bootloader section of memory.
[18:46:33] <Lambda_Aurigae> and you have to write to the flash one page at a time...erasing the page first.
[18:47:17] <gorroth> yeah, i read all that so far
[18:47:43] <gorroth> you have to erase the page's word, then, while still pointing to the same page's word, write it
[18:47:46] <Lambda_Aurigae> a bootloader usually accepts the data and puts it in ram then writes it out to flash...one or two pages at a time.
[18:47:52] <gorroth> yeah
[18:48:06] <gorroth> that's basically the route i was going to take, based on what i read
[18:48:15] <gorroth> but you know, translating the idea to code is a little easier said than done
[18:48:41] <Lambda_Aurigae> I'm about to cause a rift in the space/time/microcontroller continuum.
[18:48:49] <gorroth> oh really?
[18:49:03] <Lambda_Aurigae> just got some pic16f1455 chips..14 pin dip that can do full speed usb without any external components.
[18:49:09] <Lambda_Aurigae> fully self contained.
[18:49:21] <Lambda_Aurigae> gonna try to make an avr programmer from one.
[18:50:36] <gorroth> ooooooo
[18:50:47] <gorroth> you will program the AVRs over SPI or UART?
[18:50:56] <Lambda_Aurigae> over the ISP port...spi..
[18:51:01] <gorroth> okay
[18:51:06] <Lambda_Aurigae> just like any old avr programmer.
[18:51:09] <gorroth> yeah
[18:51:17] <gorroth> that sounds good
[18:51:23] <gorroth> bbiab... heading to my house
[18:51:50] <Lambda_Aurigae> make it emulate the avr903 protocol or whatever it is.
[18:52:37] <Lambda_Aurigae> avr-109 rather.
[18:53:44] <Lambda_Aurigae> or maybe the stk500 protocol.
[18:53:54] <Lambda_Aurigae> and include a clock source.
[20:24:22] <gorroth> sounds really fun, Lambda_Aurigae
[20:24:40] <Lambda_Aurigae> yeah.
[20:24:52] <Lambda_Aurigae> just gotta get time in the workshop to work on it.
[20:25:18] <Lambda_Aurigae> not sure but there might be enough space on the chip to put a usb bootloader too.
[20:47:13] <abcminiuser> This. Changes. Everything.
[20:47:29] <abcminiuser> I'm told AS7 can cope with tools using libUSB *instead* of Jungo now
[20:50:17] <Lambda_Aurigae> dunno.
[20:50:23] <Lambda_Aurigae> it still won't run for shit on linux.
[20:51:00] <abcminiuser> I'd rather it was awesome on just Windows, than mediocre (Eclipse) on every platform, to be honest
[20:52:08] <Lambda_Aurigae> I don't consider eclipse even mediocre.
[20:52:38] <abcminiuser> It's the go-to solution for every vendor that wants cross-platform, but I've NEVER EVER had a good experience with it
[20:52:45] <gorroth> Eclipse is such garbage
[20:52:59] <abcminiuser> AVR32 Studio, TI's bullshit IDE, NXP's garbage one, Xilinx's buggy crap
[20:53:03] <gorroth> I'd like CLion to work for me, but they force you into their own cmake build dir, which pisses me off so much
[20:53:15] <gorroth> i use qtcreator for avr work on linux
[20:53:27] <abcminiuser> Yeah I wanted to like it, but I just like makefiles *shrugs*
[20:53:39] <abcminiuser> I use Sublime and makefiles for dev work
[20:53:45] <gorroth> ah, okay. i use cmake
[20:53:45] <osteri> embedded scene is full of proprietary stuff :/
[20:53:54] <Lambda_Aurigae> yup.
[20:53:59] <abcminiuser> Jupp, compilers included usually
[20:54:02] <Lambda_Aurigae> I like kate and command prompt these days.
[20:54:09] <osteri> qt-creator, so underrated IDE!
[20:54:17] <osteri> i use it for everything
[20:54:21] <Lambda_Aurigae> make files are powerful but complex as hell....and black magic.
[20:54:34] <osteri> you can have makefiles in qt-creator
[20:54:38] <abcminiuser> QTC is not too bad, it's not amazing but it's decent
[20:54:40] <osteri> and vim
[20:54:44] <Lambda_Aurigae> I've taken to writing build scripts in bash.
[20:55:01] <gorroth> abcminiuser: but what tool were you talking about earlier? Jungo
[20:55:01] <osteri> what makes it decent and not amazing?
[20:55:22] <gorroth> osteri: i think qtcreator is okay... clion would be a lot better if it let me choose my cmake build dir to an existing one
[20:55:35] <abcminiuser> Jungo, it's a terrible, terrible, expensive and terrible USB driver for Windows
[20:55:37] * gorroth still hopes for Visual Studio with full C/C++ support on linux
[20:55:45] <gorroth> ahh, okay
[20:55:55] <gorroth> and what is AS7 then?
[20:55:56] <Lambda_Aurigae> gorroth, you sick bastard.
[20:56:03] <gorroth> heh
[20:56:07] <abcminiuser> Atmel used it for years, it's pretty much what you'd get if you let the Exclipse guys do kernel development
[20:56:22] <abcminiuser> AS7, Atmel Studio 7
[20:56:24] <Lambda_Aurigae> visual studio on linux....that's like wishing for the pope to be a devil worshipper.
[20:56:29] <gorroth> ahhhhh, okay
[20:56:31] <abcminiuser> It's Atmel's IDE based on Visual Studio, it's nice
[20:56:41] <gorroth> Lambda_Aurigae: not exactly. MSFT has released Visual Studio Code on linux
[20:56:47] <gorroth> but it's not a full system yet
[20:57:18] <Lambda_Aurigae> microsoft also still uses linux at the core of hotmail because every time they switch fully to microsoft software it gets hacked.
[20:57:31] <gorroth> haha
[20:57:41] <gorroth> i thought hotmail used to be BSD though
[20:57:56] <Lambda_Aurigae> it was a combination I'm sure.
[20:57:59] <abcminiuser> VS Code is just rebranded Atom, isn't it?
[20:58:15] <gorroth> maybe. i think it was just a pure BSD place before microsoft bought it
[20:58:25] <gorroth> abcminiuser: i don't know actually
[20:58:28] <Lambda_Aurigae> still, non-mickysoft.
[20:58:52] <gorroth> it'd be nice to see BSD make a comeback
[20:59:01] <Lambda_Aurigae> try it...is pretty nice these days.
[20:59:23] <gorroth> no, i really disliked building from ports
[20:59:57] <gorroth> like i'd use their binaries, but then one of them would be missing a feature. and once you start building something from ports, you basically have to go that round for everything from then on
[21:00:06] <gorroth> maybe i was nub at the time or something, but i hated that
[22:53:37] <Tom_itx> is studio 7 better than 6?
[22:53:46] <Tom_itx> couldn't possibly be any slower..
[22:59:44] <Lambda_Aurigae> I hear it's better.
[22:59:55] <Lambda_Aurigae> haven't actually fired up a windows machine to test it.
[23:00:11] <Tom_itx> well i haven't even downloaded it yet
[23:00:23] <Lambda_Aurigae> I did.
[23:00:28] <Lambda_Aurigae> it wouldn't install on wine.
[23:01:05] <Tom_itx> kinda wanted to see if my programmer still worked under it
[23:03:01] <Lambda_Aurigae> unknowed there.
[23:04:51] <Lambda_Aurigae> I started to rip a hole in the space/time/microcontroller continuum this evening.
[23:05:08] <Lambda_Aurigae> sitting here watching movies and porting the stk500 protocol to a usbPIC chip.
[23:10:24] <FrankD> urgh
[23:10:53] <FrankD> i cant get bit banging SPI for this damn ADC yet
[23:11:02] <FrankD> 18 bit transfers argh!
[23:12:53] <Lambda_Aurigae> is it true spi or just shift register for 18 bits?
[23:20:40] <Tom_itx> the last time they said it may take a few minutes.. it was hours
[23:20:58] <Lambda_Aurigae> they? it?
[23:21:10] <Tom_itx> installing it
[23:21:27] <Lambda_Aurigae> aahh.