#avr Logs

Aug 03 2022

#avr Calendar

03:15 AM specing_ is now known as specing
04:08 AM exp: why do you need a conditional? don't you just need to map bits from input port registers to output port registers?
04:09 AM exp: i guess being split across ports is problematic
04:09 AM exp: i'd probably just make a naked isr and try that, but i'm just speculating
04:09 AM exp: don't even know what IC you're using
04:18 AM nuxil: well.. gimme a sec.
04:20 AM nuxil: The chip is a mega 1284. that sits on a 3d printer board. 3DCreality.
04:21 AM nuxil: At top of the file. you see the only headers i have access to. EXP 1 and the ISP on the board.
04:21 AM nuxil: im expanding my mainboard to use this board as a stepper extension
04:24 AM nuxil: so to access all 4 steppers though the onboards headers i must "route ports" as shown in the table.
04:24 AM nuxil: i can not change the pins the stepper drivers are on.
04:26 AM nuxil: i dont see how reading each port and using masking etc would make it better.
04:27 AM nohit: yeah it would probably take same amount of cycles
04:27 AM exp: well if it was an entire port then it'd be one copy between io space
04:28 AM nuxil: not that easy :p
04:28 AM exp: i don't know enough about avr asm to know how to efficiently set bits
04:28 AM exp: so i'm no help to you there sorry
04:29 AM nuxil: sbic/sbis is pretty effective.
04:33 AM nuxil: hmm silly Q. is there a way to increment the PC using add or adc ? add .,0x4 or something? if that it possible i can remove a rjmp and save 1 cycle.
04:34 AM nuxil: i guess not tho :p
05:07 AM kodcode: What hardware/software do I need to burn a bootloader on a atmega328 ? (w/o Arduino IDE!) Thanks in advance.
05:08 AM LeoNerd: avrdude and some sort of actual ISP programmer hardware
05:10 AM kodcode: LeoNerd, thanks.
08:56 AM kodcode: I would like to confirm a detail as I am learning. Is it right that if I would program the AVR with a ISP programmer, it would erase the boot loader on it if existent?
09:18 AM exp: you'll probably begin by erasing the entire flash
09:18 AM exp: but that's only strictly required to clear lock bits i think
09:19 AM exp: if it's a bootloader in its own segment, i believe i've programmed AT90s 'twice' that way
09:22 AM kodcode: exp, from what I see in the datasheet is that the bootloader on a atmega328 does not have a starting address in the flash.
09:23 AM exp: where are you seeing that?
09:23 AM exp: only the 48A / 48PA in the datasheet i am reading are without a small bootloader segment
09:25 AM exp: right and they work like the AT90, you can set the segment size with fuses
09:25 AM exp: https://i.imgur.com/2g8pZGb.png
09:26 AM exp: kodcode: dump fuse and lockbits, see what you get
09:26 AM exp: oh sorry, wrong chip
09:27 AM exp: https://i.imgur.com/nJ8Grdt.png
09:27 AM exp: there, helps if i'm on the right page
09:27 AM kodcode: exp, OK, I'll look around how to do that. I got the impression by looking at the memory map 7-1 (atmega328p)
09:29 AM exp: if you're using avrdude or similar you can just read them out
09:51 AM kodcode: exp, avrdude -p m328p -c arduino -P /dev/cuaU0 -t; dump flash; stk500_recv(): programmer is not responding error reading flash address 0x00000 of part ATmega328Pread operation not supported on memory type "flash"; What am I doing wrong here?
09:52 AM kodcode: (first time using -t, sorry)
09:54 AM exp: i can't say i know offhand sorry
09:54 AM exp: it's been a year+ since i did much with these chips
09:54 AM exp: let me read the manpage
09:55 AM kodcode: exp, oh, don't bother. I can try to read myself first.
09:55 AM kodcode: exp, thanks for the pointers till now
10:02 AM exp: oh it's terminal mode?! wacky
10:12 AM kodcode: exp, How else can you dump memory?
10:14 AM qu1j0t3: kodcode: should be possible with -U
10:24 AM exp: kodcode: it's just the fuses you need to dump
10:24 AM exp: then decode them using url in topic
10:24 AM exp: if lockbits are programmed you will have to erase the whole chip including the bootloader to write to it
10:25 AM exp: if not, then the bootsize fuse tells you what space you can actually write to without overwriting its vectors etc
12:15 PM mindw0rk_ is now known as mindw0rk
03:15 PM specing_ is now known as specing