#avr Logs

Aug 10 2022

#avr Calendar

03:18 AM nuxil_ is now known as nuxil
03:37 AM nuxil: Simple test C code https://bpa.st/4RKA -> Disassembled https://bpa.st/ZPYQ#1L43
03:37 AM nuxil: What is the puprpose of using GPIOR0 and SPL and SPH register here at line 45/46 ?
03:58 AM exp: is that GPIOR0 or is it just setting up the stack pointer?
03:59 AM twnqx: i think it's not GPIOR0 :P
04:00 AM twnqx: "When addressing I/O Registers as data space using LD and ST instructions, the provided offset must be used. When using the I/O specific commands IN and OUT, the offset is reduced by 0x20, resulting in an I/O address offset within 0x00 - 0x3F."
04:00 AM exp: right, it's io direct so it's both the stack pointer bytes
04:00 AM twnqx: "out" to GPIOR0 would use 0x1e
04:01 AM twnqx: yeah, this just sets up stack to the top of ram (16bit address)
04:01 AM exp: although that address would be what, 16k?
04:01 AM exp: which i doubt it has in ram
04:01 AM exp: but i guess with offsets that's right
04:02 AM nuxil: oh it must be the SPL,SPH : When addressing I/O Registers as data space the offset address is 0x3D..
04:02 AM nuxil: rtfm is a good idea :p
08:24 AM rue_bed: I find it handy to also look at C source only compiled to assembler
08:25 AM rue_bed: there are a lot of good tricks woven into gcc
08:49 AM charlie_ is now known as twnqx
09:14 AM exp: rue_bed: and some horrendous messes *cough* 16 bit pointers *cough*
10:05 AM phryk_ is now known as phryk
07:41 PM rue_bed: well, ya just clean all that out when you rewrite the assembler
08:22 PM nuxil: rue_bed, looking at the C source can be handy indeeed. gcc -S foo.c
08:22 PM nuxil: also creating a lss file is kind of handy. its kind of like a mix of asm and the C code.
08:26 PM nuxil: anywho i was most curiouse about how the interrupt would look like in asm, as in trying to get as few cycles out of my gpio bridge as possible,
08:27 PM nuxil: but using a pin change interrupt is awefull. to much pushing and poopin going on. besided it takes min 4 cycles for the isr to exectute. thats like 4 instructions missed right there :P
11:53 PM nohit: i think exp alreayd suggested naked isr
11:53 PM nohit: to avoid pushing and poopin
11:54 PM nohit: also you could write the isr in asm yourself