#avr | Logs for 2016-10-14

Back
[01:50:11] <PoppaVic> as I surmised.
[06:28:12] <hetii> Hello :)
[06:29:31] <hetii> What do you think about such port manipulation? http://pastebin.ca/3728442
[06:31:13] <hetii> then we can have it #define D1 31 and use it like gpio_high(D1);
[07:07:06] <Jartza> hetii: have you checked what kind of code the preprocessor does for it?
[07:08:09] <hetii> no :)
[07:10:25] <Jartza> main.cpp:12:2: note: in expansion of macro 'gpio_high'
[07:10:30] <Jartza> main.cpp:9:68: error: expected primary-expression before ')' token (((P) >= 60 && (P) <= 67) ? PORTG |= (1<<P%10))))))))
[07:11:38] <Jartza> doesn't quite work even
[07:12:25] <hetii> hmm just a second
[07:17:05] <Jartza> just tried with gpio_high(31)
[07:17:06] <Jartza> int main() {
[07:17:06] <Jartza> (((31) >= 0 && (31) <= 7) ? (*(volatile uint8_t *)((0X02) + 0x20)) |= (1<<31%10): (((31) >= 10 & (31) <= 17) ? (*(volatile uint8_t *)((0x05) + 0x20)) |= (1<<31%10): (((31) >= 20 && (31) <= 27) ? (*(volatile uint8_t *)((0x08) + 0x20)) |= (1<<31%10): (((31) >= 30 && (31) <= 37) ? (*(volatile uint8_t *)((0x0B) + 0x20)) |= (1<<31%10): (((31) >= 40 && (31) <= 47) ? (*(volatile uint8_t *)(((0x0E) + 0x20)) |= (1<<31%10): (((31) >= 50 && (31) <= 57) ? (*(volatile uint8_t
[07:17:12] <Jartza> }
[07:17:15] <Jartza> looks scary :)
[07:18:38] <Jartza> that's the preprocessor output
[07:20:04] <specing> needs Ada
[07:20:58] <Jartza> although, looking at it, because the parameter number is static... it might just be possible that gcc optimizes that to one sbi still :)
[07:21:06] <Jartza> didn't try to compile further
[07:21:36] <Jartza> lol
[07:21:37] <Jartza> 100: 59 9a sbi 0x0b, 1 ; 11
[07:22:03] <hetii> just one instruction ?
[07:22:24] <Jartza> well dunno if it was solid answer, as I modified that myself
[07:22:27] <Jartza> but might be
[07:22:46] <Jartza> I've done some scary define shit myself which still just compiles as single opcode
[07:23:29] <Jartza> https://gist.github.com/Jartza/29f70ad559a0f1e7b6ae
[07:23:35] <Jartza> like those which I use with avr all the time
[07:25:51] <hetii> hmm
[07:26:08] <hetii> Jartza: like your way to pass multiple bits that need to be set:)
[07:26:21] <Jartza> me too :)
[07:27:02] <hetii> would be greate if it could set bits on different port
[07:27:20] <Jartza> just enhance it ;)
[09:50:46] <pwillard> Much prettier than _BV()
[10:10:49] <anonnumberanon> I use ___BeeVee(). Much cleaner.
[10:11:31] <anonnumberanon> and ___BeeVeeCeeCee() for even lower stuff
[10:12:47] <bss36504> oh interesting I use ________SET__BIT__IN__REGISTER________()
[10:12:56] <bss36504> I like being as unambiguous as possible
[10:13:23] <Tom_L> the compiler doesn't give a sh**
[10:13:38] <Tom_L> it's only for your reading pleasure
[10:18:12] * limpkin his happy: his kickstarter campaign got funded
[10:19:08] <bss36504> limpkin: link?
[10:19:23] <bss36504> I dont think it's spam if I ask for it
[10:19:58] <Tom_L> yes it is
[10:20:05] <Tom_L> it's a conspiracy
[10:20:28] <bss36504> Oh, like I'm colluding with limpkin to get his link posted?
[10:20:40] <Tom_L> heh
[10:28:00] <limpkin> bss36504: https://www.kickstarter.com/projects/limpkin/mooltipass-mini-your-passwords-on-the-go sorry
[10:32:33] <bss36504> Well that's pretty neat
[10:42:25] <limpkin> thanks
[10:50:43] <pwillard> hehe, love the reference. http://img13.deviantart.net/a828/i/2014/132/6/4/multi_pass_by_kate_fox-d7i43lb.jpg
[10:51:08] <theBear> badaboom !
[10:51:24] <limpkin> yup, that's how we got our name
[10:51:35] <theBear> we who?
[10:51:42] <limpkin> the moolrtipass project
[10:52:41] <theBear> lol faitynuff
[10:52:43] <theBear> fairy
[11:02:20] <salad> limpkin: cool project, pricey though
[11:02:38] <limpkin> salad: super early bird was made for that
[11:02:45] <salad> limpkin: though not really too out of line of others like it hah
[11:37:03] <_ami_> a n00b question abt kicad. In case of making a pcb with non-smd components, i just have to do edge cut to select the size of board and no copper fill (obviously, but wanted to confirm :) )
[11:38:45] <_ami_> ?
[11:38:58] <LeoNerd> boards always need an edge
[11:39:01] <LeoNerd> SMD or not
[11:39:31] <_ami_> yes, but no Cu fill in this case as it does not make sense.
[11:41:01] <twnqx> cu fill always makes sense do get a decent ground...
[12:00:46] <_ami_> wow, that 3d view looks so nice, and pretty useful i think.
[16:17:17] <PoppaVic> OK, I got a cute "WTFF?!" going.. avr-gcc is creating a trampoline-table (which I do NOT need on a 328P), and manages to write it starting right on 0x0 - where the reset and interrupts live.
[16:17:55] <PoppaVic> ANyone got a brilliant solution? Cuz, the idiot Arduino IDE has no problem uploading sensible programs that do work right.
[16:20:24] <cehteh> when you dont define ISR's gcc uses that memory already for programs and the interrupt table is kinds trampoline
[16:21:02] <PoppaVic> well, trust me: it's all movs and shit - and, I dunno why I need a tramp on the 328p.
[16:22:11] <PoppaVic> cehteh: uploading looks like it works, but it blinks like it keeps heading back to the bootloader.
[16:22:54] <cehteh> i never had that problem
[16:23:08] <cehteh> how do you build? some special linker script?
[16:23:08] <PoppaVic> until today, neither had I.
[16:23:21] <PoppaVic> nope. Just make with avr-gcc stuff.
[16:23:24] <cehteh> or maybe some brainfart and your program resetting constantly?
[16:24:17] <PoppaVic> I'll check that, too. Meanhile: I've a pair of funcs that are just wrappers for an asm JMP into the bootloader. Those target-addresses are still gcc byte-oriented, right?
[16:24:46] <cehteh> you can try EMPTY_ISR's and see if anything happens
[16:25:02] <cehteh> but i bet gcc does the right thing and something else is wrong
[16:25:04] <PoppaVic> never seen that. is a macro?
[16:25:09] <cehteh> yes
[16:25:14] <cehteh> like ISR()
[16:25:20] <PoppaVic> and the byte-addressing issue?
[16:25:31] <cehteh> but defining a short directly returning ISR
[16:25:56] <cehteh> addresses in AVR are word oriented
[16:26:09] <cehteh> programm addresses i mean
[16:26:09] <PoppaVic> I know, but inline asm? gcc?
[16:26:30] <cehteh> huh?
[16:26:57] <PoppaVic> this is a line of inline asm in a function: we take some args, but leap into dospm in the bootloader.
[16:26:57] <cehteh> http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html#ga751c22101f7e8f2fbe792c64a81f8dba
[16:27:15] <cehteh> thats the EMPTY_INTERRUPT() not *_ISR
[16:28:21] <cehteh> asm would be word oriented too
[16:28:56] <PoppaVic> OK, let's give that a shot. Thanks
[16:29:26] <cehteh> well thats just a try if gcc does something differently
[16:29:32] <cehteh> i still suspect some brainfart
[16:44:22] <PoppaVic> yeah, well.... It's still happening.. So, time to mask code until it stops
[16:47:01] <theBear> if you doing c -> asm err, troubleshooting, i find just compiling a fragment barely big enough to compile cleanly is helpful
[16:47:08] <PoppaVic> yep
[17:14:46] <PoppaVic> well, I am not up to this today.
[17:24:57] <learath> Read only friday exists for a reason.
[17:29:18] <cehteh> can you rewrite that asm stuff in C?
[21:34:49] <carabia> Tom_L: you're tom itx yes?
[21:35:09] <carabia> what's with the "excitron corp" plug on your page?
[21:39:56] <theBear> i can't see it, but i gonna vote, google related
[21:45:32] <carabia> it's in the links thing
[21:47:06] <carabia> oh well there's another plug on the page too, for stencils!
[22:10:15] <theBear> maybe he works there now
[22:29:45] <carabia> he needs to tell everyone!
[22:30:22] <carabia> hello _ami_ what's up in the pseudo(read: make-believe)-engineering world of software?
[22:31:16] <_ami_> carabia: not doing much of coding these days. Learning kicad. :D
[22:32:37] <carabia> but that can't be for your employer
[22:32:48] <carabia> your employer's some wacky sw provider
[22:32:53] <_ami_> :)
[22:33:08] <carabia> i've got tabs on you
[22:33:31] <_ami_> they do more hw than sw actually.
[22:33:41] <carabia> alright. but don't think big houses go for kicad
[22:34:00] <carabia> could even screw the big from there. just tech hippies
[22:34:06] <_ami_> kicad suits me for my personal projects.
[22:34:35] <carabia> i've been thinking of picking that up too
[22:37:27] <_ami_> carabia: whats up with you? what have you been doing/hacking these days?
[22:38:38] <carabia> hmm
[22:40:02] <carabia> well i've been doing some more fiddling with m7 that's one I guess.
[22:40:10] <carabia> cm7, even
[22:41:17] <carabia> trying to find how far i can push the bitmap-dma controller present in stm's f7s
[22:41:53] <_ami_> high-fi stuffs ;)
[22:43:36] <carabia> not really it's kinda primitive
[22:44:11] <carabia> at work i've been trying to hack a pic can-bus adapter
[22:44:40] <_ami_> cool.
[22:44:51] <carabia> no not cool that thing is giving me trouble
[22:45:02] <_ami_> haha,
[22:46:01] <carabia> they're kind of cheap, about €60 a pop. Which is cheap in comparison with a lot of other commercial universal ones that we have used
[22:46:53] <carabia> when i could roll my own with probably... €10 or so
[22:47:47] <_ami_> ok
[22:48:05] <carabia> well, less than that. the mcp can transceivers are like €1 even in singles off dk
[22:48:42] <_ami_> i had to work on CAN buses before. but the project did not kick off, the investor did not show much interest in it.
[22:49:04] <_ami_> so are you making for GPS/GPRS tracking in vehicles?
[22:49:11] <_ami_> making it*
[22:49:51] <carabia> no
[22:49:59] <_ami_> btw, https://pbs.twimg.com/media/CussbeHXEAADMxF.jpg:large - i did not know that esp12e has more pins (at bottom, SPI pins), i soldered 3 of them on esp12 adapter which is not actually for esp12e. why do seller sell them for esp12e? they should have clearly mention that its for esp12 or esp07.
[22:52:30] <carabia> i'm making it for extracting the vehicle speed data off the ecu bus and converting that into a square wave
[22:53:50] <_ami_> ok
[22:59:13] <carabia> yeah
[23:01:19] <csrf> noob, i need some guidance
[23:01:21] <carabia> all i really need is umm... $1 transceiver (mcp), cm0 w/ can (arm, cause i can...), linear reg for input will do just fine, and an output fet for open drain output to 12v
[23:02:11] <csrf> i need to figure out how to setup a certain routine in asm, never done it before, need some tips on how/where to get started
[23:02:17] <carabia> those arms are under $3, and the rest are probably not worth more than a buck in qty.
[23:04:04] <carabia> could even deadbug it and cover it with hotglue for maximum ghetto-effect
[23:04:20] <_ami_> csrf: want to write code in asm and flash it to avr?
[23:04:26] <_ami_> using linux? or windown?
[23:04:38] <carabia> but the hardware's not the issue... it's the bus specs (well, lack thereof), so I haven't gotten out to reaaallly try it
[23:05:01] <csrf> _ami_ avr asm
[23:05:28] <csrf> i've got a certain routine that needs to do bit packing & unpacking
[23:05:51] <csrf> series of 22 bytes that hold bits for 16 11-bit ints
[23:06:49] <csrf> int 1: byte1+bits1-3 of byte2...int2: bits 4-8 of byte2 + bits1-7 of byte3...etc
[23:07:21] <csrf> using a bit-packed struct right now, but I wanna try to do it in asm, to see if I can get i faster, and as a learning proj
[23:08:42] <csrf> need some tips on what to read up on, and what type of routine/algo I should be aiming for