#avr Logs

Nov 07 2018

#avr Calendar

02:28 AM vishwin60 is now known as vishwin
02:32 AM gruetzkopf is now known as Guest24638
02:57 AM kakimir: why would this save MCUSR register in a variable? https://git.pipapo.org/?p=battswitch.git;a=blob;f=src/battswitch.c
02:57 AM kakimir: and noinit it
03:07 AM jadew: traitor
03:08 AM jadew: it says so in the comments
03:08 AM jadew: *says why
03:08 AM jadew: /* preserved status register, needed for detecting reboots from reset */
05:08 AM cehteh: kakimir: from the datasheet: To make use of the Reset Flags to identify a reset condition, the user should read and then reset
05:08 AM cehteh: the MCUSR as early as possible in the program. If the register is cleared before another reset
05:08 AM cehteh: occurs, the source of the reset can be found by examining the Reset Flags.
05:22 AM gruetzko- is now known as gruetzkopf
08:05 AM kakimir: now I understand
08:06 AM kakimir: cehteh: thanks
08:06 AM kakimir: totally forgot that
08:06 AM kakimir: you actually need to manually reset those registers
09:22 AM kakimir: what state I can expect ram mem be after PUR?
09:22 AM kakimir: power-up reset
09:23 AM kakimir: any state?
09:23 AM kakimir: oh it's inrelevant
09:24 AM kakimir: I'll know if PUR happend
09:24 AM kakimir: just clear stuff when PUR occurs
09:28 AM LeoNerd: I wouldn't rely on any of it to be correct; after undervolt conditions any of the static RAM cells might be unknown
09:32 AM skz81: LeoNerd, isn't a BoD setting that garantess to avoid this ?
09:32 AM skz81: garantees*
09:32 AM LeoNerd: The BoD setting ensures that the reset generator will reset you
09:33 AM LeoNerd: You then use that reset to know "ok, need to reinitialise". Admittedly things like avr-libc just reinitialise RAM anyway
09:38 AM skz81: ok my bad, the DS speaks about flash corruption that may occur on undervoltage condition
09:40 AM LeoNerd: Ahyes, if undervolt happens during flash writing
09:42 AM kakimir: I wonder why io header for tiny20 have BODF
09:42 AM kakimir: bod or por I want to clear my values
09:44 AM kakimir: actually BORF
10:29 AM twnqx is now known as Charlie``
10:38 AM cehteh: kakimir: hence the NOINIT, that prevents the libc from clearing stuff
10:39 AM cehteh: otherwise ram is uninitialized after a reset, but processor registers are initialized according to the datasheet
10:41 AM kakimir: i know .noinit
10:42 AM kakimir: usbasp - can I short reset to gnd while it's connected to usbasp?
10:43 AM kakimir: usbasp defaults pins to inactive states?
02:40 PM grog_o is now known as Grogdor
02:44 PM [1]MrMobius is now known as MrMobius
02:51 PM Maya-sama is now known as Miyu
03:36 PM gruetzkopf is now known as Guest28123
03:45 PM gruetze_ is now known as gruetzko-
05:48 PM gruetzko- is now known as gruetzkopf
11:49 PM day__ is now known as day