#avr Logs

Aug 11 2022

#avr Calendar

12:01 AM nuxil: i have written a loop function in asm. was up at 40 cycles.. now i am down to 20 cycles https://bpa.st/VI3Q
12:10 AM nuxil: i been rearraning the routing form the Headers to the outputs like crazy trying to come up with best combination
12:10 AM nuxil: *"routing as in mirror pin"
12:10 AM nuxil: still not fully happy with it :p
12:16 AM nohit: so the masking was faster
12:17 AM nuxil: yes
12:18 AM nuxil: a lot
02:04 AM exp: glad to hear :)
02:23 AM nohit: you got little mistake in your comments
02:23 AM nohit: in ; PinD
02:24 AM nohit: then anding bits
02:24 AM nohit: *the
06:51 AM * nuxil yawns and sips some coffee.
06:52 AM nuxil: yes i saw that little mistake..
07:17 AM exp: it's cool you've made such progress
07:17 AM exp: and i think a naked isr was a bad suggestion by me
07:17 AM exp: there's little advantage in such a tight loop
07:18 AM specing_ is now known as specing
07:22 AM nuxil_: exp, this one has been like a puzzle
07:28 AM nuxil_: a puzzle in the sense that. find the best way to mirror the input EXP1 & ISP header to the "fixed output pins"
07:28 AM nuxil_ is now known as nuxil
07:30 AM nuxil: maybe there's even a better way to arrange them :p,
07:30 AM exp: yep i understand, it's something you'd expect computers to be able to solve for you
07:31 AM exp: z3 etc would if you can express your constraints fully, ie teach it avr asm
07:31 AM nuxil: hehe
07:34 AM qu1j0t3: haha
07:34 AM qu1j0t3: i'm going to assume this isn't something you can solve with a wire ;-)
07:35 AM nuxil: at 1st i tried to use C. and optimization level 1,2,3 but the code it made was crap. so much usage of sbic, basically a sbic for each pin.
07:35 AM nuxil: qu1j0t3, nop. thats a dirty hack and not allowed :P
07:41 AM qu1j0t3: <_<
07:41 AM qu1j0t3: >_>
07:45 AM twnqx: since i'm on and off... what exactly are you trying to solve?
07:46 AM qu1j0t3: on and off....... I GET IT
07:48 AM nuxil: twnqx, i have two 3d printer boards. extending my main board's stepper driver count by using a 2nd board and setting up the mcu as a gpiobridge for the incomming stp,dir enable signale.
07:48 AM twnqx: ah, hm
07:49 AM twnqx: doesn't sound challenging to be, but that's probably just me :P
07:54 AM nuxil: well. so did i. untill i saw how ports where a bits spread out. and that the incomming stp pulses can be less than 2uSec. so a tight loop is needed.
07:55 AM nuxil: but hey my link is up here somewhere. you can try to find a better combo of selecting input to output if you want a challenge :P
07:56 AM twnqx: can you paste it again? i must have missed it
07:57 AM twnqx: oh wait, found it
07:57 AM nuxil: https://bpa.st/TQSQ
07:58 AM twnqx: those commands can't be aggregated unless you explicitly ask them to
07:58 AM twnqx: 'cuase the regs are volatile - if you set one bit in C, that bit must be set in asm
07:59 AM twnqx: hm, your variadic macro for multiple bits is kinda shorter than mine :P
08:01 AM nuxil: macros?
08:02 AM nuxil: you talking abpout PINn PXn ?
08:02 AM twnqx: BITS_SET / BITS_CLEAR
08:03 AM nuxil: youre looking at wrong thing :p
08:03 AM twnqx: well, use the long form if you want to aggreaget it
08:04 AM nuxil: that was just to see how the interrupt looked in asm.
08:04 AM twnqx: the way you wrote it, it HAS to be indiviual sbic
08:04 AM nuxil: yea.
08:05 AM twnqx: and yes, non-naked ISRs suck with their tons of push/pop
08:06 AM twnqx: and the pins are horrible for translating the state through tables :X
08:06 AM nuxil: indeed
08:07 AM twnqx: i can only recommend to shoot the designer of the board, and do it correclt,y yourself
08:07 AM Thrashbarg: ^
08:07 AM nuxil: haha. Crealtiy3D .. known for making crappy print boards. :P
08:11 AM nuxil: twnqx, would a naked isr also take 4 clock cycles to execute ?
08:12 AM nuxil: "The interrupt execution response for all the enabled AVR interrupts is four clock cycles minimum"
08:12 AM nuxil: i guess that applys for a naked isr aswell then
08:12 AM twnqx: yeah, but 20 push is quiote a lot :P
08:13 AM twnqx: at least last time looked an an ISR, though that one was calling cuntsions
08:17 AM twnqx: well, you could fold the isr into thw while (1) { }
08:17 AM twnqx: and permanently out -> in
02:28 PM specing_ is now known as specing
05:20 PM Phantom: is a bionade like lemonade, but made of biologic lemons?
05:44 PM twnqx: it's actually a brand, at least over here... but, yes, kinda
10:17 PM jmiehe1 is now known as jmiehe
11:15 PM nuxil: fiddeling with my asm code and found a mistake. fixing it resulting in 1cycle saved :D Yay..
11:15 PM nuxil: i wish i could use OR with IO tho. like OR r20,PINx would save me more cycles if it was possible.